com_IPMI_RMCP+.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. /****************************************************************
  2. ****************************************************************
  3. ** **
  4. ** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. ** **
  6. ** All Rights Reserved. **
  7. ** **
  8. ** 6145-F, Northbelt Parkway, Norcross, **
  9. ** **
  10. ** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. ** **
  12. ****************************************************************
  13. ****************************************************************
  14. ****************************************************************
  15. *
  16. * rmcp.h
  17. * RMCP Packet Handler
  18. *
  19. * Author: Govind Kothandapani <govindk@ami.com>
  20. * : Bakka Ravinder Reddy <bakkar@ami.com>
  21. *
  22. *****************************************************************/
  23. #ifndef IPMI_RMCP_PLUS_H
  24. #define IPMI_RMCP_PLUS_H
  25. #include <stdio.h>
  26. #include <stdint.h>
  27. #include "com_IPMIDefs.h"
  28. #define MAX_PAYLOAD_ALGO_SUPPORTED 3
  29. /**** RSSP and RAKP Message Status Codes *****/
  30. #define SC_NO_ERROR 0
  31. #define SC_INSUFFICIENT_RESOURCE 1
  32. #define SC_INV_SESSION_ID 2
  33. #define SC_INV_PAYLOAD_TYPE 3
  34. #define SC_INV_AUTH_ALGORITHM 4
  35. #define SC_INV_INTEGRITY_ALGORITHM 5
  36. #define SC_NO_MATCHED_AUTH_PAYLOAD 6
  37. #define SC_NO_MATCHED_INTEGRITY_PAYLOAD 7
  38. #define SC_INACTIVE_SESSION_ID 8
  39. #define SC_INV_ROLE 9
  40. #define SC_UNAUTHORISED_ROLE 10
  41. #define SC_INSUFFICIENT_RESOURCE_AT_ROLE 11
  42. #define SC_INV_NAME_LEN 12
  43. #define SC_UNAUTHORISED_NAME 13
  44. #define SC_UNAUTHORISED_GUID 14
  45. #define SC_INV_INTEGRITY_CHECK 15
  46. #define SC_INV_CONFIDENTIALITY_ALGORTHM 16
  47. #define SC_NO_CIPHER_SUITE_MATCH 17
  48. #define SESSION_INTEGRITY_KEY_SIZE 20
  49. #define SESSION_HMAC_MD5_I_KEY_SIZE 16
  50. #define SESSION_MD5_KEY_SIZE 16
  51. #define HASH_KEY1_SIZE 20
  52. #define HASH_KEY2_SIZE 20
  53. #define SHA2_HASH_KEY_SIZE 32
  54. #define MAX_HASH_KEY_SIZE SHA2_HASH_KEY_SIZE
  55. #pragma pack( 1 )
  56. /**** RSSP Open Session Request ****/
  57. typedef struct
  58. {
  59. uint8_t PayloadType;
  60. uint16_t Reserved1;
  61. uint8_t PayloadLen;
  62. uint8_t Algorithm;
  63. uint8_t Reserved2 [3];
  64. } RSSPPayloadInfo_T;
  65. typedef struct
  66. {
  67. uint8_t MsgTag;
  68. uint8_t Role;
  69. uint8_t Reserved [2];
  70. uint32_t RemConSessionID;
  71. RSSPPayloadInfo_T Auth;
  72. RSSPPayloadInfo_T Integrity;
  73. RSSPPayloadInfo_T Confidentiality;
  74. } RSSPOpenSessionReq_T;
  75. /**** RSSP Open Session Response ****/
  76. typedef struct
  77. {
  78. uint8_t MsgTag;
  79. uint8_t StatusCode;
  80. uint8_t Role;
  81. uint8_t Reserved;
  82. uint32_t RemConSessionID;
  83. } RSSPOpenSessionErrRes_T;
  84. typedef struct
  85. {
  86. uint8_t MsgTag;
  87. uint8_t StatusCode;
  88. uint8_t Role;
  89. uint8_t Reserved;
  90. uint32_t RemConSessionID;
  91. uint32_t MgdSysSessionID;
  92. RSSPPayloadInfo_T Auth;
  93. RSSPPayloadInfo_T Integrity;
  94. RSSPPayloadInfo_T Confidentiality;
  95. } RSSPOpenSessionRes_T;
  96. /**** RAKP Message1 ****/
  97. typedef struct
  98. {
  99. uint8_t MsgTag;
  100. uint8_t Reserved1 [3];
  101. uint32_t ManSysSessionID;
  102. uint8_t RemConRandomNo [16];
  103. uint8_t Role;
  104. uint8_t Reserved2 [2];
  105. uint8_t UsrNameLen;
  106. uint8_t UsrName [16];
  107. } RAKPMsg1Req_T;
  108. /**** RAKP Message2 ****/
  109. typedef struct
  110. {
  111. uint8_t MsgTag;
  112. uint8_t StatusCode;
  113. uint8_t Reserved1 [2];
  114. uint32_t RemConSessionID;
  115. } RAKPMsg2ErrRes_T;
  116. typedef struct
  117. {
  118. uint8_t MsgTag;
  119. uint8_t StatusCode;
  120. uint8_t Reserved1 [2];
  121. uint32_t RemConSessionID;
  122. uint8_t ManSysRandomNo [16];
  123. uint8_t ManSysGUID [16];
  124. } RAKPMsg2Res_T;
  125. typedef struct
  126. {
  127. uint32_t RemConSessionID;
  128. uint32_t MgdSysSessionID;
  129. uint8_t RemConRandNo [16];
  130. uint8_t MgdSysRandNo [16];
  131. uint8_t MgdSysGUID [16];
  132. uint8_t Role;
  133. uint8_t UsrNameLen;
  134. uint8_t UsrName [16];
  135. } RAKPMsg1HMAC_T;
  136. /**** RAKP Message3 ****/
  137. typedef struct
  138. {
  139. uint8_t MsgTag;
  140. uint8_t StatusCode;
  141. uint8_t Reserved1 [2];
  142. uint32_t ManSysSessionID;
  143. } RAKPMsg3Req_T;
  144. typedef struct
  145. {
  146. uint8_t MgdSysRandNo [16];
  147. uint32_t RemConSessionID;
  148. uint8_t Role;
  149. uint8_t UsrNameLen;
  150. uint8_t UsrName [16];
  151. } Msg3hmac_T;
  152. typedef struct
  153. {
  154. uint8_t RemConRandNo [16];
  155. uint8_t MgdSysRandNo [16];
  156. uint8_t Role;
  157. uint8_t UsrNameLen;
  158. uint8_t UsrName [16];
  159. } SIKhmac_T;
  160. /**** RAKP Message4 ****/
  161. typedef struct
  162. {
  163. uint8_t MsgTag;
  164. uint8_t StatusCode;
  165. uint8_t Reserved1 [2];
  166. uint32_t RemConSessionID;
  167. } RAKPMsg4ErrRes_T;
  168. typedef struct
  169. {
  170. uint8_t MsgTag;
  171. uint8_t StatusCode;
  172. uint8_t Reserved1 [2];
  173. uint32_t RemConSessionID;
  174. } RAKPMsg4Res_T;
  175. typedef struct
  176. {
  177. uint8_t RemConRandNo [16];
  178. uint32_t MgdSysSessionID;
  179. uint8_t MgdSysGUID [16];
  180. } RAKPMsg4hmac_T;
  181. #pragma pack( )
  182. #endif /* RMCP_PLUS_H */