com_Message.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*****************************************************************
  2. *****************************************************************
  3. *** **
  4. *** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. *** **
  6. *** All Rights Reserved. **
  7. *** **
  8. *** 6145-F, Northbelt Parkway, Norcross, **
  9. *** **
  10. *** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. *** **
  12. *****************************************************************
  13. *****************************************************************
  14. ******************************************************************
  15. *
  16. * message.h
  17. * Inter task messaging functions.
  18. *
  19. * Author: Govind Kothandapani <govindk@ami.com>
  20. ******************************************************************/
  21. #ifndef MESSAGE_H
  22. #define MESSAGE_H
  23. <<<<<<< HEAD
  24. #include <stdint.h>
  25. #include <time.h>
  26. =======
  27. #ifndef uint8_t
  28. #define uint8_t unsigned char
  29. #endif
  30. #ifndef uint16_t
  31. #define uint16_t unsigned short
  32. #endif
  33. #ifndef uint32_t
  34. #define uint32_t unsigned long
  35. #endif
  36. >>>>>>> master
  37. #pragma pack( 1 )
  38. #define IP_ADDR_LEN 4
  39. #define IP6_ADDR_LEN 16
  40. #define COMMON_QUEUE 0
  41. /*-----------------------------------
  42. * Definitions
  43. *-----------------------------------*/
  44. #define MSG_PAYLOAD_SIZE 1024
  45. #define PIPE_NAME_LEN 64
  46. /*-----------------------------------
  47. * Type definitions
  48. *-----------------------------------*/
  49. typedef struct
  50. {
  51. uint32_t Param; /* Parameter */
  52. uint8_t Channel; /* Originator's channel number */
  53. <<<<<<< HEAD
  54. uint8_t SrcQ [PIPE_NAME_LEN]; /* Originator Queue */
  55. =======
  56. int SrcQ ; /* Originator Queue, fd */
  57. >>>>>>> master
  58. uint8_t Cmd; /* Command that needs to be processed*/
  59. uint8_t NetFnLUN; /* Net function and LUN of command */
  60. uint8_t Privilege; /* Current privilege level */
  61. uint32_t SessionID; /* Session ID if any */
  62. <<<<<<< HEAD
  63. time_t ReqTime; /* Request Timestamp */
  64. =======
  65. // time_t ReqTime; /* Request Timestamp */
  66. >>>>>>> master
  67. uint16_t ResTimeOut; /* response timeout in secs */
  68. uint16_t SessionType; /* Session Type */
  69. uint8_t IPAddr [IP6_ADDR_LEN]; /* IPv6 Address */
  70. uint16_t UDPPort; /* UDP Port Number */
  71. uint16_t Socket; /* socket handle */
  72. uint32_t Size; /* Size of the data */
  73. uint8_t Data [MSG_PAYLOAD_SIZE]; /* Data */
  74. } MsgPkt_T;
  75. #pragma pack( )
  76. // /**
  77. // * @brief Initialisation
  78. // * @return 0 if success, -1 if failed.
  79. // **/
  80. // extern int InitMsg (void);
  81. // /**
  82. // * @fn PostMsg
  83. // * @brief Post a message to the destination task.
  84. // * @param MsgPkt - Message to be posted.
  85. // * @param Queue - Queue to post this message to.
  86. // * @return 0 if success, -1 if failed.
  87. // **/
  88. // extern int PostMsg (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath ,int BMCInst);
  89. // /**
  90. // * @fn PostMsgNonBlock
  91. // * @brief Post a message to the destination task without blocking.
  92. // * @param MsgPkt - Message to be posted.
  93. // * @param Queue - Queue to post this message to.
  94. // * @return 0 if success, -1 if failed.
  95. // **/
  96. // extern int PostMsgNonBlock (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath, int BMCInst );
  97. // /**
  98. // * @fn AddToQueue
  99. // * @brief Post a buffer to the destination task.
  100. // * @param pBuf - Buffer to be posted.
  101. // * @param Queuepath - Queuepath to post this buffer to.
  102. // * @return 0 if success, -1 if failed.
  103. // **/
  104. // extern int AddToQueue (void* pBuf, INT8S *Queuepath,uint32_t Size,int BMCInst);
  105. // *
  106. // * @fn GetMsg
  107. // * @brief Gets the message posted to this task.
  108. // * @param MsgPkt - Pointer to the buffer to hold the message packet.
  109. // * @param Queue - Queue to fetch the message from.
  110. // * @param NumMs - Number of milli-seconds to wait.
  111. // * WAIT_NONE - If the function has to return immediately.
  112. // * WAIT_INFINITE - If the function has to wait infinitely.
  113. // * NOTE :
  114. // * @return 0 if success, -1 if failed.
  115. // *
  116. // extern int GetMsg (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath, INT16S Timeout, int BMCInst);
  117. // /**
  118. // * @fn GetMsgInMsec
  119. // * @brief GetMsgInMsec() is wrapper function over GetMsg() and it is maintained for backward compatibality.
  120. // * */
  121. // extern int GetMsgInMsec (_FAR_ MsgPkt_T* pMsgPkt, INT8S *Queuepath, INT16S Timeout, int BMCInst);
  122. // /**
  123. // * @brief Returns the number of messages in the Queue.
  124. // * @param Queue Queue.
  125. // **/
  126. // extern int NumMsg (HQueue_T Queue);
  127. // /**
  128. // * @fn AddQueue
  129. // * @brief Adds the Queue to the common Queue Handle structure
  130. // * @param Queuepath - Queue Path
  131. // **/
  132. // extern int AddQueue(INT8S *Queuepath);
  133. // /**
  134. // * @fn GetQueue
  135. // * @brief Opens the Created Queue Handle from the Common
  136. // * Queue Handle Structure
  137. // * @param Queuepath - Queue Path
  138. // * @return Return 0
  139. // **/
  140. // extern int GetQueue(INT8S *Queuepath,int flags);
  141. // /**
  142. // * @fn GetQueueHandle
  143. // * @brief Gets the Queue Handle from the Common
  144. // * Queue Handle Structure
  145. // * @param Queuepath - Queue Path
  146. // * @param IfcQ Handle for the needed Queue
  147. // * @return Return 0
  148. // **/
  149. // extern int GetQueueHandle(INT8S *Queuepath,HQueue_T *IfcQ,int BMCInst);
  150. #endif /* MESSAGE_H */