123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- #ifndef MSG_HNDLR_H
- #define MSG_HNDLR_H
- #include "com_Message.h"
- #include "com_IPMIDefs.h"
- #pragma pack( 1 )
- #define BMC_LUN_00 0
- #define BMC_LUN_01 1
- #define BMC_LUN_10 2
- #define BMC_LUN_11 3
- #define LOOP_BACK_REQ 0x10
- #define LAN_IFC_SUP 0x0001
- #define SOL_IFC_SUP 0x0002
- #define SERIAL_IFC_SUP 0x0004
- #define AMI_DEVICE_SUP 0x0008
- #define USER_LOCKED 1
- #define USER_UNLOCKED 0
- #define MAX_NETFN 64
- typedef int (*pCmdHndlr_T) ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
- typedef struct
- {
- uint8_t Cmd;
- uint8_t Privilege;
- pCmdHndlr_T CmdHndlr;
- uint8_t ReqLen;
- uint16_t FFConfig;
- uint16_t IfcSupport;
- } CmdHndlrMap_T;
- typedef int (*pExCmdHndlr_T) ( uint8_t* pReq, uint32_t ReqLen, uint8_t* pRes);
- typedef struct
- {
- uint8_t Cmd;
- uint8_t Privilege;
- pExCmdHndlr_T CmdHndlr;
- uint8_t ReqLen;
- uint16_t FFConfig;
- uint16_t IfcSupport;
- } ExCmdHndlrMap_T;
- typedef struct
- {
- uint8_t NetFn;
- const CmdHndlrMap_T* CmdHndlrMap;
- } MsgHndlrTbl_T;
- typedef struct
- {
- uint8_t NetFn;
- uint8_t GroupExtnCode;
- const CmdHndlrMap_T* CmdHndlrMap;
- } GroupExtnMsgHndlrTbl_T;
- #define MAX_PENDING_BRIDGE_RES 64
- #define MAX_PENDING_BRIDGE_TBL 2
- #define PRIMARY_PB_TBL 0
- #define SECONDARY_PB_TBL 1
- typedef union
- {
- IPMIMsgHdr_T IPMIMsgHdr;
- IPMIUDSMsg_T UDSMsgHdr;
- } ResMsgHdr_T;
- typedef struct
- {
- uint8_t Used;
- uint8_t TimeOut;
- uint8_t SeqNum;
- uint8_t ChannelNum;
- uint8_t DstSessionHandle;
- uint8_t SrcSessionHandle;
- uint32_t SrcSessionID;
- int DestQ;
- uint8_t OriginSrc;
- IPMIMsgHdr_T ReqMsgHdr;
- ResMsgHdr_T ResMsgHdr;
- uint8_t ResDataOk;
- int UDSSocket;
- } PendingBridgedResTbl_T;
- #define MAX_PENDING_SEQ_NO 50
- #define SEQ_NO_EXPIRATION_TIME 5
- typedef struct
- {
- uint8_t Used;
- uint8_t TimeOut;
- uint8_t SeqNum;
- uint8_t NetFn;
- uint8_t Cmd;
- } PendingSeqNoTbl_T;
- #define MAX_IPMI_CMD_BLOCKS 3
- typedef struct
- {
- uint8_t NetFnLUN;
- uint32_t SessionID;
- int SrcQ ;
- } KCSBridgeResInfo_T;
- #pragma pack( )
- typedef void (*pTimerFn_T) (void);
- typedef struct
- {
- uint8_t NumSecs;
- pTimerFn_T TimerFn;
- } TimerTaskTbl_T;
- #define STATUS_OK 0x0
- #define STATUS_FAIL 0x1
- extern int GetCmdHndlr(MsgPkt_T* pReq,MsgPkt_T* pRes,CmdHndlrMap_T* pCmdHndlrMap,
- uint32_t HdrOffset,uint8_t CmdOverride,CmdHndlrMap_T** CmdHndrl );
- extern int GetMsgHndlrMap (uint8_t NetFn, CmdHndlrMap_T ** pCmdHndlrMap);
- extern int GroupExtnGetMsgHndlrMap (uint8_t NetFn, uint8_t GroupExtnCode, CmdHndlrMap_T ** pCmdHndlrMap);
- extern uint8_t CalculateCheckSum2 ( uint8_t* Pkt, uint32_t Len);
- extern void SwapIPMIMsgHdr ( IPMIMsgHdr_T* pIPMIMsgReq, IPMIMsgHdr_T* pIPMIMsgRes);
- extern void SwapUDSIPMIMsg ( MsgPkt_T* pIPMIMsgReq, MsgPkt_T* pIPMIMsgRes);
- #define PRIV_NONE 0x00
- #define PRIV_CALLBACK 0x01
- #define PRIV_USER 0x02
- #define PRIV_OPERATOR 0x03
- #define PRIV_ADMIN 0x04
- #define PRIV_OEM 0x05
- #define PRIV_LOCAL 0x81
- #define PRIV_SYS_IFC 0x82
- #define LAN_CHANNEL_BADP 0x1
- #define SERIAL_CHANNEL_BADP 0x2
- #define RCVMSGQ_LENGTH 100
- #define NO_RESPONSE 0x10
- #define NORMAL_RESPONSE 0x11
- extern char g_RcvMsgQ [3][RCVMSGQ_LENGTH];
- extern void RespondSendMessage ( MsgPkt_T* pReq, uint8_t Status);
- extern int ValidateMsgHdr ( MsgPkt_T* pReq);
- #endif
|