ipmi_user.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * Redistribution of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. *
  11. * Redistribution in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * Neither the name of Sun Microsystems, Inc. or the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * This software is provided "AS IS," without a warranty of any kind.
  20. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  21. * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
  22. * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
  23. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
  24. * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
  25. * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
  26. * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
  27. * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
  28. * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
  29. * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
  30. * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  31. */
  32. #ifndef IPMI_USER_H
  33. #define IPMI_USER_H
  34. #if HAVE_CONFIG_H
  35. # include <config.h>
  36. #endif
  37. #include <ipmitool/ipmi.h>
  38. #define IPMI_PASSWORD_DISABLE_USER 0x00
  39. #define IPMI_PASSWORD_ENABLE_USER 0x01
  40. #define IPMI_PASSWORD_SET_PASSWORD 0x02
  41. #define IPMI_PASSWORD_TEST_PASSWORD 0x03
  42. #define IPMI_USER_ENABLE_UNSPECIFIED 0x00
  43. #define IPMI_USER_ENABLE_ENABLED 0x40
  44. #define IPMI_USER_ENABLE_DISABLED 0x80
  45. #define IPMI_USER_ENABLE_RESERVED 0xC0
  46. /* (22.27) Get and (22.26) Set User Access */
  47. struct user_access_t {
  48. uint8_t callin_callback;
  49. uint8_t channel;
  50. uint8_t enabled_user_ids;
  51. uint8_t enable_status;
  52. uint8_t fixed_user_ids;
  53. uint8_t ipmi_messaging;
  54. uint8_t link_auth;
  55. uint8_t max_user_ids;
  56. uint8_t privilege_limit;
  57. uint8_t session_limit;
  58. uint8_t user_id;
  59. };
  60. /* (22.29) Get User Name */
  61. struct user_name_t {
  62. uint8_t user_id;
  63. uint8_t user_name[17];
  64. };
  65. int ipmi_user_main(struct ipmi_intf *, int, char **);
  66. int _ipmi_get_user_access(struct ipmi_intf *intf,
  67. struct user_access_t *user_access_rsp);
  68. int _ipmi_get_user_name(struct ipmi_intf *intf, struct user_name_t *user_name);
  69. int _ipmi_set_user_access(struct ipmi_intf *intf,
  70. struct user_access_t *user_access_req,
  71. uint8_t change_priv_limit_only);
  72. int _ipmi_set_user_password(struct ipmi_intf *intf,
  73. uint8_t user_id, uint8_t operation,
  74. const char *password, uint8_t is_twenty_byte);
  75. #endif /* IPMI_USER_H */