![]() |
netmsgs
1.2.2
RoadNarrows Robotics Network Messaging Package
|
Identifier-Type-Value (ITV) message packing/unpacking definitions. More...
#include <stdio.h>#include <stdlib.h>#include <libgen.h>#include <string.h>#include "rnr/rnrconfig.h"#include "rnr/log.h"#include "rnr/netmsgs.h"#include "nmLibInternal.h"Go to the source code of this file.
Macros | |
| #define | ITVPACK_SIMPLE_HDR(p, buf, n, ctl) ((ctl)->m_bNoHdr? 0: nmPackITVHdrSimple(p, buf, n)) |
| Pack simple field type ITV header. More... | |
Functions | |
| static NMPackFunc_T | nmLookupITVPacker (NMFType_T eFType) |
| Lookup ITV packer function, given the message field type. More... | |
| static NMUnpackFunc_T | nmLookupITVUnpacker (NMFType_T eFType) |
| Lookup ITV unpacker function, given the message field type. More... | |
| static int | nmPackITVStream (const NMMsgDef_T *pMsgDef, void *pStruct, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a ITV message. More... | |
| static int | nmUnpackITVStream (const NMMsgDef_T *pMsgDef, byte_t buf[], size_t uMsgLen, size_t uCount, void *pStruct, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack an ITV byte stream. More... | |
| static int | nmPackITVHdrSimple (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize) |
| Pack ITV simple header. More... | |
| static int | nmPackITVHdrString (const NMFieldDef_T *pFieldDef, size_t uCount, byte_t buf[], size_t bufSize) |
| Pack ITV String header. More... | |
| static int | nmPackITVHdrStruct (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize) |
| Pack ITV Struct header. More... | |
| static int | nmPackITVHdrVector (const NMFieldDef_T *pFieldDef, size_t uCount, byte_t buf[], size_t bufSize) |
| Pack ITV Vector header. More... | |
| static int | nmPackITVPad (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack pad bytes into the message buffer. More... | |
| static int | nmPackITVBool (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a boolean into an 8-bit ITV field into the message buffer. More... | |
| static int | nmPackITVU8 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack an unsigned 8-bit ITV field into the message buffer. More... | |
| static int | nmPackITVS8 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a signed 8-bit ITV field into the message buffer. More... | |
| static int | nmPackITVU16 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack an unsigned 16-bit ITV field into the message buffer. More... | |
| static int | nmPackITVS16 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a signed 16-bit ITV field into the message buffer. More... | |
| static int | nmPackITVU32 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack an unsigned 32-bit ITV field into the message buffer. More... | |
| static int | nmPackITVS32 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a signed 32-bit ITV field into the message buffer. More... | |
| static int | nmPackITVU64 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack an unsigned 64-bit ITV field into the message buffer. More... | |
| static int | nmPackITVS64 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a signed 64-bit ITV field into the message buffer. More... | |
| static int | nmPackITVF32 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a 32-bit floating-point number ITV field into the message buffer. More... | |
| static int | nmPackITVF64 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a 64-bit floating-point number ITV field into the message buffer. More... | |
| static int | nmPackITVP32 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a 32-bit pointer ITV field into the message buffer. More... | |
| static int | nmPackITVP64 (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a 64-bit pointer ITV field into the message buffer. More... | |
| static int | nmPackITVString (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack null-terminated, variable length string ITV field into the message buffer. More... | |
| static int | nmPackITVStruct (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack a structure ITV field into the message buffer. More... | |
| static int | nmPackITVVector (const NMFieldDef_T *pFieldDef, void *pVal, byte_t buf[], size_t bufSize, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Pack variable length vector ITV field into the message buffer. More... | |
| static int | nmUnpackITVNoExec (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, size_t uFLen, NMCtl_T *pCtl) |
| Move parse cursor position past current field in message stream field. More... | |
| static int | nmUnpackITVPad (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack pad byte from the message buffer. More... | |
| static int | nmUnpackITVBool (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack an unsigned 8-bit boolean ITV field from the message buffer. More... | |
| static int | nmUnpackITVU8 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack an unsigned 8-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVS8 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a signed 8-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVU16 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack an unsigned 16-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVS16 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a signed 16-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVU32 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack an unsigned 32-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVS32 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a signed 32-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVU64 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack an unsigned 64-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVS64 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a signed 64-bit ITV field from the message buffer. More... | |
| static int | nmUnpackITVF32 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a 32-bit floating-point number ITV field from the message buffer. More... | |
| static int | nmUnpackITVF64 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a 64-bit floating-point number ITV field from the message buffer. More... | |
| static int | nmUnpackITVP32 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a 32-bit pointer ITV field from the message buffer. More... | |
| static int | nmUnpackITVP64 (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack a 64-bit pointer ITV field from the message buffer. More... | |
| static int | nmUnpackITVString (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack variable length string ITV field from the message buffer. More... | |
| static int | nmUnpackITVStruct (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack structure ITV field from the message buffer. More... | |
| static int | nmUnpackITVVector (const NMFieldDef_T *pFieldDef, byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian, NMCtl_T *pCtl) |
| Unpack variable length vector ITV field from the message buffer. More... | |
| int | nmPackITVMsg (const NMMsgDef_T *pMsgDef, void *pStruct, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an ITV message. More... | |
| int | nmPackITVMsgDebug (const NMMsgDef_T *pMsgDef, void *pStruct, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an ITV message, tracing message packing to stderr. More... | |
| int | nmUnpackITVMsg (const NMMsgDef_T *pMsgDef, byte_t buf[], size_t uMsgLen, void *pStruct, NMEndian_T eEndian) |
| Unpack a ITV message. More... | |
| int | nmUnpackITVMsgDebug (const NMMsgDef_T *pMsgDef, byte_t buf[], size_t uMsgLen, void *pStruct, NMEndian_T eEndian) |
| Unpack a ITV message, tracing unpacking to stderr. More... | |
| uint_t | nmGetITVMsgId (byte_t buf[], size_t uMsgLen, NMEndian_T eEndian) |
| Get ITV message id from input buffer. More... | |
Variables | |
| static NMLookupTblEntry_T | NMITVLookupTbl [] |
Identifier-Type-Value (ITV) message packing/unpacking definitions.
Definition in file nmLibPackITV.c.
| #define ITVPACK_SIMPLE_HDR | ( | p, | |
| buf, | |||
| n, | |||
| ctl | |||
| ) | ((ctl)->m_bNoHdr? 0: nmPackITVHdrSimple(p, buf, n)) |
Pack simple field type ITV header.
| p | Pointer to message field definition. | |
| [out] | buf | Output message buffer. |
| n | Size of output buffer. | |
| ctl | Internal control. |
Definition at line 93 of file nmLibPackITV.c.
Referenced by nmPackITVBool(), nmPackITVF32(), nmPackITVF64(), nmPackITVP32(), nmPackITVP64(), nmPackITVS16(), nmPackITVS32(), nmPackITVS64(), nmPackITVS8(), nmPackITVU16(), nmPackITVU32(), nmPackITVU64(), and nmPackITVU8().
| uint_t nmGetITVMsgId | ( | byte_t | buf[], |
| size_t | uMsgLen, | ||
| NMEndian_T | eEndian | ||
| ) |
Get ITV message id from input buffer.
| [in] | buf | Input message buffer. |
| uMsgLen | Length of message (bytes) in input buffer. | |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 2482 of file nmLibPackITV.c.
References NMITV_MSGHDR_SIZE, NMMSG_ID_NONE, and nmUnpackU16().
Referenced by nmUnpackPointer().
|
static |
Lookup ITV packer function, given the message field type.
| eFType | Message field type. |
Definition at line 2174 of file nmLibPackITV.c.
References NMLookupTblEntry_T::m_fnPack, NM_ECODE_INTERNAL, NMHashFType(), NMHashNoIdx, NMLIB_ASCII_FTYPE, and NMLIB_ERROR.
Referenced by nmPackITVStream(), and nmPackITVVector().
|
static |
Lookup ITV unpacker function, given the message field type.
| eFType | Message field type. |
Definition at line 2209 of file nmLibPackITV.c.
References NMLookupTblEntry_T::m_fnUnpack, NM_ECODE_INTERNAL, NMHashFType(), NMHashNoIdx, NMLIB_ASCII_FTYPE, and NMLIB_ERROR.
Referenced by nmUnpackITVStream(), and nmUnpackITVVector().
|
static |
Pack a boolean into an 8-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 257 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NMLIB_TRACE_FIELD, and nmPackBool().
|
static |
Pack a 32-bit floating-point number ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 667 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackF32(), and nmSetF32().
|
static |
Pack a 64-bit floating-point number ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 713 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackF64(), and nmSetF64().
|
static |
Pack ITV simple header.
| pFieldDef | Pointer to message field definition. | |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. |
Definition at line 105 of file nmLibPackITV.c.
References _nm_field_def_struct::m_eFId, _nm_field_def_struct::m_eFType, NM_ECODE_NOMEM, NMITV_FHDR_SIZE_SIMPLE, NMITV_FHDR_SIZE_STRING, and NMLIB_RAISE_FIELD_ERROR.
|
static |
Pack ITV String header.
| pFieldDef | Pointer to message field definition. | |
| uCount | Number of character bytes in string. | |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. |
Definition at line 135 of file nmLibPackITV.c.
References _nm_field_def_struct::m_eFId, _nm_field_def_struct::m_eFType, NM_ECODE_NOMEM, NMITV_FHDR_SIZE_STRING, and NMLIB_RAISE_FIELD_ERROR.
Referenced by nmPackITVString().
|
static |
Pack ITV Struct header.
| pFieldDef | Pointer to message field definition. | |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. |
Definition at line 166 of file nmLibPackITV.c.
References _nm_field_def_struct::m_eFId, _nm_field_def_struct::m_eFType, NMFieldThis_T::m_struct, _nm_field_def_struct::m_this, _nm_msg_def_struct::m_uCount, NM_ECODE_NOMEM, NMITV_FHDR_SIZE_STRUCT, and NMLIB_RAISE_FIELD_ERROR.
Referenced by nmPackITVStruct().
|
static |
Pack ITV Vector header.
| pFieldDef | Pointer to message field definition. | |
| uCount | Number of vector elements. | |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. |
Definition at line 197 of file nmLibPackITV.c.
References _nm_field_def_struct::m_eFId, _nm_field_def_struct::m_eFType, NMFieldThisVector_T::m_pThisElem, _nm_field_def_struct::m_this, NMFieldThis_T::m_vector, NM_ECODE_NOMEM, NMITV_FHDR_SIZE_VECTOR, and NMLIB_RAISE_FIELD_ERROR.
Referenced by nmPackITVVector().
| int nmPackITVMsg | ( | const NMMsgDef_T * | pMsgDef, |
| void * | pStruct, | ||
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an ITV message.
| pMsgDef | Pointer to message definition. | |
| [in] | pStruct | Pointer to the associated, populated message structure. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 2254 of file nmLibPackITV.c.
References _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_sMsgName, _nm_msg_def_struct::m_uCount, NM_ECODE_NOMEM, NMCTL_INIT_DECL, NMITV_MSGHDR_SIZE, NMLIB_RAISE_ERROR, nmPackITVStream(), and nmPackU16().
Referenced by nmUnpackPointer().
| int nmPackITVMsgDebug | ( | const NMMsgDef_T * | pMsgDef, |
| void * | pStruct, | ||
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an ITV message, tracing message packing to stderr.
| pMsgDef | Pointer to message definition. | |
| [in] | pStruct | Pointer to the associated, populated message structure. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 2299 of file nmLibPackITV.c.
References NMCtl_T::m_bTrace, _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_sMsgName, _nm_msg_def_struct::m_uCount, NM_ECODE_NOMEM, NMCTL_INIT_DECL, NMITV_MSGHDR_SIZE, NMLIB_RAISE_ERROR, nmPackITVStream(), nmPackU16(), and nmPrintBuf().
Referenced by nmUnpackPointer().
|
static |
Pack a 32-bit pointer ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 759 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NMLIB_TRACE_FIELD, and nmPackP32().
|
static |
Pack a 64-bit pointer ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 798 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NMLIB_TRACE_FIELD, and nmPackP64().
|
static |
Pack pad bytes into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 226 of file nmLibPackITV.c.
References _nm_field_def_struct::m_eFId, NMFieldThis_T::m_pad, _nm_field_def_struct::m_this, NMFieldThisPad_T::m_uCount, NM_ECODE_NOMEM, NMFVAL_PAD, NMLIB_RAISE_FIELD_ERROR, and NMLIB_TRACE_FIELD.
|
static |
Pack a signed 16-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 437 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackS16(), and nmSetS16().
|
static |
Pack a signed 32-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 529 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackS32(), and nmSetS32().
|
static |
Pack a signed 64-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 621 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackS64(), and nmSetS64().
|
static |
Pack a signed 8-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 345 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackS8(), and nmSetS8().
|
static |
Pack a ITV message.
| pMsgDef | Pointer to message definition. | |
| [in] | pStruct | Pointer to the associated, populated message structure. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Pointer to Internal control. |
Definition at line 1035 of file nmLibPackITV.c.
References _nm_field_def_struct::m_eFType, _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_pFields, _nm_field_def_struct::m_uOffset, NM_ECODE_FTYPE, NM_ECODE_NOMEM, NMFTypePad, NMLIB_ASCII_FTYPE, NMLIB_RAISE_ERROR, NMLIB_RAISE_FIELD_ERROR, and nmLookupITVPacker().
Referenced by nmPackITVMsg(), nmPackITVMsgDebug(), and nmPackITVStruct().
|
static |
Pack null-terminated, variable length string ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 840 of file nmLibPackITV.c.
References NMFieldThisString_T::m_sConst, NMFieldThis_T::m_string, _nm_field_def_struct::m_this, NMFieldThisString_T::m_uMaxCount, NM_ECODE_NOMEM, NM_ECODE_RANGE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, and nmPackITVHdrString().
|
static |
Pack a structure ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 903 of file nmLibPackITV.c.
References _nm_msg_def_struct::m_sMsgName, NMFieldThis_T::m_struct, _nm_field_def_struct::m_this, _nm_msg_def_struct::m_uCount, NMCtl_T::m_uDepth, NMLIB_TRACE_FIELD, nmPackITVHdrStruct(), and nmPackITVStream().
|
static |
Pack an unsigned 16-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 391 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackU16(), and nmSetU16().
|
static |
Pack an unsigned 32-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 483 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackU32(), and nmSetU32().
|
static |
Pack an unsigned 64-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 575 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackU64(), and nmSetU64().
|
static |
Pack an unsigned 8-bit ITV field into the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 299 of file nmLibPackITV.c.
References ITVPACK_SIMPLE_HDR, NM_OK, NMLIB_TRACE_FIELD, nmPackU8(), and nmSetU8().
|
static |
Pack variable length vector ITV field into the message buffer.
A vector is a one-dimension array of the given type.
| pFieldDef | Pointer to message field definition. | |
| [in] | pVal | Pointer to (typecasted) value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 944 of file nmLibPackITV.c.
References NMCtl_T::m_bNoHdr, NMVec_T::m_buf, _nm_field_def_struct::m_eFType, NMFieldThisVector_T::m_pThisElem, _nm_field_def_struct::m_this, NMVec_T::m_uCount, NMCtl_T::m_uDepth, NMFieldThisVector_T::m_uElemSize, NMFieldThisVector_T::m_uMaxCount, NMFieldThis_T::m_vector, NM_ECODE_FTYPE, NM_ECODE_RANGE, NMFTYPE_IS_SIMPLE, NMLIB_ASCII_FTYPE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmLookupITVPacker(), and nmPackITVHdrVector().
|
static |
Unpack an unsigned 8-bit boolean ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1164 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_U8, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackBool(), and nmUnpackITVNoExec().
|
static |
Unpack a 32-bit floating-point number ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1618 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_F32, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackF32(), and nmUnpackITVNoExec().
|
static |
Unpack a 64-bit floating-point number ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1669 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_F64, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackF64(), and nmUnpackITVNoExec().
| int nmUnpackITVMsg | ( | const NMMsgDef_T * | pMsgDef, |
| byte_t | buf[], | ||
| size_t | uMsgLen, | ||
| void * | pStruct, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a ITV message.
| pMsgDef | Pointer to message definition. | |
| [in] | buf | Input message buffer. |
| uMsgLen | Length of message (bytes) in input buffer. | |
| [out] | pStruct | Pointer to the associated message structure to populate. |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 2364 of file nmLibPackITV.c.
References _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_sMsgName, NM_ECODE_MSGID, NM_ECODE_NOMEM, NMCTL_INIT_DECL, NMITV_MSGHDR_SIZE, NMLIB_RAISE_ERROR, nmUnpackITVStream(), and nmUnpackU16().
Referenced by nmUnpackPointer().
| int nmUnpackITVMsgDebug | ( | const NMMsgDef_T * | pMsgDef, |
| byte_t | buf[], | ||
| size_t | uMsgLen, | ||
| void * | pStruct, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a ITV message, tracing unpacking to stderr.
| pMsgDef | Pointer to message definition. | |
| [in] | buf | Input message buffer. |
| uMsgLen | Length of message (bytes) in input buffer. | |
| [out] | pStruct | Pointer to the associated message structure to populate. |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 2419 of file nmLibPackITV.c.
References NMCtl_T::m_bTrace, _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_sMsgName, NM_ECODE_MSGID, NM_ECODE_NOMEM, NMCTL_INIT_DECL, NMITV_MSGHDR_SIZE, NMLIB_RAISE_ERROR, nmPrintBuf(), nmUnpackITVStream(), and nmUnpackU16().
Referenced by nmUnpackPointer().
|
static |
Move parse cursor position past current field in message stream field.
No unpacking field into an output variable is executed.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| uFLen | Length of field (bytes). | |
| pCtl | Pointer to Internal control. |
Definition at line 1115 of file nmLibPackITV.c.
References NM_ECODE_NOMEM, NMLIB_RAISE_FIELD_ERROR, and NMLIB_TRACE_FIELD.
Referenced by nmUnpackITVBool(), nmUnpackITVF32(), nmUnpackITVF64(), nmUnpackITVP32(), nmUnpackITVP64(), nmUnpackITVS16(), nmUnpackITVS32(), nmUnpackITVS64(), nmUnpackITVS8(), nmUnpackITVU16(), nmUnpackITVU32(), nmUnpackITVU64(), and nmUnpackITVU8().
|
static |
Unpack a 32-bit pointer ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1719 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_P32, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackP32().
|
static |
Unpack a 64-bit pointer ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1769 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_P64, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackP64().
|
static |
Unpack pad byte from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1138 of file nmLibPackITV.c.
References NMFVAL_PAD, and NMLIB_TRACE_FIELD.
|
static |
Unpack a signed 16-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1366 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_S16, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackS16().
|
static |
Unpack a signed 32-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1466 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_S32, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackS32().
|
static |
Unpack a signed 64-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1567 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_S64, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackS64().
|
static |
Unpack a signed 8-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1265 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_S8, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackS8().
|
static |
Unpack an ITV byte stream.
| pMsgDef | Pointer to message definition. | |
| [in] | buf | Input message buffer. |
| uMsgLen | Length of message (bytes) in input buffer. | |
| [out] | pStruct | Pointer to the associated message structure to populate. |
| uCount | Received message/struct field count | |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Pointer to Internal control. |
Definition at line 2043 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, _nm_field_def_struct::m_eFType, _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_sMsgName, _nm_field_def_struct::m_uOffset, NM_ECODE_EMSG, NM_ECODE_FTYPE, NM_ECODE_NOMEM, nmFindFieldDef(), NMFTypePad, NMFTypePadTr, NMITV_FHDR_SIZE_BASE, NMITV_FID_SIZE, NMLIB_ASCII_FTYPE, NMLIB_RAISE_ERROR, NMLIB_RAISE_FIELD_ERROR, NMLIB_WARNING, and nmLookupITVUnpacker().
Referenced by nmUnpackITVMsg(), nmUnpackITVMsgDebug(), and nmUnpackITVStruct().
|
static |
Unpack variable length string ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1821 of file nmLibPackITV.c.
References NMFieldThis_T::m_string, _nm_field_def_struct::m_this, NMFieldThisString_T::m_uMaxCount, NM_ECODE_NOMEM, NM_ECODE_RANGE, NMITV_FHDR_SIZE_STRING, NMLIB_RAISE_FIELD_ERROR, and NMLIB_TRACE_FIELD.
|
static |
Unpack structure ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1883 of file nmLibPackITV.c.
References _nm_msg_def_struct::m_sMsgName, NMFieldThis_T::m_struct, _nm_field_def_struct::m_this, NMCtl_T::m_uDepth, NM_ECODE_NOMEM, NMITV_FHDR_SIZE_STRUCT, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, and nmUnpackITVStream().
|
static |
Unpack an unsigned 16-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1316 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_U16, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackU16().
|
static |
Unpack an unsigned 32-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1416 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_U32, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackU32().
|
static |
Unpack an unsigned 64-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1516 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_U64, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackU64().
|
static |
Unpack an unsigned 8-bit ITV field from the message buffer.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1215 of file nmLibPackITV.c.
References NMCtl_T::m_bNoExec, NMCtl_T::m_bNoHdr, NM_ECODE_NOMEM, NMFVAL_LEN_U8, NMITV_FHDR_SIZE_SIMPLE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, nmUnpackITVNoExec(), and nmUnpackU8().
|
static |
Unpack variable length vector ITV field from the message buffer.
A vector is a one-dimension array of the given type.
| pFieldDef | Pointer to message field definition. | |
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. | |
| pCtl | Internal control. |
Definition at line 1930 of file nmLibPackITV.c.
References NMCtl_T::m_bNoHdr, NMVec_T::m_buf, _nm_field_def_struct::m_eFType, NMFieldThisVector_T::m_pThisElem, _nm_field_def_struct::m_this, NMVec_T::m_uCount, NMCtl_T::m_uDepth, NMFieldThisVector_T::m_uElemSize, NMFieldThisVector_T::m_uMaxCount, NMFieldThis_T::m_vector, NM_ECODE_EMSG, NM_ECODE_FTYPE, NM_ECODE_NOMEM, NM_ECODE_RANGE, NMFTYPE_IS_SIMPLE, NMITV_FHDR_SIZE_VECTOR, NMLIB_ASCII_FTYPE, NMLIB_RAISE_FIELD_ERROR, NMLIB_TRACE_FIELD, and nmLookupITVUnpacker().
|
static |
ITV Info Lookup Table
Definition at line 2145 of file nmLibPackITV.c.