/** * @file libipmi_rmcp.h * @author Rajasekhar (rajasekharj@amiindia.co.in) * @date 02-Sep-2004 * * @brief Contains definition of RMCP layer API * required by Session layer for communicating with BMC. * */ #ifndef __LIBIPMI_RMCP_H__ #define __LIBIPMI_RMCP_H__ //#include "RMCP.h" #if LIBIPMI_IS_OS_LINUX() #define PACK __attribute__ ((packed)) #else #define PACK #pragma pack(1) #endif/* LIBIPMI_IS_OS_LINUX() */ /** * @def RMCPPing_T * @brief RMCP Ping Message */ /* IPMI2.0 Specification Table 13-6 */ typedef struct { RMCPHdr_T Hdr; /*< RMCP Header */ uint8 IANANum[4]; /*< 4542 (ASF IANA) */ uint8 MsgType; /*< 80h = Presence Ping */ uint8 MsgTag; /*< 0-FEh, generated by remote console */ uint8 Reserved1; /*< 00h */ uint8 DataLen; /*< 00h */ } PACK RMCPPing_T; /** * @def RMCPPong_T * @brief RMCP Pong Response */ /* IPMI2.0 Specification Table 13-7 */ typedef struct { RMCPHdr_T Hdr; /*< RMCP Header */ uint8 IANANum[4]; /*< 4542 (ASF IANA) */ uint8 MsgType; /*< 40h = Presence Ping */ uint8 MsgTag; /*< From Pin Request */ uint8 Reserved1; /*< 00h */ uint8 DataLen; /*< 10h */ uint8 OEMIANANum [4]; /*< OEM's IANA Number */ uint8 OEM [4]; /*< OEM Defined field */ uint8 Support; /*< 81h for IPMI */ uint8 InteractionSupport; /*< Reserved */ uint8 Reserved [6]; } PACK RMCPPong_T; #if defined (PACK) #undef PACK #endif #if !LIBIPMI_IS_OS_LINUX() #pragma pack() #endif/* LIBIPMI_IS_OS_LINUX() */ /** \breif Connects to BMC's RMCP layer. @param LanInfo [in]Lan Info handle @param szIPAddress [in]IP Address of BMC @param wPort [in]socke port to be connected. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure */ uint8 RMCP_Connect(LAN_CHANNEL_T *LanInfo, char *szIPAddress, uint16 wPort); /** \breif Closes connection with BMC at RCMP layer @param LanInfo [in]Lan Info handle @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure */ void RMCP_Close(LAN_CHANNEL_T *LanInfo ); /** \breif Fills RMCP Header and sends the data to network layer. @param LanInfo [in]Lan Info handle @param szBuffer [in]Data to be sent @param dwSize [in]Size of the data to be sent. @param timeout [in]timeout value in seconds. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure */ uint8 RMCP_SendData(LAN_CHANNEL_T *LanInfo, char *szBuffer, uint32 dwSize, int timeout); /** \breif Receives data from network layer and validates RMCP Header. @param LanInfo [in]Lan Info handle @param szBuffer [out]Data that will be received @param dwSize [out]Size of the data received. @param timeout [in]timeout value in seconds. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure */ uint8 RMCP_ReceiveData(LAN_CHANNEL_T *LanInfo, char *szBuffer, uint32* pdwSize, int timeout); /** \breif Sends RMCP Ping message to BMC @param LanInfo [in]Lan Info handle @param timeout [in]timeout value in seconds. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure */ uint8 RMCP_Ping(LAN_CHANNEL_T *LanInfo, int timeout); /** \breif Receives RMCP Pong message from BMC @param LanInfo [in]Lan Info handle @param timeout [in]timeout value in seconds. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure */ uint8 RMCP_Pong(LAN_CHANNEL_T *LanInfo, int timeout); #endif