ipmi_session.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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_SESSION_H
  33. #define IPMI_SESSION_H
  34. #if HAVE_CONFIG_H
  35. # include <config.h>
  36. #endif
  37. #include <ipmitool/ipmi.h>
  38. #define IPMI_GET_SESSION_INFO 0x3D
  39. /*
  40. * From table 22.25 of the IPMIv2 specification
  41. */
  42. #ifdef HAVE_PRAGMA_PACK
  43. #pragma pack(1)
  44. #endif
  45. struct get_session_info_rsp
  46. {
  47. uint8_t session_handle;
  48. #if WORDS_BIGENDIAN
  49. uint8_t __reserved1 : 2;
  50. uint8_t session_slot_count : 6; /* 1-based */
  51. #else
  52. uint8_t session_slot_count : 6; /* 1-based */
  53. uint8_t __reserved1 : 2;
  54. #endif
  55. #if WORDS_BIGENDIAN
  56. uint8_t __reserved2 : 2;
  57. uint8_t active_session_count : 6; /* 1-based */
  58. #else
  59. uint8_t active_session_count : 6; /* 1-based */
  60. uint8_t __reserved2 : 2;
  61. #endif
  62. #if WORDS_BIGENDIAN
  63. uint8_t __reserved3 : 2;
  64. uint8_t user_id : 6;
  65. #else
  66. uint8_t user_id : 6;
  67. uint8_t __reserved3 : 2;
  68. #endif
  69. #if WORDS_BIGENDIAN
  70. uint8_t __reserved4 : 4;
  71. uint8_t privilege_level : 4;
  72. #else
  73. uint8_t privilege_level : 4;
  74. uint8_t __reserved4 : 4;
  75. #endif
  76. #if WORDS_BIGENDIAN
  77. uint8_t auxiliary_data : 4;
  78. uint8_t channel_number : 4;
  79. #else
  80. uint8_t channel_number : 4;
  81. uint8_t auxiliary_data : 4;
  82. #endif
  83. union
  84. {
  85. /* Only exists if channel type is 802.3 LAN */
  86. struct
  87. {
  88. uint8_t console_ip[4]; /* MSBF */
  89. uint8_t console_mac[6]; /* MSBF */
  90. uint16_t console_port; /* LSBF */
  91. } lan_data;
  92. /* Only exists if channel type is async. serial modem */
  93. struct
  94. {
  95. uint8_t session_channel_activity_type;
  96. #if WORDS_BIGENDIAN
  97. uint8_t __reserved5 : 4;
  98. uint8_t destination_selector : 4;
  99. #else
  100. uint8_t destination_selector : 4;
  101. uint8_t __reserved5 : 4;
  102. #endif
  103. uint8_t console_ip[4]; /* MSBF */
  104. /* Only exists if session is PPP */
  105. uint16_t console_port; /* LSBF */
  106. } modem_data;
  107. } channel_data;
  108. } ATTRIBUTE_PACKING;
  109. #ifdef HAVE_PRAGMA_PACK
  110. #pragma pack(0)
  111. #endif
  112. int ipmi_session_main(struct ipmi_intf *, int, char **);
  113. #endif /*IPMI_CHANNEL_H*/