libipmi_struct.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. /**
  2. * @file libipmi_struct.h
  3. * @author Rajasekhar (rajasekharj@amiindia.co.in)
  4. * @date 02-Sep-2004
  5. *
  6. * @brief Contains data structures required for establishing a session
  7. *
  8. */
  9. #ifndef __LIBIPMI_STRUCT_H__
  10. #define __LIBIPMI_STRUCT_H__
  11. #include "com_BmcType.h"
  12. #pragma pack(1)
  13. #define MAX_REQUEST_SIZE 1024
  14. #define MAX_RESPONSE_SIZE 1024
  15. #define IP4_VERSION 4
  16. #define IP6_VERSION 6
  17. #define IP4_ADDR_LEN 4
  18. #define IP6_ADDR_LEN 16
  19. ///**
  20. // @def LAN_CHANNEL_T
  21. // @brief holds data required for network medium
  22. //*/
  23. //typedef struct LAN_CHANNEL_T_tag {
  24. // char szIPAddress[46];
  25. // uint16 wPort;
  26. // SOCKET hSocket;
  27. // uint8_t byIsConnected;
  28. // uint8_t bProtocol;
  29. // uint8_t bFamily;
  30. //} LAN_CHANNEL_T;
  31. ///**
  32. // @def UDS_CHANNEL_T
  33. // @brief holds data required for network medium
  34. //*/
  35. //typedef struct UDS_CHANNEL_T_tag {
  36. // uint16 hSocketPath;
  37. // SOCKET hSocket;
  38. // uint8_t byIsConnected;
  39. //} UDS_CHANNEL_T;
  40. ///**
  41. // @def SERIAL_CHANNEL_T
  42. // @brief holds data required for Serial medium
  43. //*/
  44. //typedef struct SERIAL_CHANNEL_T_tag {
  45. // char szdevice[32];
  46. //} SERIAL_CHANNEL_T;
  47. /* Authentication Types */
  48. #define AUTHTYPE_NONE 0x00
  49. #define AUTHTYPE_MD2 0x01
  50. #define AUTHTYPE_MD5 0x02
  51. #define AUTHTYPE_RESERVED 0x03
  52. #define AUTHTYPE_STRAIGHT_PASSWORD 0x04
  53. #define AUTHTYPE_OEM_PROPRIETARY 0x05
  54. #define AUTHTYPE_RMCP_PLUS_FORMAT 0x06
  55. /* Privilege levels */
  56. #define PRIV_LEVEL_NO_ACCESS 0x0F
  57. #define PRIV_LEVEL_PROPRIETARY 0x05
  58. #define PRIV_LEVEL_ADMIN 0x04
  59. #define PRIV_LEVEL_OPERATOR 0x03
  60. #define PRIV_LEVEL_USER 0x02
  61. #define PRIV_LEVEL_CALLBACK 0x01
  62. #define PRIV_LEVEL_RESERVED 0x00
  63. /* Authentication Algorithms */
  64. #define AUTH_ALG_RAKP_NONE 0x00
  65. #define AUTH_ALG_RAKP_HMAC_SHA1 0x01
  66. #define AUTH_ALG_RAKP_HMAC_MD5 0x02
  67. /* Integrity Algorithms */
  68. #define INTEGRITY_ALG_NONE 0x00
  69. #define INTEGRITY_ALG_HMAC_SHA1_96 0x01
  70. #define INTEGRITY_ALG_HMAC_SHA1_128 0x02
  71. #define INTEGRITY_ALG_MD5_128 0x03
  72. /* Confidentiality Algorithms */
  73. #define CONFIDENTIALITY_ALG_NONE 0x00
  74. #define CONFIDENTIALITY_ALG_AES_CBC_128 0x01
  75. #define CONFIDENTIALITY_ALG_XRC4_128 0x02
  76. #define CONFIDENTIALITY_ALG_XRC4_40 0x03
  77. /* Payload Types */
  78. #define PAYLOAD_TYPE_IPMI 0
  79. #define PAYLOAD_TYPE_SOL 1
  80. #define PAYLOAD_TYPE_RSSP_OPEN_SES_REQ 0x10
  81. #define PAYLOAD_TYPE_RSSP_OPEN_SES_RES 0x11
  82. #define PAYLOAD_TYPE_RAKP_MSG_1 0x12
  83. #define PAYLOAD_TYPE_RAKP_MSG_2 0x13
  84. #define PAYLOAD_TYPE_RAKP_MSG_3 0x14
  85. #define PAYLOAD_TYPE_RAKP_MSG_4 0x15
  86. #define MAX_KEY1_SIZE 20
  87. #define MAX_KEY2_SIZE 20
  88. #define MAX_GUID_SIZE 16
  89. //#define MAX_USER_NAME_LEN (16+1) //1 for stroing the null character
  90. //#define MAX_USER_PWD_LEN (20+1) //1 for storing the null character
  91. #define MAX_RAND_NO_LEN 16
  92. /* (0x6 << 2) == 0x18 */
  93. #define DEFAULT_NET_FN_LUN 0x18
  94. #define NETFNLUN_IPMI_APP 0x18
  95. #define NETFNLUN_IPMI_SENSOR 0x10
  96. #define NETFNLUN_IPMI_STORAGE 0x28
  97. #define NETFNLUN_IPMI_CHASSIS 0x00
  98. ///**
  99. // @def IPMI20_NETWORK_SESSION_T
  100. // @brief holds data required for maintaining session with network medium
  101. //*/
  102. //typedef struct IPMI20_NETWORK_SESSION_tag
  103. //{
  104. // LAN_CHANNEL_T hLANInfo;
  105. // char szUserName [MAX_USER_NAME_LEN];
  106. // char szPwd [MAX_USER_PWD_LEN];
  107. // uint32_t dwSessionID;
  108. // uint8_t byIPMBSeqNum;
  109. // uint32_t dwSessionSeqNum;
  110. // uint8_t byAuthType;
  111. // uint8_t byChannelNum;
  112. // uint8_t byPerMsgAuthentication;
  113. // uint8_t byRole;
  114. // uint8_t byAuthAlgthm;
  115. // uint8_t byIntegrityAlgthm;
  116. // uint8_t byEncryptAlgthm;
  117. // uint8_t byPreSession;
  118. // uint8_t byResAddr;
  119. // uint8_t byReqAddr;
  120. // uint8_t byGUID [MAX_GUID_SIZE];
  121. // uint8_t byIsEncryptionReq;
  122. // uint8_t byKey1 [MAX_KEY1_SIZE];
  123. // uint8_t byKey2 [MAX_KEY2_SIZE];
  124. // uint8_t byMsgTag;
  125. // uint32_t dwRemConSessID;
  126. // uint8_t byRemConRandomNo [16];
  127. // uint8_t byMgdSysRandomNo [16];
  128. // uint8_t byDefTimeout;
  129. //} IPMI20_NETWORK_SESSION_T;
  130. ///**
  131. // @def IPMI20_SERIAL_SESSION_T
  132. // @brief holds data required for maintaining session with serial medium
  133. //*/
  134. //typedef struct IPMI20_SERIAL_SESSION_T_tag {
  135. // SERIAL_CHANNEL_T hSerialInfo;
  136. // char szUserName [MAX_USER_NAME_LEN];
  137. // char szPwd [MAX_USER_PWD_LEN];
  138. // HANDLE hSerialPort;
  139. // uint8_t byMaxRetries;
  140. // uint32_t dwSessionID;
  141. // uint8_t byAuthType;
  142. // uint32_t dwInboundSeqNum;
  143. // uint32_t dwOutboundSeqNum;
  144. // uint8_t byIPMBSeqNum;
  145. // uint8_t byPrivLevel;
  146. // uint8_t byResAddr;
  147. // uint8_t byReqAddr;
  148. // uint8_t byDefTimeout;
  149. //} IPMI20_SERIAL_SESSION_T;
  150. ///**
  151. // @def IPMI20_UDS_SESSION_T
  152. // @brief holds data required for maintaining session with unix domain socket medium
  153. //*/
  154. //typedef struct IPMI20_UDS_SESSION_T_tag {
  155. // UDS_CHANNEL_T hUDSInfo;
  156. // char szUserName[MAX_USER_NAME_LEN];
  157. // char szPwd[MAX_USER_PWD_LEN];
  158. // char szUName[MAX_USER_NAME_LEN];
  159. // char abyIPAddr[IP6_ADDR_LEN];
  160. // uint32_t dwSessionID;
  161. // uint8_t byPreSession;
  162. // uint8_t byAuthType;
  163. // uint8_t byRole;
  164. // uint8_t byChannelNum;
  165. // uint8_t byDefTimeout;
  166. // uint8_t byMaxRetries;
  167. //} IPMI20_UDS_SESSION_T;
  168. ///**
  169. // @def IPMI20_KCS_SESSION_T
  170. // @brief holds data required for maintaining session with KCS medium
  171. //*/
  172. //typedef struct IPMI20_KCS_SESSION_T_tag {
  173. // HANDLE hKCSDevice;
  174. // uint8_t byResAddr;
  175. //} IPMI20_KCS_SESSION_T;
  176. ///**
  177. // @def IPMI20_IPMB_SESSION_T
  178. // @brief holds data required for maintaining session with IPMB medium
  179. //*/
  180. //typedef struct IPMI20_IPMB_SESSION_T_tag {
  181. // HANDLE hIPMBDevice;
  182. // uint8_t bySlaveAddr;
  183. //} IPMI20_IPMB_SESSION_T;
  184. ///**
  185. // @def LIBIPMI_SERIAL_SETTINGS_T
  186. // @brief holds settings for a session
  187. //*/
  188. //typedef struct {
  189. ///* settings state */
  190. // uint8_t bySettings;
  191. //#define SETTINGS_NOTSET 0x00
  192. //#define SETTINGS_DEFAULT 0x01
  193. //#define SETTINGS_USER 0x02
  194. ///* BaudRate */
  195. // uint32_t dwBaudRate;
  196. ///* Parity */
  197. // uint8_t byParity;
  198. //#define EVEN_PARITY 0x00
  199. //#define ODD_PARITY 0x01
  200. //#define NO_PARITY 0x02
  201. //#define MARK_PARITY 0x03
  202. //#define SPACE_PARITY 0x04
  203. ///* Stop Bits */
  204. // uint8_t byStopBit;
  205. //#define STOPBIT_ONE 0x00
  206. //#define STOPBIT_ONE5 0x01
  207. //#define STOPBIT_TWO 0x02
  208. // uint8_t byByteSize;
  209. ///* Byte Size */
  210. //} LIBIPMI_SERIAL_SETTINGS_T;
  211. //#define DEFAULT_BAUD_RATE 115200
  212. //#define DEFAULT_PARITY NO_PARITY
  213. //#define DEFAULT_STOPBITS STOPBIT_ONE
  214. //#define DEFAULT_BYTESIZE 8
  215. ///**
  216. // @def IPMI20_USB_SESSION_T
  217. // @brief holds data required for maintaining session with USB medium
  218. //*/
  219. //typedef struct IPMI20_USB_SESSION_T_tag {
  220. // union {
  221. // HANDLE hUSBDevice;
  222. // int hUSBDesc;
  223. // };
  224. // uint8_t byResAddr;
  225. //} IPMI20_USB_SESSION_T;
  226. ///**
  227. // @def IPMI20_SESSION_T
  228. // @brief holds info for maintaining a session
  229. //*/
  230. //typedef struct IPMI20_SESSION_T_tag {
  231. ///* Medium type (Network, Serial, KCS, IPMB, USB) */
  232. // uint8_t byMediumType;
  233. //#define NETWORK_MEDIUM_TCP 0x01
  234. //#define NETWORK_MEDIUM_UDP 0x04
  235. //#define NETWORK_MEDIUM NETWORK_MEDIUM_TCP
  236. //#define SERIAL_MEDIUM 0x02
  237. //#define KCS_MEDIUM 0x03
  238. //#define IPMB_MEDIUM 0x05
  239. //#define USB_MEDIUM 0x06
  240. //#define UDS_MEDIUM 0x07
  241. ///* tells whether session has started or not. */
  242. // uint8_t bySessionStarted;
  243. //#define SESSION_NOT_STARTED 0x00
  244. //#define SESSION_STARTED 0x01
  245. ///* if this value is > 0, session reestablishment will be tried for byMaxRetries times. */
  246. // uint8_t byMaxRetries;
  247. ///* LAN Eth Index for hold Eth number if multi NIc supported */
  248. // uint8_t EthIndex;
  249. // IPMI20_NETWORK_SESSION_T *hNetworkSession;
  250. // IPMI20_SERIAL_SESSION_T *hSerialSession;
  251. // IPMI20_KCS_SESSION_T *hKCSSession;
  252. // IPMI20_IPMB_SESSION_T *hIPMBSession;
  253. // IPMI20_USB_SESSION_T *hUSBSession;
  254. // IPMI20_UDS_SESSION_T *hUDSSession;
  255. // LIBIPMI_SERIAL_SETTINGS_T Settings;
  256. //} IPMI20_SESSION_T;
  257. //typedef enum
  258. //{
  259. // AUTH_FLAG = 1,
  260. // AUTH_BYPASS_FLAG,
  261. //}USER_Auth;
  262. #pragma pack()
  263. #endif /* __LIBIPMI_STRUCT_H__ */