123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- /**
- * @file libipmi_struct.h
- * @author Rajasekhar (rajasekharj@amiindia.co.in)
- * @date 02-Sep-2004
- *
- * @brief Contains data structures required for establishing a session
- *
- */
- #ifndef __LIBIPMI_STRUCT_H__
- #define __LIBIPMI_STRUCT_H__
- #include "com_BmcType.h"
- #pragma pack(1)
- #define MAX_REQUEST_SIZE 1024
- #define MAX_RESPONSE_SIZE 1024
- #define IP4_VERSION 4
- #define IP6_VERSION 6
- #define IP4_ADDR_LEN 4
- #define IP6_ADDR_LEN 16
- ///**
- // @def LAN_CHANNEL_T
- // @brief holds data required for network medium
- //*/
- //typedef struct LAN_CHANNEL_T_tag {
- // char szIPAddress[46];
- // uint16 wPort;
- // SOCKET hSocket;
- // uint8_t byIsConnected;
- // uint8_t bProtocol;
- // uint8_t bFamily;
- //} LAN_CHANNEL_T;
- ///**
- // @def UDS_CHANNEL_T
- // @brief holds data required for network medium
- //*/
- //typedef struct UDS_CHANNEL_T_tag {
- // uint16 hSocketPath;
- // SOCKET hSocket;
- // uint8_t byIsConnected;
- //} UDS_CHANNEL_T;
- ///**
- // @def SERIAL_CHANNEL_T
- // @brief holds data required for Serial medium
- //*/
- //typedef struct SERIAL_CHANNEL_T_tag {
- // char szdevice[32];
- //} SERIAL_CHANNEL_T;
- /* Authentication Types */
- #define AUTHTYPE_NONE 0x00
- #define AUTHTYPE_MD2 0x01
- #define AUTHTYPE_MD5 0x02
- #define AUTHTYPE_RESERVED 0x03
- #define AUTHTYPE_STRAIGHT_PASSWORD 0x04
- #define AUTHTYPE_OEM_PROPRIETARY 0x05
- #define AUTHTYPE_RMCP_PLUS_FORMAT 0x06
- /* Privilege levels */
- #define PRIV_LEVEL_NO_ACCESS 0x0F
- #define PRIV_LEVEL_PROPRIETARY 0x05
- #define PRIV_LEVEL_ADMIN 0x04
- #define PRIV_LEVEL_OPERATOR 0x03
- #define PRIV_LEVEL_USER 0x02
- #define PRIV_LEVEL_CALLBACK 0x01
- #define PRIV_LEVEL_RESERVED 0x00
- /* Authentication Algorithms */
- #define AUTH_ALG_RAKP_NONE 0x00
- #define AUTH_ALG_RAKP_HMAC_SHA1 0x01
- #define AUTH_ALG_RAKP_HMAC_MD5 0x02
- /* Integrity Algorithms */
- #define INTEGRITY_ALG_NONE 0x00
- #define INTEGRITY_ALG_HMAC_SHA1_96 0x01
- #define INTEGRITY_ALG_HMAC_SHA1_128 0x02
- #define INTEGRITY_ALG_MD5_128 0x03
- /* Confidentiality Algorithms */
- #define CONFIDENTIALITY_ALG_NONE 0x00
- #define CONFIDENTIALITY_ALG_AES_CBC_128 0x01
- #define CONFIDENTIALITY_ALG_XRC4_128 0x02
- #define CONFIDENTIALITY_ALG_XRC4_40 0x03
- /* Payload Types */
- #define PAYLOAD_TYPE_IPMI 0
- #define PAYLOAD_TYPE_SOL 1
- #define PAYLOAD_TYPE_RSSP_OPEN_SES_REQ 0x10
- #define PAYLOAD_TYPE_RSSP_OPEN_SES_RES 0x11
- #define PAYLOAD_TYPE_RAKP_MSG_1 0x12
- #define PAYLOAD_TYPE_RAKP_MSG_2 0x13
- #define PAYLOAD_TYPE_RAKP_MSG_3 0x14
- #define PAYLOAD_TYPE_RAKP_MSG_4 0x15
- #define MAX_KEY1_SIZE 20
- #define MAX_KEY2_SIZE 20
- #define MAX_GUID_SIZE 16
- //#define MAX_USER_NAME_LEN (16+1) //1 for stroing the null character
- //#define MAX_USER_PWD_LEN (20+1) //1 for storing the null character
- #define MAX_RAND_NO_LEN 16
- /* (0x6 << 2) == 0x18 */
- #define DEFAULT_NET_FN_LUN 0x18
- #define NETFNLUN_IPMI_APP 0x18
- #define NETFNLUN_IPMI_SENSOR 0x10
- #define NETFNLUN_IPMI_STORAGE 0x28
- #define NETFNLUN_IPMI_CHASSIS 0x00
- ///**
- // @def IPMI20_NETWORK_SESSION_T
- // @brief holds data required for maintaining session with network medium
- //*/
- //typedef struct IPMI20_NETWORK_SESSION_tag
- //{
- // LAN_CHANNEL_T hLANInfo;
- // char szUserName [MAX_USER_NAME_LEN];
- // char szPwd [MAX_USER_PWD_LEN];
- // uint32_t dwSessionID;
- // uint8_t byIPMBSeqNum;
- // uint32_t dwSessionSeqNum;
- // uint8_t byAuthType;
- // uint8_t byChannelNum;
- // uint8_t byPerMsgAuthentication;
- // uint8_t byRole;
- // uint8_t byAuthAlgthm;
- // uint8_t byIntegrityAlgthm;
- // uint8_t byEncryptAlgthm;
- // uint8_t byPreSession;
- // uint8_t byResAddr;
- // uint8_t byReqAddr;
- // uint8_t byGUID [MAX_GUID_SIZE];
- // uint8_t byIsEncryptionReq;
- // uint8_t byKey1 [MAX_KEY1_SIZE];
- // uint8_t byKey2 [MAX_KEY2_SIZE];
- // uint8_t byMsgTag;
- // uint32_t dwRemConSessID;
- // uint8_t byRemConRandomNo [16];
- // uint8_t byMgdSysRandomNo [16];
- // uint8_t byDefTimeout;
- //} IPMI20_NETWORK_SESSION_T;
- ///**
- // @def IPMI20_SERIAL_SESSION_T
- // @brief holds data required for maintaining session with serial medium
- //*/
- //typedef struct IPMI20_SERIAL_SESSION_T_tag {
- // SERIAL_CHANNEL_T hSerialInfo;
- // char szUserName [MAX_USER_NAME_LEN];
- // char szPwd [MAX_USER_PWD_LEN];
- // HANDLE hSerialPort;
- // uint8_t byMaxRetries;
- // uint32_t dwSessionID;
- // uint8_t byAuthType;
- // uint32_t dwInboundSeqNum;
- // uint32_t dwOutboundSeqNum;
- // uint8_t byIPMBSeqNum;
- // uint8_t byPrivLevel;
- // uint8_t byResAddr;
- // uint8_t byReqAddr;
- // uint8_t byDefTimeout;
- //} IPMI20_SERIAL_SESSION_T;
- ///**
- // @def IPMI20_UDS_SESSION_T
- // @brief holds data required for maintaining session with unix domain socket medium
- //*/
- //typedef struct IPMI20_UDS_SESSION_T_tag {
- // UDS_CHANNEL_T hUDSInfo;
- // char szUserName[MAX_USER_NAME_LEN];
- // char szPwd[MAX_USER_PWD_LEN];
- // char szUName[MAX_USER_NAME_LEN];
- // char abyIPAddr[IP6_ADDR_LEN];
- // uint32_t dwSessionID;
- // uint8_t byPreSession;
- // uint8_t byAuthType;
- // uint8_t byRole;
- // uint8_t byChannelNum;
- // uint8_t byDefTimeout;
- // uint8_t byMaxRetries;
- //} IPMI20_UDS_SESSION_T;
- ///**
- // @def IPMI20_KCS_SESSION_T
- // @brief holds data required for maintaining session with KCS medium
- //*/
- //typedef struct IPMI20_KCS_SESSION_T_tag {
- // HANDLE hKCSDevice;
- // uint8_t byResAddr;
- //} IPMI20_KCS_SESSION_T;
- ///**
- // @def IPMI20_IPMB_SESSION_T
- // @brief holds data required for maintaining session with IPMB medium
- //*/
- //typedef struct IPMI20_IPMB_SESSION_T_tag {
- // HANDLE hIPMBDevice;
- // uint8_t bySlaveAddr;
- //} IPMI20_IPMB_SESSION_T;
- ///**
- // @def LIBIPMI_SERIAL_SETTINGS_T
- // @brief holds settings for a session
- //*/
- //typedef struct {
- ///* settings state */
- // uint8_t bySettings;
- //#define SETTINGS_NOTSET 0x00
- //#define SETTINGS_DEFAULT 0x01
- //#define SETTINGS_USER 0x02
- ///* BaudRate */
- // uint32_t dwBaudRate;
- ///* Parity */
- // uint8_t byParity;
- //#define EVEN_PARITY 0x00
- //#define ODD_PARITY 0x01
- //#define NO_PARITY 0x02
- //#define MARK_PARITY 0x03
- //#define SPACE_PARITY 0x04
- ///* Stop Bits */
- // uint8_t byStopBit;
- //#define STOPBIT_ONE 0x00
- //#define STOPBIT_ONE5 0x01
- //#define STOPBIT_TWO 0x02
- // uint8_t byByteSize;
- ///* Byte Size */
- //} LIBIPMI_SERIAL_SETTINGS_T;
- //#define DEFAULT_BAUD_RATE 115200
- //#define DEFAULT_PARITY NO_PARITY
- //#define DEFAULT_STOPBITS STOPBIT_ONE
- //#define DEFAULT_BYTESIZE 8
- ///**
- // @def IPMI20_USB_SESSION_T
- // @brief holds data required for maintaining session with USB medium
- //*/
- //typedef struct IPMI20_USB_SESSION_T_tag {
- // union {
- // HANDLE hUSBDevice;
- // int hUSBDesc;
- // };
- // uint8_t byResAddr;
- //} IPMI20_USB_SESSION_T;
- ///**
- // @def IPMI20_SESSION_T
- // @brief holds info for maintaining a session
- //*/
- //typedef struct IPMI20_SESSION_T_tag {
- ///* Medium type (Network, Serial, KCS, IPMB, USB) */
- // uint8_t byMediumType;
- //#define NETWORK_MEDIUM_TCP 0x01
- //#define NETWORK_MEDIUM_UDP 0x04
- //#define NETWORK_MEDIUM NETWORK_MEDIUM_TCP
- //#define SERIAL_MEDIUM 0x02
- //#define KCS_MEDIUM 0x03
- //#define IPMB_MEDIUM 0x05
- //#define USB_MEDIUM 0x06
- //#define UDS_MEDIUM 0x07
- ///* tells whether session has started or not. */
- // uint8_t bySessionStarted;
- //#define SESSION_NOT_STARTED 0x00
- //#define SESSION_STARTED 0x01
- ///* if this value is > 0, session reestablishment will be tried for byMaxRetries times. */
- // uint8_t byMaxRetries;
- ///* LAN Eth Index for hold Eth number if multi NIc supported */
- // uint8_t EthIndex;
- // IPMI20_NETWORK_SESSION_T *hNetworkSession;
- // IPMI20_SERIAL_SESSION_T *hSerialSession;
- // IPMI20_KCS_SESSION_T *hKCSSession;
- // IPMI20_IPMB_SESSION_T *hIPMBSession;
- // IPMI20_USB_SESSION_T *hUSBSession;
- // IPMI20_UDS_SESSION_T *hUDSSession;
- // LIBIPMI_SERIAL_SETTINGS_T Settings;
- //} IPMI20_SESSION_T;
- //typedef enum
- //{
- // AUTH_FLAG = 1,
- // AUTH_BYPASS_FLAG,
- //}USER_Auth;
- #pragma pack()
- #endif /* __LIBIPMI_STRUCT_H__ */
|