![]() |
netmsgs
1.2.2
RoadNarrows Robotics Network Messaging Package
|
Network Messaging declarations. More...
#include <stdio.h>#include "rnr/rnrconfig.h"Go to the source code of this file.
Classes | |
| struct | NMFieldThisPad_T |
| struct | NMFieldThisU8_T |
| struct | NMFieldThisU16_T |
| struct | NMFieldThisU32_T |
| struct | NMFieldThisU64_T |
| struct | NMFieldThisF32_T |
| struct | NMFieldThisF64_T |
| struct | NMFieldThisString_T |
| struct | NMFieldThisVector_T |
| union | NMFieldThis_T |
| struct | _nm_field_def_struct |
| struct | NMVec_T |
| struct | _nm_msg_def_struct |
Macros | |
| #define | NMFTYPE_IS_COMPOUND(ft) (((ft)==NMFTypeString) || ((ft)==NMFTypeStruct) || ((ft)==NMFTypeVector)) |
| Returns true if field type is a compoound type. More... | |
| #define | NMFTYPE_IS_SIMPLE(ft) (!NMFTYPE_IS_COMPOUND(ft)) |
| Returns true if field type is a simple type. More... | |
| #define | NMFVAL_LEN_CHAR 1 |
| character field length More... | |
| #define | NMFVAL_LEN_U8 1 |
| unsigned 8-bit field value length | |
| #define | NMFVAL_LEN_S8 1 |
| signed 8-bit field value length | |
| #define | NMFVAL_LEN_BOOL 1 |
| boolean field length | |
| #define | NMFVAL_LEN_U16 2 |
| unsigned 16-bit field value length | |
| #define | NMFVAL_LEN_S16 2 |
| signed 16-bit field value length | |
| #define | NMFVAL_LEN_U32 4 |
| unsigned 32-bit field value length | |
| #define | NMFVAL_LEN_S32 4 |
| signed 32-bit field value length | |
| #define | NMFVAL_LEN_U64 8 |
| unsigned 64-bit field value length | |
| #define | NMFVAL_LEN_S64 8 |
| signed 64-bit field value length | |
| #define | NMFVAL_LEN_F32 4 |
| 32-bit floating-point number field val len | |
| #define | NMFVAL_LEN_F64 8 |
| 64-bit floating-point number field val len | |
| #define | NMFVAL_LEN_P32 4 |
| 32-bit pointer field value length | |
| #define | NMFVAL_LEN_P64 8 |
| 64-bit pointer field value length | |
| #define | NMFVAL_LEN_BYTE NMFVAL_LEN_U8 |
| unsigned char field length | |
| #define | NMFVAL_LEN_SCHAR NMFVAL_LEN_S8 |
| signed char field length | |
| #define | NMFVAL_LEN_USHORT NMFVAL_LEN_U16 |
| unsigned short field length | |
| #define | NMFVAL_LEN_SHORT NMFVAL_LEN_S16 |
| short field length | |
| #define | NMFVAL_LEN_UINT NMFVAL_LEN_U32 |
| signed int field length | |
| #define | NMFVAL_LEN_INT NMFVAL_LEN_U32 |
| unsigned int field length | |
| #define | NMFVAL_LEN_ULONGLONG NMFVAL_LEN_U64 |
| signed long long field length | |
| #define | NMFVAL_LEN_LONGLONG NMFVAL_LEN_U64 |
| unsigned long long field len | |
| #define | NMFVAL_LEN_FLOAT NMFVAL_LEN_F32 |
| float field length | |
| #define | NMFVAL_LEN_DOUBLE NMFVAL_LEN_F64 |
| double field length | |
| #define | NMFVAL_LEN_POINTER NMFVAL_LEN_P32 |
| 4-byte void* field length | |
| #define | NMFVAL_LEN_LONGPOINTER NMFVAL_LEN_P64 |
| 8-byte void* field length | |
| #define | NMFVAL_LEN_STRING 0 |
| char[] variable field length | |
| #define | NMFVAL_LEN_MAX_STRING 255 |
| max string length (excluding null) | |
| #define | NMFVAL_LEN_STRUCT 0 |
| struct T variable field length | |
| #define | NMFVAL_LEN_VECTOR 0 |
| VType[[] variable field length. | |
| #define | NMFVAL_LEN_MAX_VECTOR 255 |
| max vector field length (num of items) | |
| #define | NMFVAL_PAD ((byte_t)NMFTypePadTr) |
| pad field value same as tr id | |
| #define | NMMSG_ID_NONE 0 |
| no message id (reserved) | |
| #define | NMFID_NONE 0 |
| no field id (reserved) | |
| #define | NMITV_MSGID_SIZE 2 |
| 2 byte message id size More... | |
| #define | NMITV_FID_SIZE 1 |
| 1 byte field id size | |
| #define | NMITV_FTYPE_SIZE 1 |
| 1 byte field type size | |
| #define | NMITV_FCOUNT_SIZE 1 |
| 1 byte field count size | |
| #define | NMITV_MSGHDR_SIZE (NMITV_MSGID_SIZE + NMITV_FCOUNT_SIZE) |
| #define | NMITV_FHDR_SIZE_BASE (NMITV_FID_SIZE + NMITV_FTYPE_SIZE) |
| #define | NMITV_FHDR_SIZE_SIMPLE NMITV_FHDR_SIZE_BASE |
| #define | NMITV_FHDR_SIZE_STRING (NMITV_FHDR_SIZE_BASE + NMITV_FCOUNT_SIZE) |
| #define | NMITV_FHDR_SIZE_STRUCT (NMITV_FHDR_SIZE_BASE + NMITV_FCOUNT_SIZE) |
| #define | NMITV_FHDR_SIZE_VECTOR (NMITV_FHDR_SIZE_BASE + NMITV_FCOUNT_SIZE + NMITV_FTYPE_SIZE) |
| #define | NMBITS_HAS_MIN 0x01 |
| field has a minimum value | |
| #define | NMBITS_HAS_MAX 0x02 |
| field has a maximum value | |
| #define | NMBITS_HAS_CONST 0x04 |
| field has a constant value | |
| #define | NM_OK 0 |
| not an error, success More... | |
| #define | NM_ECODE_GEN 1 |
| general, unspecified error | |
| #define | NM_ECODE_NOMEM 2 |
| not enough buffer memory available | |
| #define | NM_ECODE_ARCH_NOTSUP 3 |
| machine architecture not supported | |
| #define | NM_ECODE_RANGE 4 |
| field size or value out-of-range | |
| #define | NM_ECODE_FTYPE 5 |
| unknown field type | |
| #define | NM_ECODE_EMSG 6 |
| bad message | |
| #define | NM_ECODE_MSGID 7 |
| bad/unknown message id | |
| #define | NM_ECODE_INTERNAL 8 |
| internal inconsistency or bug | |
| #define | NM_ECODE_BADEC 9 |
| internal inconsistency or bug | |
| #define | NM_ECODE_NUMOF 10 |
| number of error codes | |
Typedefs | |
| typedef const struct _nm_field_def_struct * | NMFieldDef_P |
| msg def struct More... | |
| typedef const struct _nm_msg_def_struct * | NMMsgDef_P |
| msg def pointer | |
| typedef NMMsgDef_P | NMFieldThisStruct_T |
| typedef struct _nm_field_def_struct | NMFieldDef_T |
| typedef struct _nm_msg_def_struct | NMMsgDef_T |
Enumerations | |
| enum | NMEncoding_T { NMEncodingFlat, NMEncodingITV, NMEncodingCLI, NMEncodingNumOf } |
| enum | NMEndian_T { NMEndianBig, NMEndianLittle, NMEndianNative } |
| enum | NMFType_T { NMFTypeNone = 0, NMFTypePadTr = 0, NMFTypeBool = '?', NMFTypeU8 = 'B', NMFTypeByte = 'B', NMFTypeF64 = 'F', NMFTypeDouble = 'F', NMFTypeU16 = 'H', NMFTypeUShort = 'H', NMFTypeU32 = 'I', NMFTypeUInt = 'I', NMFTypeP64 = 'P', NMFTypeLongPointer = 'P', NMFTypeU64 = 'Q', NMFTypeULongLong = 'Q', NMFTypeVector = '[', NMFTypeS8 = 'b', NMFTypeSChar = 'b', NMFTypeChar = 'c', NMFTypeF32 = 'f', NMFTypeFloat = 'f', NMFTypeS16 = 'h', NMFTypeShort = 'h', NMFTypeS32 = 'i', NMFTypeInt = 'i', NMFTypeP32 = 'p', NMFTypePointer = 'p', NMFTypeS64 = 'q', NMFTypeLongLong = 'q', NMFTypeString = 's', NMFTypePad = 'x', NMFTypeStruct = '{', NMFTypeNumOf = 18 } |
Functions | |
| const char * | nmStrError (int ecode) |
| Get the error string describing the BotSense error code. More... | |
| void | nmPrintBuf (FILE *fp, const char *sPreface, byte_t buf[], size_t uCount, size_t uNLFreq, uint_t uCol) |
| Pretty print buffer to opened file stream. More... | |
| void | nmPrintBits (FILE *fp, const char *sPreface, ulonglong_t uVal, uint_t uMsb, uint_t uCnt) |
| Pretty print bits in value. More... | |
| size_t | nmGetFieldValSize (NMFType_T eFType) |
| Get the field value byte size. More... | |
| const NMFieldDef_T * | nmFindFieldDef (const NMMsgDef_T *pMsgDef, byte_t byFId) |
| Find the field definition in the message definition, given the field id. More... | |
| int | nmPackU8 (byte_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned 8-bit byte into the message buffer. More... | |
| int | nmPackU16 (ushort_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned 16-bit integer into the message buffer. More... | |
| int | nmPackU32 (uint_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned 32-bit integer into the message buffer. More... | |
| int | nmPackU64 (ulonglong_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned 64-bit integer into the message buffer. More... | |
| int | nmPackS64 (long long val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an signed 64-bit integer into the message buffer. More... | |
| int | nmPackF32 (float val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a 32-bit float into the message buffer. More... | |
| int | nmPackF64 (double val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a 64-bit float into the message buffer. More... | |
| int | nmPackP32 (void *val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a 32-bit pointer into the message buffer. More... | |
| int | nmPackP64 (void *val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a 64-bit pointer into the message buffer. More... | |
| int | nmPackBuf (byte_t bufSrc[], size_t uCount, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a byte buffer into the message buffer. More... | |
| INLINE_IN_H int | nmPackS8 (signed char val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a signed 8-bit byte into the message buffer. More... | |
| INLINE_IN_H int | nmPackS16 (short val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a signed 16-bit integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackS32 (int val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a signed 32-bit integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackByte (byte_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a one byte value into the message buffer. More... | |
| INLINE_IN_H int | nmPackSChar (signed char val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a signed char integer value into the message buffer. More... | |
| INLINE_IN_H int | nmPackChar (char val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a 8-bit ASCII character into the message buffer. More... | |
| INLINE_IN_H int | nmPackBool (bool_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a boolean value into the message buffer. More... | |
| INLINE_IN_H int | nmPackUShort (ushort_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned short integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackShort (short val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an signed short integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackUInt (uint_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned int integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackInt (int val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an signed int integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackULong (ulong_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned long integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackLong (long val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an signed long integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackULongLong (ulonglong_t val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an unsigned long long integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackLongLong (long long val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an signed long long integer into the message buffer. More... | |
| INLINE_IN_H int | nmPackPointer (void *val, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack a (overloaded) void* pointer into the message buffer. More... | |
| int | nmUnpackU8 (byte_t buf[], size_t bufSize, byte_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned 8-bit byte from the message buffer. More... | |
| int | nmUnpackU16 (byte_t buf[], size_t bufSize, ushort_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned 16-bit integer from the message buffer. More... | |
| int | nmUnpackU32 (byte_t buf[], size_t bufSize, uint_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned 32-bit integer from the message buffer. More... | |
| int | nmUnpackU64 (byte_t buf[], size_t bufSize, ulonglong_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned 64-bit integer from the message buffer. More... | |
| int | nmUnpackS64 (byte_t buf[], size_t bufSize, long long *pVal, NMEndian_T eEndian) |
| Unpack an signed 64-bit integer from the message buffer. More... | |
| int | nmUnpackF32 (byte_t buf[], size_t bufSize, float *pVal, NMEndian_T eEndian) |
| Unpack a 32-bit float from the message buffer. More... | |
| int | nmUnpackF64 (byte_t buf[], size_t bufSize, double *pVal, NMEndian_T eEndian) |
| Unpack a 64-bit float from the message buffer. More... | |
| int | nmUnpackP32 (byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian) |
| Unpack a 32-bit pointer from the message buffer. More... | |
| int | nmUnpackP64 (byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian) |
| Unpack a 64-bit pointer from the message buffer. More... | |
| int | nmUnpackBuf (byte_t buf[], size_t bufSize, byte_t bufDst[], size_t uCount, NMEndian_T eEndian) |
| Unpack a byte buffer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackS8 (byte_t buf[], size_t bufSize, signed char *pVal, NMEndian_T eEndian) |
| Unpack a signed 8-bit byte from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackS16 (byte_t buf[], size_t bufSize, short *pVal, NMEndian_T eEndian) |
| Unpack a signed 16-bit integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackS32 (byte_t buf[], size_t bufSize, int *pVal, NMEndian_T eEndian) |
| Unpack a signed 32-bit integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackByte (byte_t buf[], size_t bufSize, byte_t *pVal, NMEndian_T eEndian) |
| Unpack one byte from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackSChar (byte_t buf[], size_t bufSize, signed char *pVal, NMEndian_T eEndian) |
| Unpack an signed short integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackChar (byte_t buf[], size_t bufSize, char *pVal, NMEndian_T eEndian) |
| Unpack an 8-bit ASCII character from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackBool (byte_t buf[], size_t bufSize, bool_t *pVal, NMEndian_T eEndian) |
| Unpack a boolean value from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackUShort (byte_t buf[], size_t bufSize, ushort_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned short integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackShort (byte_t buf[], size_t bufSize, short *pVal, NMEndian_T eEndian) |
| Unpack an signed short integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackUInt (byte_t buf[], size_t bufSize, uint_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned int integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackInt (byte_t buf[], size_t bufSize, int *pVal, NMEndian_T eEndian) |
| Unpack an signed int integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackULong (byte_t buf[], size_t bufSize, ulong_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned long integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackLong (byte_t buf[], size_t bufSize, long *pVal, NMEndian_T eEndian) |
| Unpack an signed long integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackULongLong (byte_t buf[], size_t bufSize, ulonglong_t *pVal, NMEndian_T eEndian) |
| Unpack an unsigned long long integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackLongLong (byte_t buf[], size_t bufSize, long long *pVal, NMEndian_T eEndian) |
| Unpack an signed long long integer from the message buffer. More... | |
| INLINE_IN_H int | nmUnpackPointer (byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian) |
| Unpack a (overloaded)void* pointer 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... | |
| int | nmPackFlatMsg (const NMMsgDef_T *pMsgDef, void *pStruct, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an Flat message. More... | |
| int | nmPackFlatMsgDebug (const NMMsgDef_T *pMsgDef, void *pStruct, byte_t buf[], size_t bufSize, NMEndian_T eEndian) |
| Pack an Flat message, tracing message packing to stderr. More... | |
| int | nmUnpackFlatMsg (const NMMsgDef_T *pMsgDef, byte_t buf[], size_t uMsgLen, void *pStruct, NMEndian_T eEndian) |
| Unpack a Flat message. More... | |
| int | nmUnpackFlatMsgDebug (const NMMsgDef_T *pMsgDef, byte_t buf[], size_t uMsgLen, void *pStruct, NMEndian_T eEndian) |
| Unpack a Flat message, tracing unpacking to stderr. More... | |
Network Messaging declarations.
Definition in file netmsgs.h.
| #define NMFTYPE_IS_COMPOUND | ( | ft | ) | (((ft)==NMFTypeString) || ((ft)==NMFTypeStruct) || ((ft)==NMFTypeVector)) |
| #define NMFTYPE_IS_SIMPLE | ( | ft | ) | (!NMFTYPE_IS_COMPOUND(ft)) |
Returns true if field type is a simple type.
| ft | Field type. |
Definition at line 164 of file netmsgs.h.
Referenced by nmPackFlatVector(), nmPackITVVector(), and nmUnpackITVVector().
| #define NMFVAL_LEN_CHAR 1 |
| #define NMITV_FHDR_SIZE_BASE (NMITV_FID_SIZE + NMITV_FTYPE_SIZE) |
number of bytes in header to identify and quatify field (fid, ftype)
Definition at line 225 of file netmsgs.h.
Referenced by nmUnpackITVStream().
| #define NMITV_FHDR_SIZE_SIMPLE NMITV_FHDR_SIZE_BASE |
number of bytes in simple field header (fid, ftype)
Definition at line 228 of file netmsgs.h.
Referenced by nmPackITVHdrSimple(), nmUnpackITVBool(), nmUnpackITVF32(), nmUnpackITVF64(), nmUnpackITVP32(), nmUnpackITVP64(), nmUnpackITVS16(), nmUnpackITVS32(), nmUnpackITVS64(), nmUnpackITVS8(), nmUnpackITVU16(), nmUnpackITVU32(), nmUnpackITVU64(), and nmUnpackITVU8().
| #define NMITV_FHDR_SIZE_STRING (NMITV_FHDR_SIZE_BASE + NMITV_FCOUNT_SIZE) |
number of bytes in string field header (fid, ftype, count)
Definition at line 231 of file netmsgs.h.
Referenced by nmPackITVHdrSimple(), nmPackITVHdrString(), and nmUnpackITVString().
| #define NMITV_FHDR_SIZE_STRUCT (NMITV_FHDR_SIZE_BASE + NMITV_FCOUNT_SIZE) |
number of bytes in struct field header (fid, ftype, count)
Definition at line 234 of file netmsgs.h.
Referenced by nmPackITVHdrStruct(), and nmUnpackITVStruct().
| #define NMITV_FHDR_SIZE_VECTOR (NMITV_FHDR_SIZE_BASE + NMITV_FCOUNT_SIZE + NMITV_FTYPE_SIZE) |
number of bytes in vector field header (fid, ftype, count, vtype)
Definition at line 237 of file netmsgs.h.
Referenced by nmPackITVHdrVector(), and nmUnpackITVVector().
| #define NMITV_MSGHDR_SIZE (NMITV_MSGID_SIZE + NMITV_FCOUNT_SIZE) |
message leading number of bytes for message header (msgid, fcount)
Definition at line 222 of file netmsgs.h.
Referenced by nmGetITVMsgId(), nmPackITVMsg(), nmPackITVMsgDebug(), nmUnpackITVMsg(), and nmUnpackITVMsgDebug().
| #define NMITV_MSGID_SIZE 2 |
| typedef const struct _nm_field_def_struct* NMFieldDef_P |
| typedef struct _nm_field_def_struct NMFieldDef_T |
Message Field Definition Type
| typedef NMMsgDef_P NMFieldThisStruct_T |
| typedef struct _nm_msg_def_struct NMMsgDef_T |
Message Definition Type
| enum NMEncoding_T |
| enum NMEndian_T |
| enum NMFType_T |
Message Field Type Code Enumeration
Definition at line 110 of file netmsgs.h.
| const NMFieldDef_T* nmFindFieldDef | ( | const NMMsgDef_T * | pMsgDef, |
| byte_t | byFId | ||
| ) |
Find the field definition in the message definition, given the field id.
| pMsgDef | Pointer to message definition. |
| byFId | Field Id. |
Definition at line 235 of file nmLibUtils.c.
References _nm_field_def_struct::m_eFId, _nm_msg_def_struct::m_pFields, and _nm_msg_def_struct::m_uCount.
Referenced by nmUnpackITVStream().
| size_t nmGetFieldValSize | ( | NMFType_T | eFType | ) |
Get the field value byte size.
| eFType | Field type. |
Definition at line 209 of file nmLibUtils.c.
References NMFValLenLookupTbl, NMHashFType(), and NMHashNoIdx.
| 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().
| INLINE_IN_H int nmPackBool | ( | bool_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a boolean value into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 564 of file netmsgs.h.
References nmPackU8().
Referenced by nmPackFlatBool(), and nmPackITVBool().
| int nmPackBuf | ( | byte_t | bufSrc[], |
| size_t | uCount, | ||
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a byte buffer into the message buffer.
The source and message buffer memory areas can overlap.
| [in] | bufSrc | Source buffer. |
| uCount | Number of bytes to copy. | |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 1215 of file nmLibPack.c.
References _NM_CHK_MEM.
| INLINE_IN_H int nmPackByte | ( | byte_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a one byte value into the message buffer.
Alias for nmPackU8().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 526 of file netmsgs.h.
References nmPackU8().
| INLINE_IN_H int nmPackChar | ( | char | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a 8-bit ASCII character into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 552 of file netmsgs.h.
References nmPackU8().
| int nmPackF32 | ( | float | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a 32-bit float into the message buffer.
The IEEE 754 32-bit format is used with both the big and little endian byte orders.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 957 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, IEEE754_F32_EXPONENT_MASK, IEEE754_F32_EXPONENT_SHIFT, IEEE754_F32_MANTISSA_MASK, IEEE754_F32_MANTISSA_SHIFT, IEEE754_F32_SIGN_MASK, IEEE754_F32_SIGN_SHIFT, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_F32, PACKBIG, PACKLITTLE, and PACKNATIVE.
Referenced by nmPackFlatF32(), and nmPackITVF32().
| int nmPackF64 | ( | double | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a 64-bit float into the message buffer.
The IEEE 754 64-bit format is used with both the big and little endian byte orders. If the machine architecture only supports 32-bit doubles, then a conversion to 64-bit representation is performed first.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 1013 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, IEEE754_F32_F64_MANTISSA0_SHIFT, IEEE754_F32_F64_MANTISSA1_MASK, IEEE754_F32_F64_MANTISSA1_SHIFT, ieee754_f32_is_inf(), ieee754_f32_is_nan(), ieee754_f32_is_zero(), IEEE754_F64_EXPONENT_MASK, IEEE754_F64_EXPONENT_SHIFT, IEEE754_F64_Inf, IEEE754_F64_MANTISSA0_MASK, IEEE754_F64_MANTISSA0_SHIFT, IEEE754_F64_MANTISSA1_MASK, IEEE754_F64_MANTISSA1_SHIFT, IEEE754_F64_NaN, IEEE754_F64_SIGN_MASK, IEEE754_F64_SIGN_SHIFT, IEEE754_F64_Zero, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_F32, NMFVAL_LEN_F64, PACK64BIG, PACK64LITTLE, and PACK64NATIVE.
Referenced by nmPackFlatF64(), and nmPackITVF64().
| int nmPackFlatMsg | ( | const NMMsgDef_T * | pMsgDef, |
| void * | pStruct, | ||
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an Flat 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 1417 of file nmLibPackFlat.c.
References NMCtl_T::m_bNoHdr, NMCTL_INIT_DECL, and nmPackFlatStream().
Referenced by nmUnpackPointer().
| int nmPackFlatMsgDebug | ( | const NMMsgDef_T * | pMsgDef, |
| void * | pStruct, | ||
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an Flat 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 1446 of file nmLibPackFlat.c.
References NMCtl_T::m_bNoHdr, NMCtl_T::m_bTrace, _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_sMsgName, _nm_msg_def_struct::m_uCount, NMCTL_INIT_DECL, nmPackFlatStream(), and nmPrintBuf().
Referenced by nmUnpackPointer().
| INLINE_IN_H int nmPackInt | ( | int | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an signed int integer into the message buffer.
Alias for nmPackS32().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 621 of file netmsgs.h.
References nmPackU32().
| 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().
| INLINE_IN_H int nmPackLong | ( | long | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an signed long integer into the message buffer.
Alias for nmPackS32() or nmPackS64() depending on sizeof(long).
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 651 of file netmsgs.h.
References nmPackS32(), and nmPackS64().
| INLINE_IN_H int nmPackLongLong | ( | long long | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an signed long long integer into the message buffer.
Alias for nmPackS64().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 681 of file netmsgs.h.
References nmPackS64().
| int nmPackP32 | ( | void * | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a 32-bit pointer into the message buffer.
If the machine architecture has 64-bit pointers, then only the LSB 4 bytes are packed.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 1113 of file nmLibPack.c.
References _NM_CHK_MEM, NMFVAL_LEN_P32, NMFVAL_LEN_P64, NMLIB_WARNING, and PACKNATIVE.
Referenced by nmPackFlatP32(), nmPackITVP32(), and nmPackPointer().
| int nmPackP64 | ( | void * | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a 64-bit pointer into the message buffer.
If the machine architecture only supports 32-bit pointers, then the 4 MSBs are padded with 0's.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 1160 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, NMFVAL_LEN_P32, NMFVAL_LEN_P64, and PACK64NATIVE.
Referenced by nmPackFlatP64(), nmPackITVP64(), and nmPackPointer().
| INLINE_IN_H int nmPackPointer | ( | void * | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a (overloaded) void* pointer into the message buffer.
Alias for nmPackP32() or nmPackP64() depending on sizeof(void*).
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 697 of file netmsgs.h.
References nmPackP32(), nmPackP64(), nmUnpackBuf(), nmUnpackF32(), nmUnpackF64(), nmUnpackP32(), nmUnpackP64(), nmUnpackS64(), nmUnpackU16(), nmUnpackU32(), nmUnpackU64(), and nmUnpackU8().
| INLINE_IN_H int nmPackS16 | ( | short | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a signed 16-bit integer into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 500 of file netmsgs.h.
References nmPackU16().
Referenced by nmPackFlatS16(), and nmPackITVS16().
| INLINE_IN_H int nmPackS32 | ( | int | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a signed 32-bit integer into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 512 of file netmsgs.h.
References nmPackU32().
Referenced by nmPackFlatS32(), nmPackITVS32(), and nmPackLong().
| int nmPackS64 | ( | long long | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an signed 64-bit integer into the message buffer.
If the machine architecture only supports 32-bit long longs, then the 4 MSBs are signed extended.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 885 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_S32, NMFVAL_LEN_S64, PACK64BIG, PACK64LITTLE, PACK64NATIVE, PACKBIG, PACKLITTLE, and PACKNATIVE.
Referenced by nmPackFlatS64(), nmPackITVS64(), nmPackLong(), and nmPackLongLong().
| INLINE_IN_H int nmPackS8 | ( | signed char | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a signed 8-bit byte into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 488 of file netmsgs.h.
References nmPackU8().
Referenced by nmPackFlatS8(), and nmPackITVS8().
| INLINE_IN_H int nmPackSChar | ( | signed char | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack a signed char integer value into the message buffer.
Alias for nmPackS8().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 540 of file netmsgs.h.
References nmPackU8().
| INLINE_IN_H int nmPackShort | ( | short | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an signed short integer into the message buffer.
Alias for nmPackS16().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 593 of file netmsgs.h.
References nmPackU16().
| int nmPackU16 | ( | ushort_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned 16-bit integer into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 762 of file nmLibPack.c.
References _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_U16, PACKBIG, PACKLITTLE, and PACKNATIVE.
Referenced by nmPackFlatU16(), nmPackITVMsg(), nmPackITVMsgDebug(), nmPackITVU16(), nmPackS16(), nmPackShort(), and nmPackUShort().
| int nmPackU32 | ( | uint_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned 32-bit integer into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 791 of file nmLibPack.c.
References _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_U32, PACKBIG, PACKLITTLE, and PACKNATIVE.
Referenced by nmPackFlatU32(), nmPackInt(), nmPackITVU32(), nmPackS32(), nmPackUInt(), and nmPackULong().
| int nmPackU64 | ( | ulonglong_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned 64-bit integer into the message buffer.
If the machine architecture only supports 32-bit long longs, then the 4 MSBs are padded with zero's.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 823 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_U32, NMFVAL_LEN_U64, PACK64BIG, PACK64LITTLE, PACK64NATIVE, PACKBIG, PACKLITTLE, and PACKNATIVE.
Referenced by nmPackFlatU64(), nmPackITVU64(), nmPackULong(), and nmPackULongLong().
| int nmPackU8 | ( | byte_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned 8-bit byte into the message buffer.
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 745 of file nmLibPack.c.
References _NM_CHK_MEM, and NMFVAL_LEN_U8.
Referenced by nmPackBool(), nmPackByte(), nmPackChar(), nmPackFlatU8(), nmPackITVU8(), nmPackS8(), and nmPackSChar().
| INLINE_IN_H int nmPackUInt | ( | uint_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned int integer into the message buffer.
Alias for nmPackU32().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 607 of file netmsgs.h.
References nmPackU32().
| INLINE_IN_H int nmPackULong | ( | ulong_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned long integer into the message buffer.
Alias for nmPackU32() or nmPackU64() depending on sizeof(ulong_t).
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 635 of file netmsgs.h.
References nmPackU32(), and nmPackU64().
| INLINE_IN_H int nmPackULongLong | ( | ulonglong_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned long long integer into the message buffer.
Alias for nmPackU64().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 667 of file netmsgs.h.
References nmPackU64().
| INLINE_IN_H int nmPackUShort | ( | ushort_t | val, |
| byte_t | buf[], | ||
| size_t | bufSize, | ||
| NMEndian_T | eEndian | ||
| ) |
Pack an unsigned short integer into the message buffer.
Alias for nmPackU16().
| [in] | val | Value to pack. |
| [out] | buf | Output message buffer. |
| bufSize | Size of output buffer. | |
| eEndian | Packing order. See NMEndian_T. |
Definition at line 579 of file netmsgs.h.
References nmPackU16().
| void nmPrintBits | ( | FILE * | fp, |
| const char * | sPreface, | ||
| ulonglong_t | uVal, | ||
| uint_t | uMsb, | ||
| uint_t | uCnt | ||
| ) |
Pretty print bits in value.
| fp | File pointer. |
| sPreface | Optional bit preface string (set to NULL for no preface). |
| uVal | Bits to print. |
| uMsb | Starting most significant bit. |
| uCnt | Number of bits. |
Definition at line 174 of file nmLibUtils.c.
| void nmPrintBuf | ( | FILE * | fp, |
| const char * | sPreface, | ||
| byte_t | buf[], | ||
| size_t | uCount, | ||
| size_t | uNLFreq, | ||
| uint_t | uCol | ||
| ) |
Pretty print buffer to opened file stream.
| fp | File pointer. |
| sPreface | Optional buffer preface string (set to NULL for no preface). |
| buf | Buffer to print. |
| uCount | Number of bytes to print. |
| uNLFreq | Newline frequency (set to 0 for no newlines). |
| uCol | Column alignment number. |
Definition at line 138 of file nmLibUtils.c.
Referenced by nmPackFlatMsgDebug(), nmPackITVMsgDebug(), nmTraceField(), nmUnpackFlatMsgDebug(), and nmUnpackITVMsgDebug().
| const char* nmStrError | ( | int | ecode | ) |
Get the error string describing the BotSense error code.
The absolute value of the error code is taken prior retrieving the string. An unknown or out-of-range error code will be mapped to NM_ECODE_BADEC.
| ecode | BotSense error code. |
Definition at line 114 of file nmLibUtils.c.
References NM_ECODE_BADEC, and nmEcodeStrTbl.
| INLINE_IN_H int nmUnpackBool | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| bool_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a boolean value from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 823 of file netmsgs.h.
References nmUnpackU8().
Referenced by nmUnpackFlatBool(), and nmUnpackITVBool().
| int nmUnpackBuf | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| byte_t | bufDst[], | ||
| size_t | uCount, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a byte buffer from the message buffer.
The source and message buffer memory areas can overlap.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | bufDst | Destination output buffer. |
| uCount | Number of bytes to copy. | |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1735 of file nmLibPack.c.
References _NM_CHK_MEM.
Referenced by nmPackPointer().
| INLINE_IN_H int nmUnpackByte | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| byte_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack one byte from the message buffer.
Alias for nmUnpackU8().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 785 of file netmsgs.h.
References nmUnpackU8().
| INLINE_IN_H int nmUnpackChar | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| char * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an 8-bit ASCII character from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 811 of file netmsgs.h.
References nmUnpackU8().
| int nmUnpackF32 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| float * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a 32-bit float from the message buffer.
The IEEE 754 32-bit format is used with both the big and little endian byte orders.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1472 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_F32, UNPACKBIG, UNPACKLITTLE, and UNPACKNATIVE.
Referenced by nmPackPointer(), nmUnpackFlatF32(), and nmUnpackITVF32().
| int nmUnpackF64 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| double * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a 64-bit float from the message buffer.
The IEEE 754 64-bit format is used with both the big and little endian byte orders. If the machine architecture only supports 32-bit doubles, then mantissa truncation will occur.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1517 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, IEEE754_F32_EXP_MAX, IEEE754_F32_EXP_MIN, IEEE754_F32_F64_MANTISSA0_SHIFT, IEEE754_F32_F64_MANTISSA1_MASK, IEEE754_F32_F64_MANTISSA1_SHIFT, IEEE754_F32_Inf, IEEE754_F32_MANTISSA_MASK, IEEE754_F32_NaN, IEEE754_F32_Zero, IEEE754_F64_EXPONENT_MASK, IEEE754_F64_EXPONENT_SHIFT, ieee754_f64_is_inf(), ieee754_f64_is_nan(), ieee754_f64_is_zero(), IEEE754_F64_MANTISSA0_MASK, IEEE754_F64_MANTISSA0_SHIFT, IEEE754_F64_MANTISSA1_MASK, IEEE754_F64_MANTISSA1_SHIFT, IEEE754_F64_SIGN_MASK, IEEE754_F64_SIGN_SHIFT, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_F32, NMFVAL_LEN_F64, NMLIB_WARNING, UNPACK64BIG, UNPACK64LITTLE, UNPACK64NATIVE, UNPACKBIG, UNPACKLITTLE, and UNPACKNATIVE.
Referenced by nmPackPointer(), nmUnpackFlatF64(), and nmUnpackITVF64().
| int nmUnpackFlatMsg | ( | const NMMsgDef_T * | pMsgDef, |
| byte_t | buf[], | ||
| size_t | uMsgLen, | ||
| void * | pStruct, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a Flat 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 1490 of file nmLibPackFlat.c.
References NMCtl_T::m_bNoHdr, NMCTL_INIT_DECL, and nmUnpackFlatStream().
Referenced by nmUnpackPointer().
| int nmUnpackFlatMsgDebug | ( | const NMMsgDef_T * | pMsgDef, |
| byte_t | buf[], | ||
| size_t | uMsgLen, | ||
| void * | pStruct, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a Flat 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 1520 of file nmLibPackFlat.c.
References NMCtl_T::m_bNoHdr, NMCtl_T::m_bTrace, _nm_msg_def_struct::m_eMsgId, _nm_msg_def_struct::m_sMsgName, _nm_msg_def_struct::m_uCount, NMCTL_INIT_DECL, nmPrintBuf(), and nmUnpackFlatStream().
Referenced by nmUnpackPointer().
| INLINE_IN_H int nmUnpackInt | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| int * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an signed int integer from the message buffer.
Alias for nmUnpackS32().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 880 of file netmsgs.h.
References nmUnpackU32().
| 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().
| INLINE_IN_H int nmUnpackLong | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| long * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an signed long integer from the message buffer.
Alias for nmUnpackS32() or nmUnpackS64() depending on sizeof(long).
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 910 of file netmsgs.h.
References nmUnpackS32(), and nmUnpackS64().
| INLINE_IN_H int nmUnpackLongLong | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| long long * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an signed long long integer from the message buffer.
Alias for nmUnpackS64().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 940 of file netmsgs.h.
References nmUnpackS64().
| int nmUnpackP32 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| void * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a 32-bit pointer from the message buffer.
If the machine architecture has 64-bit pointers, then only the LSB 4 bytes are packed.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1648 of file nmLibPack.c.
References _NM_CHK_MEM, NMFVAL_LEN_P32, and UNPACKNATIVE.
Referenced by nmPackPointer(), nmUnpackFlatP32(), nmUnpackITVP32(), and nmUnpackPointer().
| int nmUnpackP64 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| void * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a 64-bit pointer from the message buffer.
If the machine architecture only supports 32-bit pointers, then the 4 MSBs are padded with 0's.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1678 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, NMFVAL_LEN_P32, NMFVAL_LEN_P64, NMLIB_WARNING, and UNPACK64NATIVE.
Referenced by nmPackPointer(), nmUnpackFlatP64(), nmUnpackITVP64(), and nmUnpackPointer().
| INLINE_IN_H int nmUnpackPointer | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| void * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a (overloaded)void* pointer from the message buffer.
Alias for nmUnpackP32() or nmUnpackP64() depending on sizeof(void*).
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 956 of file netmsgs.h.
References NMEndianNative, nmGetITVMsgId(), nmPackFlatMsg(), nmPackFlatMsgDebug(), nmPackITVMsg(), nmPackITVMsgDebug(), nmUnpackFlatMsg(), nmUnpackFlatMsgDebug(), nmUnpackITVMsg(), nmUnpackITVMsgDebug(), nmUnpackP32(), and nmUnpackP64().
| INLINE_IN_H int nmUnpackS16 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| short * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a signed 16-bit integer from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 759 of file netmsgs.h.
References nmUnpackU16().
Referenced by nmUnpackFlatS16(), and nmUnpackITVS16().
| INLINE_IN_H int nmUnpackS32 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| int * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a signed 32-bit integer from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 771 of file netmsgs.h.
References nmUnpackU32().
Referenced by nmUnpackFlatS32(), nmUnpackITVS32(), and nmUnpackLong().
| int nmUnpackS64 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| long long * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an signed 64-bit integer from the message buffer.
If the machine architecture only supports 32-bit long longs, then the 4 MSBs are truncated.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1391 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_S32, NMFVAL_LEN_S64, NMLIB_WARNING, UNPACK64BIG, UNPACK64LITTLE, UNPACK64NATIVE, UNPACKBIG, UNPACKLITTLE, and UNPACKNATIVE.
Referenced by nmPackPointer(), nmUnpackFlatS64(), nmUnpackITVS64(), nmUnpackLong(), and nmUnpackLongLong().
| INLINE_IN_H int nmUnpackS8 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| signed char * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack a signed 8-bit byte from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 747 of file netmsgs.h.
References nmUnpackU8().
Referenced by nmUnpackFlatS8(), and nmUnpackITVS8().
| INLINE_IN_H int nmUnpackSChar | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| signed char * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an signed short integer from the message buffer.
Alias for nmUnpackS8().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 799 of file netmsgs.h.
References nmUnpackU8().
| INLINE_IN_H int nmUnpackShort | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| short * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an signed short integer from the message buffer.
Alias for nmUnpackS16().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 852 of file netmsgs.h.
References nmUnpackU16().
| int nmUnpackU16 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| ushort_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned 16-bit integer from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1256 of file nmLibPack.c.
References _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_U16, UNPACKBIG, UNPACKLITTLE, and UNPACKNATIVE.
Referenced by nmGetITVMsgId(), nmPackPointer(), nmUnpackFlatU16(), nmUnpackITVMsg(), nmUnpackITVMsgDebug(), nmUnpackITVU16(), nmUnpackS16(), nmUnpackShort(), and nmUnpackUShort().
| int nmUnpackU32 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| uint_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned 32-bit integer from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1288 of file nmLibPack.c.
References _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_U32, UNPACKBIG, UNPACKLITTLE, and UNPACKNATIVE.
Referenced by nmPackPointer(), nmUnpackFlatU32(), nmUnpackInt(), nmUnpackITVU32(), nmUnpackS32(), nmUnpackUInt(), and nmUnpackULong().
| int nmUnpackU64 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| ulonglong_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned 64-bit integer from the message buffer.
If the machine architecture only supports 32-bit unsigned long longs, then the 4 MSBs are truncated.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1320 of file nmLibPack.c.
References _NM_CHK_ARCH, _NM_CHK_MEM, NMEndianBig, NMEndianLittle, NMEndianNative, NMFVAL_LEN_U32, NMFVAL_LEN_U64, NMLIB_WARNING, UNPACK64BIG, UNPACK64LITTLE, UNPACK64NATIVE, UNPACKBIG, UNPACKLITTLE, and UNPACKNATIVE.
Referenced by nmPackPointer(), nmUnpackFlatU64(), nmUnpackITVU64(), nmUnpackULong(), and nmUnpackULongLong().
| int nmUnpackU8 | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| byte_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned 8-bit byte from the message buffer.
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 1239 of file nmLibPack.c.
References _NM_CHK_MEM, and NMFVAL_LEN_U8.
Referenced by nmPackPointer(), nmUnpackBool(), nmUnpackByte(), nmUnpackChar(), nmUnpackFlatU8(), nmUnpackITVU8(), nmUnpackS8(), and nmUnpackSChar().
| INLINE_IN_H int nmUnpackUInt | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| uint_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned int integer from the message buffer.
Alias for nmUnpackU32().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 866 of file netmsgs.h.
References nmUnpackU32().
| INLINE_IN_H int nmUnpackULong | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| ulong_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned long integer from the message buffer.
Alias for nmUnpackU32() or nmUnpackU64() depending on sizeof(ulong_t).
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 894 of file netmsgs.h.
References nmUnpackU32(), and nmUnpackU64().
| INLINE_IN_H int nmUnpackULongLong | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| ulonglong_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned long long integer from the message buffer.
Alias for nmUnpackU64().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 926 of file netmsgs.h.
References nmUnpackU64().
| INLINE_IN_H int nmUnpackUShort | ( | byte_t | buf[], |
| size_t | bufSize, | ||
| ushort_t * | pVal, | ||
| NMEndian_T | eEndian | ||
| ) |
Unpack an unsigned short integer from the message buffer.
Alias for nmUnpackU16().
| [in] | buf | Input message buffer. |
| bufSize | Size of input buffer. | |
| [out] | pVal | Pointer to value to unpack (set). |
| eEndian | Unpacking order. See NMEndian_T. |
Definition at line 838 of file netmsgs.h.
References nmUnpackU16().