123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- /*****************************************************************
- *****************************************************************
- *** **
- *** (C)Copyright 2005-2006, American Megatrends Inc. **
- *** **
- *** All Rights Reserved. **
- *** **
- *** 6145-F, Northbelt Parkway, Norcross, **
- *** **
- *** Georgia - 30071, USA. Phone-(770)-246-8600. **
- *** **
- *****************************************************************
- *****************************************************************
- ******************************************************************
- *
- * message.h
- * Inter task messaging functions.
- *
- * Author: Govind Kothandapani <govindk@ami.com>
- ******************************************************************/
- #ifndef MESSAGE_H
- #define MESSAGE_H
- #ifndef uint8_t
- #define uint8_t unsigned char
- #endif
- #ifndef uint16_t
- #define uint16_t unsigned short
- #endif
- #ifndef uint32_t
- #define uint32_t unsigned long
- #endif
- #pragma pack( 1 )
- #define IP_ADDR_LEN 4
- #define IP6_ADDR_LEN 16
- #define COMMON_QUEUE 0
- /*-----------------------------------
- * Definitions
- *-----------------------------------*/
- #define MSG_PAYLOAD_SIZE 1024*2
- #define PIPE_NAME_LEN 64
- /*-----------------------------------
- * Type definitions
- *-----------------------------------*/
- typedef struct
- {
- uint32_t Param; /* Parameter */
- uint8_t Channel; /* Originator's channel number */
- int SrcQ ; /* Originator Queue, fd */
- uint8_t Cmd; /* Command that needs to be processed*/
- uint8_t NetFnLUN; /* Net function and LUN of command */
- uint8_t Privilege; /* Current privilege level */
- uint32_t SessionID; /* Session ID if any */
- // time_t ReqTime; /* Request Timestamp */
- uint16_t ResTimeOut; /* response timeout in secs */
- uint16_t SessionType; /* Session Type */
- uint8_t IPAddr [IP6_ADDR_LEN]; /* IPv6 Address */
- uint16_t UDPPort; /* UDP Port Number */
- uint16_t Socket; /* socket handle */
- uint32_t Size; /* Size of the data */
- uint8_t Data [MSG_PAYLOAD_SIZE]; /* Data */
- } MsgPkt_T;
- #pragma pack( )
- // /**
- // * @brief Initialisation
- // * @return 0 if success, -1 if failed.
- // **/
- // extern int InitMsg (void);
- // /**
- // * @fn PostMsg
- // * @brief Post a message to the destination task.
- // * @param MsgPkt - Message to be posted.
- // * @param Queue - Queue to post this message to.
- // * @return 0 if success, -1 if failed.
- // **/
- // extern int PostMsg (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath ,int BMCInst);
- // /**
- // * @fn PostMsgNonBlock
- // * @brief Post a message to the destination task without blocking.
- // * @param MsgPkt - Message to be posted.
- // * @param Queue - Queue to post this message to.
- // * @return 0 if success, -1 if failed.
- // **/
- // extern int PostMsgNonBlock (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath, int BMCInst );
- // /**
- // * @fn AddToQueue
- // * @brief Post a buffer to the destination task.
- // * @param pBuf - Buffer to be posted.
- // * @param Queuepath - Queuepath to post this buffer to.
- // * @return 0 if success, -1 if failed.
- // **/
- // extern int AddToQueue (void* pBuf, INT8S *Queuepath,uint32_t Size,int BMCInst);
- // *
- // * @fn GetMsg
- // * @brief Gets the message posted to this task.
- // * @param MsgPkt - Pointer to the buffer to hold the message packet.
- // * @param Queue - Queue to fetch the message from.
- // * @param NumMs - Number of milli-seconds to wait.
- // * WAIT_NONE - If the function has to return immediately.
- // * WAIT_INFINITE - If the function has to wait infinitely.
- // * NOTE :
- // * @return 0 if success, -1 if failed.
- // *
- // extern int GetMsg (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath, INT16S Timeout, int BMCInst);
- // /**
- // * @fn GetMsgInMsec
- // * @brief GetMsgInMsec() is wrapper function over GetMsg() and it is maintained for backward compatibality.
- // * */
- // extern int GetMsgInMsec (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath, INT16S Timeout, int BMCInst);
- // /**
- // * @brief Returns the number of messages in the Queue.
- // * @param Queue Queue.
- // **/
- // extern int NumMsg (HQueue_T Queue);
- // /**
- // * @fn AddQueue
- // * @brief Adds the Queue to the common Queue Handle structure
- // * @param Queuepath - Queue Path
- // **/
- // extern int AddQueue(INT8S *Queuepath);
- // /**
- // * @fn GetQueue
- // * @brief Opens the Created Queue Handle from the Common
- // * Queue Handle Structure
- // * @param Queuepath - Queue Path
- // * @return Return 0
- // **/
- // extern int GetQueue(INT8S *Queuepath,int flags);
- // /**
- // * @fn GetQueueHandle
- // * @brief Gets the Queue Handle from the Common
- // * Queue Handle Structure
- // * @param Queuepath - Queue Path
- // * @param IfcQ Handle for the needed Queue
- // * @return Return 0
- // **/
- // extern int GetQueueHandle(INT8S *Queuepath,HQueue_T *IfcQ,int BMCInst);
- #endif /* MESSAGE_H */
|