botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
bsNullMsgs.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: bsNullMsgs.h
4 //
5 /*!
6  * \file
7  *
8  * \brief BotSense bsProxy server - client /dev/null NetMsgs XML Definition
9  *
10  * \warning This file was auto-generated on 2018.08.10 13:54:23 from the NetMsgs
11  * XML specification bsNullMsgs.xml.
12  *
13  * \par Copyright:
14  * (C) 2018. RoadNarrows LLC
15  * (http://www.roadnarrows.com)
16  * All Rights Reserved
17  */
18 ///////////////////////////////////////////////////////////////////////////////
19 
20 
21 #ifndef _BSNULLMSGS_H
22 #define _BSNULLMSGS_H
23 
24 #include "rnr/rnrconfig.h"
25 #include "rnr/netmsgs.h"
26 
27 #include "botsense/BotSense.h"
28 
29 
30 C_DECLS_BEGIN
31 
32 /*!
33  * BsNull Message Id Enumeration
34  */
35 typedef enum
36 {
37  BsNullMsgIdNone = 0, ///< no message
38  BsNullMsgIdReqWrite = 1, ///< ReqWrite
39  BsNullMsgIdRspWrite = 2, ///< RspWrite
40  BsNullMsgIdNumOf = 3 ///< number of message ids
42 
43 
44 //-----------------------------------------------------------------------------
45 // Message Types
46 //-----------------------------------------------------------------------------
47 
48 
49 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
50 // Message BsNullReqWrite Declarations
51 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52 
53 /*! ReqWrite writebuf maximum vector length */
54 #define BSNULL_REQWRITE_WRITEBUF_LEN (NMFVAL_LEN_MAX_VECTOR)
55 
56 /*!
57  * Message ReqWrite Structure
58  */
59 typedef struct
60 {
61  struct
62  {
63  size_t m_count; ///< vector item count
64  union
65  {
66  void *m_pAlign; ///< force alignment
68  ///< the item vector
69  } u; ///< aligned vector items
70  } m_writebuf; ///< vector
71 } BsNullReqWrite_T; ///< ReqWrite structure
72 
73 
74 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
75 // Message BsNullRspWrite Declarations
76 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
77 
78 /*!
79  * Message RspWrite Structure
80  */
81 typedef struct
82 {
83  byte_t m_byteswritten; ///< byteswritten
84 } BsNullRspWrite_T; ///< RspWrite structure
85 
86 
87 //-----------------------------------------------------------------------------
88 // External Data
89 //-----------------------------------------------------------------------------
90 
91 //
92 // BsNull Message Definition Look-Up Table.
93 // (indexed by BsNullMsgId_T enum)
94 //
95 extern const NMMsgDef_T *BsNullMsgDefLookupTbl[];
96 
97 //
98 // BsNull Maximum Message Body Length (bytes) Look-Up Table.
99 // (indexed by BsNullMsgId_T enum)
100 //
101 extern size_t BsNullMsgMaxLenLookupTbl[];
102 
103 
104 //-----------------------------------------------------------------------------
105 // Function Prototypes
106 //-----------------------------------------------------------------------------
107 
108 extern const NMMsgDef_T * BsNullLookupMsgDef( BsNullMsgId_T eMsgId );
109 
110 extern size_t BsNullLookupMsgMaxLen( BsNullMsgId_T eMsgId );
111 
112 extern int BsNullPackMsg( BsNullMsgId_T eMsgId,
113  void * pStruct,
114  byte_t buf[],
115  size_t bufSize,
116  bool_t bTrace );
117 
118 extern int BsNullUnpackMsg( BsNullMsgId_T eMsgId,
119  byte_t buf[],
120  size_t uMsgLen,
121  void * pStruct,
122  bool_t bTrace );
123 
124 /*!
125  * \brief Pack a BsNullReqWrite ITV message in big-endian byte order
126  * into the output buffer.
127  *
128  * \param [in] pStruct Pointer to the associated, populated message
129  * structure.
130  * \param [out] buf Output message buffer.
131  * \param bufSize Size of output buffer.
132  * \param bTrace Do [not] trace packing.
133  *
134  * \return
135  * On success, returns the number of bytes packed.
136  * On error, returns the appropriate \h_lt 0 negated NM_ECODE.
137  */
138 INLINE_IN_H int BsNullPackReqWrite( BsNullReqWrite_T * pStruct,
139  byte_t buf[],
140  size_t bufSize,
141  bool_t bTrace )
142 {
143  return BsNullPackMsg(BsNullMsgIdReqWrite, pStruct, buf, bufSize, bTrace);
144 }
145 
146 /*!
147  * \brief Unpack a BsNullReqWrite ITV message in big-endian byte order
148  * from the input buffer.
149  *
150  * \param [in] buf Output message buffer.
151  * \param uMsgLen Length of message (bytes) in input buffer.
152  * \param [out] pStruct Pointer to the associated message structure.
153  * \param bTrace Do [not] trace packing.
154  *
155  * \return
156  * On success, returns the number of bytes unpacked.
157  * On error, returns the appropriate \h_lt 0 negated NM_ECODE.
158  */
159 INLINE_IN_H int BsNullUnpackReqWrite( byte_t buf[],
160  size_t uMsgLen,
161  BsNullReqWrite_T * pStruct,
162  bool_t bTrace )
163 {
164  return BsNullUnpackMsg(BsNullMsgIdReqWrite, buf, uMsgLen, pStruct, bTrace);
165 }
166 
167 /*!
168  * \brief Pack a BsNullRspWrite ITV message in big-endian byte order
169  * into the output buffer.
170  *
171  * \param [in] pStruct Pointer to the associated, populated message
172  * structure.
173  * \param [out] buf Output message buffer.
174  * \param bufSize Size of output buffer.
175  * \param bTrace Do [not] trace packing.
176  *
177  * \return
178  * On success, returns the number of bytes packed.
179  * On error, returns the appropriate \h_lt 0 negated NM_ECODE.
180  */
181 INLINE_IN_H int BsNullPackRspWrite( BsNullRspWrite_T * pStruct,
182  byte_t buf[],
183  size_t bufSize,
184  bool_t bTrace )
185 {
186  return BsNullPackMsg(BsNullMsgIdRspWrite, pStruct, buf, bufSize, bTrace);
187 }
188 
189 /*!
190  * \brief Unpack a BsNullRspWrite ITV message in big-endian byte order
191  * from the input buffer.
192  *
193  * \param [in] buf Output message buffer.
194  * \param uMsgLen Length of message (bytes) in input buffer.
195  * \param [out] pStruct Pointer to the associated message structure.
196  * \param bTrace Do [not] trace packing.
197  *
198  * \return
199  * On success, returns the number of bytes unpacked.
200  * On error, returns the appropriate \h_lt 0 negated NM_ECODE.
201  */
202 INLINE_IN_H int BsNullUnpackRspWrite( byte_t buf[],
203  size_t uMsgLen,
204  BsNullRspWrite_T * pStruct,
205  bool_t bTrace )
206 {
207  return BsNullUnpackMsg(BsNullMsgIdRspWrite, buf, uMsgLen, pStruct, bTrace);
208 }
209 
210 
211 C_DECLS_END
212 
213 
214 #endif // _BSNULLMSGS_H
INLINE_IN_H int BsNullUnpackReqWrite(byte_t buf[], size_t uMsgLen, BsNullReqWrite_T *pStruct, bool_t bTrace)
Unpack a BsNullReqWrite ITV message in big-endian byte order from the input buffer.
Definition: bsNullMsgs.h:159
const NMMsgDef_T * BsNullLookupMsgDef(BsNullMsgId_T eMsgId)
Look up the message definition associated with the message id.
Definition: bsNullMsgs.c:186
int BsNullPackMsg(BsNullMsgId_T eMsgId, void *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a ITV message in big-endian byte order.
Definition: bsNullMsgs.c:236
INLINE_IN_H int BsNullUnpackRspWrite(byte_t buf[], size_t uMsgLen, BsNullRspWrite_T *pStruct, bool_t bTrace)
Unpack a BsNullRspWrite ITV message in big-endian byte order from the input buffer.
Definition: bsNullMsgs.h:202
size_t BsNullMsgMaxLenLookupTbl[]
Definition: bsNullMsgs.c:164
INLINE_IN_H int BsNullPackRspWrite(BsNullRspWrite_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsNullRspWrite ITV message in big-endian byte order into the output buffer.
Definition: bsNullMsgs.h:181
no message
Definition: bsNullMsgs.h:37
#define BSNULL_REQWRITE_WRITEBUF_LEN
Definition: bsNullMsgs.h:54
number of message ids
Definition: bsNullMsgs.h:40
byte_t m_byteswritten
byteswritten
Definition: bsNullMsgs.h:83
int BsNullUnpackMsg(BsNullMsgId_T eMsgId, byte_t buf[], size_t uMsgLen, void *pStruct, bool_t bTrace)
Unpack a ITV message in big-endian byte order.
Definition: bsNullMsgs.c:274
BsNullMsgId_T
Definition: bsNullMsgs.h:35
const NMMsgDef_T * BsNullMsgDefLookupTbl[]
Definition: bsNullMsgs.c:153
INLINE_IN_H int BsNullPackReqWrite(BsNullReqWrite_T *pStruct, byte_t buf[], size_t bufSize, bool_t bTrace)
Pack a BsNullReqWrite ITV message in big-endian byte order into the output buffer.
Definition: bsNullMsgs.h:138
void * m_pAlign
force alignment
Definition: bsNullMsgs.h:66
<b><i>BotSense</i></b> package top-level, unifying header declarations.
size_t m_count
vector item count
Definition: bsNullMsgs.h:63
size_t BsNullLookupMsgMaxLen(BsNullMsgId_T eMsgId)
Look up the message maximum length associated with the message id.
Definition: bsNullMsgs.c:210