libipmi_rmcp.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /**
  2. * @file libipmi_rmcp.h
  3. * @author Rajasekhar (rajasekharj@amiindia.co.in)
  4. * @date 02-Sep-2004
  5. *
  6. * @brief Contains definition of RMCP layer API
  7. * required by Session layer for communicating with BMC.
  8. *
  9. */
  10. #ifndef __LIBIPMI_RMCP_H__
  11. #define __LIBIPMI_RMCP_H__
  12. //#include "RMCP.h"
  13. #include "com_IPMI_RMCP.h"
  14. #define PACK __attribute__ ((packed))
  15. /**
  16. * @def RMCPPing_T
  17. * @brief RMCP Ping Message
  18. */
  19. /* IPMI2.0 Specification Table 13-6 */
  20. typedef struct
  21. {
  22. RMCPHdr_T Hdr; /*< RMCP Header */
  23. uint8_t IANANum[4]; /*< 4542 (ASF IANA) */
  24. uint8_t MsgType; /*< 80h = Presence Ping */
  25. uint8_t MsgTag; /*< 0-FEh, generated by remote console */
  26. uint8_t Reserved1; /*< 00h */
  27. uint8_t DataLen; /*< 00h */
  28. } PACK RMCPPing_T;
  29. /**
  30. * @def RMCPPong_T
  31. * @brief RMCP Pong Response
  32. */
  33. /* IPMI2.0 Specification Table 13-7 */
  34. typedef struct
  35. {
  36. RMCPHdr_T Hdr; /*< RMCP Header */
  37. uint8_t IANANum[4]; /*< 4542 (ASF IANA) */
  38. uint8_t MsgType; /*< 40h = Presence Ping */
  39. uint8_t MsgTag; /*< From Pin Request */
  40. uint8_t Reserved1; /*< 00h */
  41. uint8_t DataLen; /*< 10h */
  42. uint8_t OEMIANANum [4]; /*< OEM's IANA Number */
  43. uint8_t OEM [4]; /*< OEM Defined field */
  44. uint8_t Support; /*< 81h for IPMI */
  45. uint8_t InteractionSupport; /*< Reserved */
  46. uint8_t Reserved [6];
  47. } PACK RMCPPong_T;
  48. #if defined (PACK)
  49. #undef PACK
  50. #endif
  51. /**
  52. \breif Connects to BMC's RMCP layer.
  53. @param LanInfo [in]Lan Info handle
  54. @param szIPAddress [in]IP Address of BMC
  55. @param wPort [in]socke port to be connected.
  56. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  57. */
  58. uint8_t RMCP_Connect(LAN_CHANNEL_T *LanInfo, char *szIPAddress, uint16 wPort);
  59. /**
  60. \breif Closes connection with BMC at RCMP layer
  61. @param LanInfo [in]Lan Info handle
  62. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  63. */
  64. void RMCP_Close(LAN_CHANNEL_T *LanInfo );
  65. /**
  66. \breif Fills RMCP Header and sends the data to network layer.
  67. @param LanInfo [in]Lan Info handle
  68. @param szBuffer [in]Data to be sent
  69. @param dwSize [in]Size of the data to be sent.
  70. @param timeout [in]timeout value in seconds.
  71. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  72. */
  73. uint8_t RMCP_SendData(LAN_CHANNEL_T *LanInfo, char *szBuffer, uint32 dwSize, int timeout);
  74. /**
  75. \breif Receives data from network layer and validates RMCP Header.
  76. @param LanInfo [in]Lan Info handle
  77. @param szBuffer [out]Data that will be received
  78. @param dwSize [out]Size of the data received.
  79. @param timeout [in]timeout value in seconds.
  80. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  81. */
  82. uint8_t RMCP_ReceiveData(LAN_CHANNEL_T *LanInfo, char *szBuffer, uint32* pdwSize, int timeout);
  83. /**
  84. \breif Sends RMCP Ping message to BMC
  85. @param LanInfo [in]Lan Info handle
  86. @param timeout [in]timeout value in seconds.
  87. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  88. */
  89. uint8_t RMCP_Ping(LAN_CHANNEL_T *LanInfo, int timeout);
  90. /**
  91. \breif Receives RMCP Pong message from BMC
  92. @param LanInfo [in]Lan Info handle
  93. @param timeout [in]timeout value in seconds.
  94. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  95. */
  96. uint8_t RMCP_Pong(LAN_CHANNEL_T *LanInfo, int timeout);
  97. #endif