Ported fixes and improvements from Wireshark for RLC/MAC control block decoding. Part 1.
Generic improvements to the csn.1 dissector include: • Added a flag to the type descriptor structure so that any type can (potentially) flagged as xxx_OR_NULL. This was specifically needed for UINT_OR_NULL for the ms capabilities struct. • Changed the CSN_SERIALIZE so that the length of the length field can be specified. • For CSN_NEXT_EXIST removed the requirement that the next type be CSN_END, to allow truncation of multiple IEs. • For CSN_LEFT_ALIGNED_VAR_BITMAP corrected the handling of bit_offset. • Added a new type CSN_PADDING_BITS to make inspection of padding bits more convenient. • Improved the CSN_RECURSIVE_TARRAY_1 to show the array index. Improvements to the gsm_rlcmac dissector include: • Rework the definition of EGPRS Ack/Nack Description so that the length IE (and absence thereof) is handled correctly. • Added Padding Bits definitions to all PDUs • Change the Multislot_capability_t and Content_t definitions to allow truncation at any IE
This commit is contained in:
parent
9eb552b239
commit
701d9f83f8
157
src/csn1.cpp
157
src/csn1.cpp
|
@ -206,6 +206,12 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig
|
|||
LOGPC(DCSN1, LOGL_NOTICE, "%s = %u | ", pDescr->sz , (unsigned)*pui8);
|
||||
/* end add the bit value to protocol tree */
|
||||
}
|
||||
else if(pDescr->may_be_null)
|
||||
{
|
||||
pui8 = pui8DATA(data, pDescr->offset);
|
||||
*pui8 = 0;
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s = NULL | ", pDescr->sz);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ProcessError(readIndex,"csnStreamDecoder", CSN_ERROR_NEED_MORE_BITS_TO_UNPACK, pDescr);
|
||||
|
@ -254,14 +260,33 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig
|
|||
{
|
||||
return ProcessError(readIndex,"csnStreamDecoder", CSN_ERROR_GENERAL, pDescr);
|
||||
}
|
||||
remaining_bits_len -= no_of_bits;
|
||||
bit_offset += no_of_bits;
|
||||
}
|
||||
else if(pDescr->may_be_null)
|
||||
{
|
||||
if (no_of_bits <= 8)
|
||||
{
|
||||
pui8 = pui8DATA(data, pDescr->offset);
|
||||
*pui8 = 0;
|
||||
}
|
||||
else if (no_of_bits <= 16)
|
||||
{
|
||||
pui16 = pui16DATA(data, pDescr->offset);
|
||||
*pui16 = 0;
|
||||
}
|
||||
else if (no_of_bits <= 32)
|
||||
{
|
||||
pui32 = pui32DATA(data, pDescr->offset);
|
||||
*pui32 = 0;
|
||||
}
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s = NULL | ", pDescr->sz);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ProcessError(readIndex,"csnStreamDecoder", CSN_ERROR_NEED_MORE_BITS_TO_UNPACK, pDescr);
|
||||
}
|
||||
|
||||
remaining_bits_len -= no_of_bits;
|
||||
bit_offset += no_of_bits;
|
||||
pDescr++;
|
||||
break;
|
||||
}
|
||||
|
@ -548,20 +573,23 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig
|
|||
{
|
||||
StreamSerializeFcn_t serialize = pDescr->serialize.fcn;
|
||||
csnStream_t arT = *ar;
|
||||
guint8 length_len = pDescr->i;
|
||||
gint16 Status = -1;
|
||||
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s length = %d | ", pDescr->sz , (int)bitvec_read_field(vector, readIndex, 7));
|
||||
arT.direction = 1;
|
||||
bit_offset += 7;
|
||||
remaining_bits_len -= 7;
|
||||
guint8 length = bitvec_read_field(vector, readIndex, length_len);
|
||||
|
||||
csnStreamInit(&arT, bit_offset, remaining_bits_len);
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s length = %d | ", pDescr->sz , (int)length);
|
||||
arT.direction = 1;
|
||||
bit_offset += length_len;
|
||||
remaining_bits_len -= length_len;
|
||||
|
||||
csnStreamInit(&arT, bit_offset, length);
|
||||
Status = serialize(&arT, vector, readIndex, pvDATA(data, pDescr->offset));
|
||||
|
||||
if (Status >= 0)
|
||||
{
|
||||
remaining_bits_len = arT.remaining_bits_len;
|
||||
bit_offset = arT.bit_offset;
|
||||
remaining_bits_len -= length;
|
||||
bit_offset += length;
|
||||
pDescr++;
|
||||
}
|
||||
else
|
||||
|
@ -958,18 +986,12 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig
|
|||
pui8 = pui8DATA(data, pDescr->offset);
|
||||
|
||||
/* this if-statement represents the M_NEXT_EXIST_OR_NULL description element */
|
||||
if ((pDescr->descr.ptr != NULL) && (remaining_bits_len == 0))
|
||||
if ((pDescr->may_be_null) && (remaining_bits_len == 0))
|
||||
{ /* no more bits to decode is fine here - end of message detected and allowed */
|
||||
|
||||
/* Skip i entries + this entry */
|
||||
pDescr += pDescr->i + 1;
|
||||
|
||||
/* pDescr now must be pointing to a CSN_END entry, if not this is an error */
|
||||
if ( pDescr->type != CSN_END )
|
||||
{ /* Substract one more bit from remaining_bits_len to make the "not enough bits" error to be triggered */
|
||||
remaining_bits_len--;
|
||||
}
|
||||
|
||||
/* Set the data member to "not exist" */
|
||||
*pui8 = 0;
|
||||
break;
|
||||
|
@ -1147,6 +1169,38 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector, unsig
|
|||
break;
|
||||
}
|
||||
|
||||
case CSN_PADDING_BITS:
|
||||
{ /* Padding from here and to the end of message */
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s = ", pDescr->sz);
|
||||
if (remaining_bits_len > 0)
|
||||
{
|
||||
while (remaining_bits_len > 0)
|
||||
{
|
||||
guint8 bits_to_handle = remaining_bits_len%8;
|
||||
if (bits_to_handle > 0)
|
||||
{
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%u|", bitvec_read_field(vector, readIndex, bits_to_handle));
|
||||
remaining_bits_len -= bits_to_handle;
|
||||
bit_offset += bits_to_handle;
|
||||
}
|
||||
else if (bits_to_handle == 0)
|
||||
{
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%u|", bitvec_read_field(vector, readIndex, 8));
|
||||
remaining_bits_len -= 8;
|
||||
bit_offset += 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (remaining_bits_len < 0)
|
||||
{
|
||||
return ProcessError(readIndex,"csnStreamDissector", CSN_ERROR_NEED_MORE_BITS_TO_UNPACK, pDescr);
|
||||
}
|
||||
|
||||
/* Padding was successfully extracted or it was empty */
|
||||
pDescr++;
|
||||
break;
|
||||
}
|
||||
|
||||
case CSN_VARIABLE_ARRAY:
|
||||
{ /* {int type; int i; void* descr; int offset; const char* sz; } CSN_DESCR;
|
||||
* {CSN_VARIABLE_ARRAY, _OFFSET, (void*)offsetof(_STRUCT, _ElementCountField), offsetof(_STRUCT, _MEMBER), #_MEMBER}
|
||||
|
@ -1434,6 +1488,10 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
LOGPC(DCSN1, LOGL_NOTICE, "%s = %u | ", pDescr->sz , (unsigned)*pui8);
|
||||
/* end add the bit value to protocol tree */
|
||||
}
|
||||
else if(pDescr->may_be_null)
|
||||
{
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s = NULL | ", pDescr->sz);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ProcessError(writeIndex,"csnStreamEncoder", CSN_ERROR_NEED_MORE_BITS_TO_UNPACK, pDescr);
|
||||
|
@ -1479,14 +1537,19 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
{
|
||||
return ProcessError(writeIndex,"csnStreamEncoder", CSN_ERROR_GENERAL, pDescr);
|
||||
}
|
||||
|
||||
remaining_bits_len -= no_of_bits;
|
||||
bit_offset += no_of_bits;
|
||||
}
|
||||
else if(pDescr->may_be_null)
|
||||
{
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s = NULL | ", pDescr->sz);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ProcessError(writeIndex,"csnStreamEncoder", CSN_ERROR_NEED_MORE_BITS_TO_UNPACK, pDescr);
|
||||
}
|
||||
|
||||
remaining_bits_len -= no_of_bits;
|
||||
bit_offset += no_of_bits;
|
||||
pDescr++;
|
||||
break;
|
||||
}
|
||||
|
@ -1766,19 +1829,20 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
{
|
||||
StreamSerializeFcn_t serialize = pDescr->serialize.fcn;
|
||||
csnStream_t arT = *ar;
|
||||
guint8 length_len = pDescr->i;
|
||||
gint16 Status = -1;
|
||||
unsigned lengthIndex;
|
||||
|
||||
// store writeIndex for length value (7 bit)
|
||||
lengthIndex = writeIndex;
|
||||
writeIndex += 7;
|
||||
bit_offset += 7;
|
||||
remaining_bits_len -= 7;
|
||||
lengthIndex = writeIndex;
|
||||
writeIndex += length_len;
|
||||
bit_offset += length_len;
|
||||
remaining_bits_len -= length_len;
|
||||
arT.direction = 0;
|
||||
csnStreamInit(&arT, bit_offset, remaining_bits_len);
|
||||
Status = serialize(&arT, vector, writeIndex, pvDATA(data, pDescr->offset));
|
||||
|
||||
bitvec_write_field(vector, lengthIndex, writeIndex-lengthIndex-7, 7);
|
||||
|
||||
bitvec_write_field(vector, lengthIndex, writeIndex-lengthIndex-length_len, length_len);
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s length = %u | ", pDescr->sz , (unsigned)(writeIndex-lengthIndex));
|
||||
|
||||
if (Status >= 0)
|
||||
|
@ -2179,18 +2243,12 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
pui8 = pui8DATA(data, pDescr->offset);
|
||||
|
||||
/* this if-statement represents the M_NEXT_EXIST_OR_NULL description element */
|
||||
if ((pDescr->descr.ptr != NULL) && (remaining_bits_len == 0))
|
||||
if ((pDescr->may_be_null) && (remaining_bits_len == 0))
|
||||
{ /* no more bits to decode is fine here - end of message detected and allowed */
|
||||
|
||||
/* Skip i entries + this entry */
|
||||
pDescr += pDescr->i + 1;
|
||||
|
||||
/* pDescr now must be pointing to a CSN_END entry, if not this is an error */
|
||||
if ( pDescr->type != CSN_END )
|
||||
{ /* Substract one more bit from remaining_bits_len to make the "not enough bits" error to be triggered */
|
||||
remaining_bits_len--;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2365,6 +2423,42 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
break;
|
||||
}
|
||||
|
||||
case CSN_PADDING_BITS:
|
||||
{ /* Padding from here and to the end of message */
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%s = ", pDescr->sz);
|
||||
guint8 filler = 0x2b;
|
||||
if (remaining_bits_len > 0)
|
||||
{
|
||||
while (remaining_bits_len > 0)
|
||||
{
|
||||
guint8 bits_to_handle = remaining_bits_len%8;
|
||||
if (bits_to_handle > 0)
|
||||
{
|
||||
guint8 fl = filler&(0xff>>(8-bits_to_handle));
|
||||
bitvec_write_field(vector, writeIndex, fl, bits_to_handle);
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%u|", fl);
|
||||
remaining_bits_len -= bits_to_handle;
|
||||
bit_offset += bits_to_handle;
|
||||
}
|
||||
else if (bits_to_handle == 0)
|
||||
{
|
||||
bitvec_write_field(vector, writeIndex, filler, 8);
|
||||
LOGPC(DCSN1, LOGL_NOTICE, "%u|", filler);
|
||||
remaining_bits_len -= 8;
|
||||
bit_offset += 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (remaining_bits_len < 0)
|
||||
{
|
||||
return ProcessError(writeIndex,"csnStreamDissector", CSN_ERROR_NEED_MORE_BITS_TO_UNPACK, pDescr);
|
||||
}
|
||||
|
||||
/* Padding was successfully extracted or it was empty */
|
||||
pDescr++;
|
||||
break;
|
||||
}
|
||||
|
||||
case CSN_VARIABLE_ARRAY:
|
||||
{ /* {int type; int i; void* descr; int offset; const char* sz; } CSN_DESCR;
|
||||
* {CSN_VARIABLE_ARRAY, _OFFSET, (void*)offsetof(_STRUCT, _ElementCountField), offsetof(_STRUCT, _MEMBER), #_MEMBER}
|
||||
|
@ -2555,6 +2649,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
}
|
||||
bitvec_write_field(vector, writeIndex, !Tag, 1);
|
||||
bit_offset++;
|
||||
remaining_bits_len--;
|
||||
Tag = STANDARD_TAG; /* in case it was set to "reversed" */
|
||||
pDescr++;
|
||||
break;
|
||||
|
|
108
src/csn1.h
108
src/csn1.h
|
@ -49,6 +49,7 @@
|
|||
#define CSN_ERROR_ -10
|
||||
|
||||
#define FALSE (0)
|
||||
#define TRUE (1)
|
||||
typedef signed int gint32;
|
||||
typedef signed short gint16;
|
||||
typedef int gint;
|
||||
|
@ -99,6 +100,7 @@ typedef enum
|
|||
CSN_VARIABLE_BITMAP_1, /* <bitmap: bit**> i.e. to the end of message (R99) */
|
||||
CSN_LEFT_ALIGNED_VAR_BMP, /* As variable bitmap but the result is left aligned (R99) */
|
||||
CSN_LEFT_ALIGNED_VAR_BMP_1,/* As above only size is to the end of message (R99) */
|
||||
CSN_PADDING_BITS, /* Padding bits fill to the end of the buffer */
|
||||
CSN_VARIABLE_ARRAY, /* Array with length specified in parameter: <N: bit(4)> <list: octet(N + offset)> */
|
||||
CSN_VARIABLE_TARRAY, /* Type Array with length specified in parameter: <N: bit(x)> <Type>*N */
|
||||
CSN_VARIABLE_TARRAY_OFFSET,/* As above but with offset. The offset is stored as third parameter of CSN_DESCR (descr.value) */
|
||||
|
@ -127,7 +129,7 @@ typedef enum
|
|||
*
|
||||
* i:
|
||||
* Depending on the contents of the type parameter, the parameter "i" may have following meaning:
|
||||
* - specifies the number of bits for the CSN_UINT type
|
||||
* - specifies the number of bits for the CSN_UINT or CSN_UINT_OR_NULL types
|
||||
* - the offset for an array size by which the size is incremented
|
||||
* for the CSN_VAR_ARRAY type
|
||||
* - the length of each element of an array for the CSN_REC_ARRAY type
|
||||
|
@ -142,6 +144,7 @@ typedef enum
|
|||
* CSN_VAR_BITMAP, CSN_LEFT_VAR_BMP, and CSN_LEFT_BMP_1 types
|
||||
* - the offset to param1 for the CSN_CALLBACK type
|
||||
* - ERRORCODE used by the CSN_ERROR type
|
||||
* - the bit-length of the LENGTH field in a CSN_SERIALISE type
|
||||
*
|
||||
* descr
|
||||
* This parameter has different meaning depending on the value of the type parameter:
|
||||
|
@ -167,6 +170,10 @@ typedef enum
|
|||
* - an offset to the variable Exist for CSN_NEXT_EXIST and CSN_NEXT_EXIST_LH types
|
||||
* - an offset to param2 in the CSN_CALLBACK type
|
||||
*
|
||||
* may_be_null
|
||||
* TRUE: if dissection may be attempted at an offset beyond the length of existing data bits
|
||||
* FALSE: othewise
|
||||
*
|
||||
* sz
|
||||
* - is the name of the parameter within the descr where their unpacked or packed value shall be stored or fetched.
|
||||
* This paramater is pointed out by the offset parameter in the same CSN_DESCR variable as the sz.
|
||||
|
@ -188,6 +195,7 @@ typedef struct
|
|||
guint32 value;
|
||||
} descr;
|
||||
unsigned offset;
|
||||
gboolean may_be_null;
|
||||
const char* sz;
|
||||
union
|
||||
{
|
||||
|
@ -232,7 +240,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
CSN_DESCR CSNDESCR_##_STRUCT[] = {
|
||||
|
||||
#define CSN_DESCR_END(_STRUCT)\
|
||||
{CSN_END, 0, {0}, 0, "", {(StreamSerializeFcn_t)0}} };
|
||||
{CSN_END, 0, {0}, 0, FALSE, "", {(StreamSerializeFcn_t)0}} };
|
||||
|
||||
/******************************************************************************
|
||||
* CSN_ERROR(Par1, Par2, Par3)
|
||||
|
@ -243,7 +251,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par3: Error code
|
||||
*****************************************************************************/
|
||||
#define CSN_ERROR(_STRUCT, _Text, _ERRCODE)\
|
||||
{CSN_TRAP_ERROR, _ERRCODE, {(void*)_Text}, 0, _Text, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_TRAP_ERROR, _ERRCODE, {(void*)_Text}, 0, FALSE, _Text, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_BIT(Par1, Par2)
|
||||
|
@ -252,7 +260,17 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par2: C structure element name
|
||||
*****************************************************************************/
|
||||
#define M_BIT(_STRUCT, _MEMBER)\
|
||||
{CSN_BIT, 0, {0}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_BIT, 0, {0}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_BIT_OR_NULL(Par1, Par2)
|
||||
* Similar to the M_BIT except that not only bit 0 or 1 but also the
|
||||
* end of the message may be encountered when looking for the next element in
|
||||
* the message.
|
||||
* Covers the case {null | 0 | 1}
|
||||
*****************************************************************************/
|
||||
#define M_BIT_OR_NULL(_STRUCT, _MEMBER)\
|
||||
{CSN_BIT, 0, {0}, offsetof(_STRUCT, _MEMBER), TRUE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_NEXT_EXIST(Par1, Par2, Par3)
|
||||
|
@ -264,7 +282,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* element(s) does not exist
|
||||
*****************************************************************************/
|
||||
#define M_NEXT_EXIST(_STRUCT, _MEMBER, _NoOfExisting)\
|
||||
{CSN_NEXT_EXIST, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_NEXT_EXIST, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_NEXT_EXIST_LH(Par1, Par2, Par3)
|
||||
|
@ -274,7 +292,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* pattern 0x2B is performed on the read bit before the decision is made.
|
||||
*****************************************************************************/
|
||||
#define M_NEXT_EXIST_LH(_STRUCT, _MEMBER, _NoOfExisting)\
|
||||
{CSN_NEXT_EXIST_LH, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_NEXT_EXIST_LH, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_NEXT_EXIST_OR_NULL(Par1, Par2, Par3)
|
||||
|
@ -284,7 +302,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Covers the case {null | 0 | 1 < IE >}
|
||||
*****************************************************************************/
|
||||
#define M_NEXT_EXIST_OR_NULL(_STRUCT, _MEMBER, _NoOfExisting)\
|
||||
{CSN_NEXT_EXIST, _NoOfExisting, {(void*)1}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_NEXT_EXIST, _NoOfExisting, {(void*)1}, offsetof(_STRUCT, _MEMBER), TRUE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_NEXT_EXIST_OR_NULL_LH(Par1, Par2, Par3)
|
||||
|
@ -294,7 +312,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Covers the case {null | L | H < IE >}
|
||||
*****************************************************************************/
|
||||
#define M_NEXT_EXIST_OR_NULL_LH(_STRUCT, _MEMBER, _NoOfExisting)\
|
||||
{CSN_NEXT_EXIST_LH, _NoOfExisting, {(void*)1}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_NEXT_EXIST_LH, _NoOfExisting, {(void*)1}, offsetof(_STRUCT, _MEMBER), TRUE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_UINT(Par1, Par2, Par3)
|
||||
|
@ -304,7 +322,17 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par3: number of bits used to code the element (between 1 and 32)
|
||||
*****************************************************************************/
|
||||
#define M_UINT(_STRUCT, _MEMBER, _BITS)\
|
||||
{CSN_UINT, _BITS, {(void*)1}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_UINT, _BITS, {(void*)1}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_UINT_OR_NULL(Par1, Par2, Par3)
|
||||
* Similar to the M_UINT except that not only the request set of bits but also the
|
||||
* end of the message may be encountered when looking for the next element in
|
||||
* the message.
|
||||
* Covers the case {null | 0 | 1 < IE >}
|
||||
*****************************************************************************/
|
||||
#define M_UINT_OR_NULL(_STRUCT, _MEMBER, _BITS)\
|
||||
{CSN_UINT, _BITS, {0}, offsetof(_STRUCT, _MEMBER), TRUE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_UINT(Par1, Par2, Par3)
|
||||
|
@ -314,7 +342,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* received CSN.1 message
|
||||
*****************************************************************************/
|
||||
#define M_UINT_LH(_STRUCT, _MEMBER, _BITS)\
|
||||
{CSN_UINT_LH, _BITS, {(void*)1}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_UINT_LH, _BITS, {(void*)1}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_UINT_OFFSET(Par1, Par2, Par3, Par4)
|
||||
|
@ -325,7 +353,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: value added to the returned integer (offset)
|
||||
*****************************************************************************/
|
||||
#define M_UINT_OFFSET(_STRUCT, _MEMBER, _BITS, _OFFSET)\
|
||||
{CSN_UINT_OFFSET, _BITS, {(void*)_OFFSET}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_UINT_OFFSET, _BITS, {(void*)_OFFSET}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_UINT_ARRAY(Par1, Par2, Par3, Par4)
|
||||
|
@ -336,7 +364,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: number of elements in the array (fixed integer value)
|
||||
*****************************************************************************/
|
||||
#define M_UINT_ARRAY(_STRUCT, _MEMBER, _BITS, _ElementCount)\
|
||||
{CSN_UINT_ARRAY, _BITS, {(void*)_ElementCount}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_UINT_ARRAY, _BITS, {(void*)_ElementCount}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_VAR_UINT_ARRAY(Par1, Par2, Par3, Par4)
|
||||
|
@ -348,7 +376,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* structure member holding the length value
|
||||
*****************************************************************************/
|
||||
#define M_VAR_UINT_ARRAY(_STRUCT, _MEMBER, _BITS, _ElementCountField)\
|
||||
{CSN_UINT_ARRAY, _BITS, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)1}}
|
||||
{CSN_UINT_ARRAY, _BITS, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)1}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_VAR_ARRAY(Par1, Par2, Par3, Par4)
|
||||
|
@ -359,7 +387,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: offset that is added to the Par3 to get the actual size of the array
|
||||
*****************************************************************************/
|
||||
#define M_VAR_ARRAY(_STRUCT, _MEMBER, _ElementCountField, _OFFSET)\
|
||||
{CSN_VARIABLE_ARRAY, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_VARIABLE_ARRAY, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_VAR_TARRAY(Par1, Par2, Par3, Par4)
|
||||
|
@ -370,14 +398,14 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: name of the structure member holding the size of the array
|
||||
*****************************************************************************/
|
||||
#define M_VAR_TARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
|
||||
{CSN_VARIABLE_TARRAY, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
{CSN_VARIABLE_TARRAY, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_VAR_TARRAY_OFFSET(Par1, Par2, Par3, Par4)
|
||||
* Same as M_VAR_TARRAY with offset
|
||||
*****************************************************************************/
|
||||
#define M_VAR_TARRAY_OFFSET(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
|
||||
{CSN_VARIABLE_TARRAY_OFFSET, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
{CSN_VARIABLE_TARRAY_OFFSET, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_REC_ARRAY(Par1, Par2, Par3, Par4)
|
||||
|
@ -395,7 +423,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: length of each element in bits
|
||||
*****************************************************************************/
|
||||
#define M_REC_ARRAY(_STRUCT, _MEMBER, _ElementCountField, _BITS)\
|
||||
{CSN_RECURSIVE_ARRAY, _BITS, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_RECURSIVE_ARRAY, _BITS, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_VAR_TYPE_ARRAY(Par1, Par2, Par3, Par4)
|
||||
|
@ -406,7 +434,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: number of elements in the array (fixed integer value)
|
||||
*****************************************************************************/
|
||||
#define M_TYPE_ARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCount)\
|
||||
{CSN_TYPE_ARRAY, _ElementCount, {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
{CSN_TYPE_ARRAY, _ElementCount, {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_REC_TARRAY(Par1, Par2, Par3, Par4)
|
||||
|
@ -418,7 +446,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: will hold the number of element in the array after unpacking
|
||||
*****************************************************************************/
|
||||
#define M_REC_TARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
|
||||
{CSN_RECURSIVE_TARRAY, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
{CSN_RECURSIVE_TARRAY, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_REC_TARRAY1(Par1, Par2, Par3, Par4)
|
||||
|
@ -426,7 +454,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* <list> ::= <type> {1 <type>} ** 0 ;
|
||||
*****************************************************************************/
|
||||
#define M_REC_TARRAY_1(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
|
||||
{CSN_RECURSIVE_TARRAY_1, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
{CSN_RECURSIVE_TARRAY_1, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_REC_TARRAY2(Par1, Par2, Par3, Par4)
|
||||
|
@ -434,7 +462,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* <lists> ::= <type> { 0 <type> } ** 1 ;
|
||||
*****************************************************************************/
|
||||
#define M_REC_TARRAY_2(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
|
||||
{CSN_RECURSIVE_TARRAY_2, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
{CSN_RECURSIVE_TARRAY_2, offsetof(_STRUCT, _ElementCountField), {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)sizeof(_MEMBER_TYPE)}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_TYPE(Par1, Par2, Par3)
|
||||
|
@ -445,7 +473,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par3: type of member
|
||||
*****************************************************************************/
|
||||
#define M_TYPE(_STRUCT, _MEMBER, _MEMBER_TYPE)\
|
||||
{CSN_TYPE, 0, {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_TYPE, 0, {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_UNION(Par1, Par2)
|
||||
|
@ -458,14 +486,14 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par2: number of possible choice in the union
|
||||
*****************************************************************************/
|
||||
#define M_UNION(_STRUCT, _COUNT)\
|
||||
{CSN_UNION, _COUNT, {0}, offsetof(_STRUCT, UnionType), "UnionType", {(StreamSerializeFcn_t)0}}
|
||||
{CSN_UNION, _COUNT, {0}, offsetof(_STRUCT, UnionType), FALSE, "UnionType", {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_UNION_LH(Par1, Par2)
|
||||
* Same as M_UNION but masked with background value 0x2B
|
||||
*****************************************************************************/
|
||||
#define M_UNION_LH(_STRUCT, _COUNT)\
|
||||
{CSN_UNION_LH, _COUNT, {0}, offsetof(_STRUCT, UnionType), "UnionType", {(StreamSerializeFcn_t)0}}
|
||||
{CSN_UNION_LH, _COUNT, {0}, offsetof(_STRUCT, UnionType), FALSE, "UnionType", {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_CHOICE(Par1, Par2, Par3, Par4)
|
||||
|
@ -494,7 +522,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par4: number of possible choices in the union
|
||||
*****************************************************************************/
|
||||
#define M_CHOICE(_STRUCT, _MEMBER, _CHOICE, _ElementCount)\
|
||||
{CSN_CHOICE, _ElementCount, {(void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), #_CHOICE, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_CHOICE, _ElementCount, {(void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), FALSE, #_CHOICE, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_FIXED(Par1, Par2, Par3)
|
||||
|
@ -506,23 +534,23 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* the message the unpacking procedure is aborted
|
||||
*****************************************************************************/
|
||||
#define M_FIXED(_STRUCT, _BITS, _BITVALUE)\
|
||||
{CSN_FIXED, _BITS, {0}, _BITVALUE, #_BITVALUE, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_FIXED, _BITS, {0}, _BITVALUE, FALSE, #_BITVALUE, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_SERIALIZE(Par1, Par2, Par3)
|
||||
* Allows using a complete free format of data being encoded or decoded.
|
||||
* When the M_SERIALIZE is uncounted during encoding or decoding of a message
|
||||
* When the M_SERIALIZE is encounted during encoding or decoding of a message
|
||||
* the CSNstream program passes the control over to the specified function
|
||||
* together with all necessary parameters about the current position within
|
||||
* the message being unpacked or packed. When transferring of "serialized"
|
||||
* data to or from the message is finished by the function the CSNstream gets
|
||||
* back control over the data stream and continues to work with the message.
|
||||
*****************************************************************************/
|
||||
#define M_SERIALIZE(_STRUCT, _MEMBER, _SERIALIZEFCN)\
|
||||
{CSN_SERIALIZE, 1, {0}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {_SERIALIZEFCN}}
|
||||
#define M_SERIALIZE(_STRUCT, _MEMBER, _LENGTH_LEN, _SERIALIZEFCN)\
|
||||
{CSN_SERIALIZE, _LENGTH_LEN, {0}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {_SERIALIZEFCN}}
|
||||
|
||||
#define M_CALLBACK(_STRUCT, _CSNCALLBACKFCN, _PARAM1, _PARAM2)\
|
||||
{CSN_CALLBACK, offsetof(_STRUCT, _PARAM1), {_CSNCALLBACKFCN}, offsetof(_STRUCT, _PARAM2), "CallBack_"#_CSNCALLBACKFCN, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_CALLBACK, offsetof(_STRUCT, _PARAM1), {_CSNCALLBACKFCN}, offsetof(_STRUCT, _PARAM2), FALSE, "CallBack_"#_CSNCALLBACKFCN, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/******************************************************************************
|
||||
* M_BITMAP(Par1, Par2, Par3)
|
||||
|
@ -533,38 +561,42 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
|
|||
* Par3: length of the bitmap expressed in bits
|
||||
*****************************************************************************/
|
||||
#define M_BITMAP(_STRUCT, _MEMBER, _BITS)\
|
||||
{CSN_BITMAP, _BITS, {0}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_BITMAP, _BITS, {0}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/* variable length, right aligned bitmap i.e. _ElementCountField = 11 => 00000111 11111111 */
|
||||
#define M_VAR_BITMAP(_STRUCT, _MEMBER, _ElementCountField, _OFFSET)\
|
||||
{CSN_VARIABLE_BITMAP, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_VARIABLE_BITMAP, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/* variable length, right aligned bitmap filling the rest of message
|
||||
* - when unpacking the _ElementCountField will be set in runtime
|
||||
* - when packing _ElementCountField contains the size of bitmap
|
||||
*/
|
||||
#define M_VAR_BITMAP_1(_STRUCT, _MEMBER, _ElementCountField, _OFFSET)\
|
||||
{CSN_VARIABLE_BITMAP_1, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_VARIABLE_BITMAP_1, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/* variable length, left aligned bitmap i.e. _ElementCountField = 11 => 11111111 11100000 */
|
||||
#define M_LEFT_VAR_BMP(_STRUCT, _MEMBER, _ElementCountField, _OFFSET)\
|
||||
{CSN_LEFT_ALIGNED_VAR_BMP, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_LEFT_ALIGNED_VAR_BMP, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/* variable length, left aligned bitmap filling the rest of message
|
||||
*- when unpacking the _ElementCountField will be set in runtime
|
||||
* - when packing _ElementCountField contains the size of bitmap
|
||||
*/
|
||||
#define M_LEFT_VAR_BMP_1(_STRUCT, _MEMBER, _ElementCountField, _OFFSET)\
|
||||
{CSN_LEFT_ALIGNED_VAR_BMP_1, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_LEFT_ALIGNED_VAR_BMP_1, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/* todo: dissect padding bits looking for unexpected extensions */
|
||||
#define M_PADDING_BITS(_STRUCT)\
|
||||
{CSN_PADDING_BITS, 0, {0}, 0, TRUE, "Padding", {(StreamSerializeFcn_t)0}}
|
||||
|
||||
#define M_NULL(_STRUCT, _MEMBER)\
|
||||
{CSN_NULL, 0, {0}, offsetof(_STRUCT, _MEMBER), #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
{CSN_NULL, 0, {0}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
|
||||
|
||||
#define M_THIS_EXIST(_STRUCT)\
|
||||
{CSN_EXIST, 0, {0}, offsetof(_STRUCT, Exist), "Exist", {(StreamSerializeFcn_t)0}}
|
||||
{CSN_EXIST, 0, {0}, offsetof(_STRUCT, Exist), FALSE, "Exist", {(StreamSerializeFcn_t)0}}
|
||||
|
||||
#define M_THIS_EXIST_LH(_STRUCT)\
|
||||
{CSN_EXIST_LH, 0, {0}, offsetof(_STRUCT, Exist), "Exist", {(StreamSerializeFcn_t)0}}
|
||||
{CSN_EXIST_LH, 0, {0}, offsetof(_STRUCT, Exist), FALSE, "Exist", {(StreamSerializeFcn_t)0}}
|
||||
|
||||
/* return value 0 if ok else discontionue the unpacking */
|
||||
typedef gint16 (*CsnCallBackFcn_t)(void* pv ,...);
|
||||
|
|
|
@ -166,22 +166,47 @@ CSN_DESCR_BEGIN(Channel_Quality_Report_t)
|
|||
M_UINT (Channel_Quality_Report_t, Slot[7].I_LEVEL_TN, 4),
|
||||
CSN_DESCR_END (Channel_Quality_Report_t)
|
||||
|
||||
/*< EGPRS Ack/Nack Description >*/
|
||||
/*< EGPRS Ack/Nack Description struct >*/
|
||||
static const
|
||||
CSN_DESCR_BEGIN (EGPRS_AckNack_t)
|
||||
M_NEXT_EXIST (EGPRS_AckNack_t, Exist_LENGTH, 1),
|
||||
M_UINT (EGPRS_AckNack_t, LENGTH, 8),
|
||||
CSN_DESCR_BEGIN (EGPRS_AckNack_Desc_t)
|
||||
M_UINT (EGPRS_AckNack_Desc_t, FINAL_ACK_INDICATION, 1),
|
||||
M_UINT (EGPRS_AckNack_Desc_t, BEGINNING_OF_WINDOW, 1),
|
||||
M_UINT (EGPRS_AckNack_Desc_t, END_OF_WINDOW, 1),
|
||||
M_UINT (EGPRS_AckNack_Desc_t, STARTING_SEQUENCE_NUMBER, 11),
|
||||
|
||||
M_UINT (EGPRS_AckNack_t, FINAL_ACK_INDICATION, 1),
|
||||
M_UINT (EGPRS_AckNack_t, BEGINNING_OF_WINDOW, 1),
|
||||
M_UINT (EGPRS_AckNack_t, END_OF_WINDOW, 1),
|
||||
M_UINT (EGPRS_AckNack_t, STARTING_SEQUENCE_NUMBER, 11),
|
||||
M_NEXT_EXIST (EGPRS_AckNack_Desc_t, Exist_CRBB, 3),
|
||||
M_UINT (EGPRS_AckNack_Desc_t, CRBB_LENGTH, 7),
|
||||
M_UINT (EGPRS_AckNack_Desc_t, CRBB_STARTING_COLOR_CODE, 1),
|
||||
M_LEFT_VAR_BMP (EGPRS_AckNack_Desc_t, CRBB, CRBB_LENGTH, 0),
|
||||
|
||||
M_NEXT_EXIST (EGPRS_AckNack_t, Exist_CRBB, 3),
|
||||
M_UINT (EGPRS_AckNack_t, CRBB_LENGTH, 7),
|
||||
M_UINT (EGPRS_AckNack_t, CRBB_STARTING_COLOR_CODE, 1),
|
||||
M_LEFT_VAR_BMP (EGPRS_AckNack_t, CRBB, CRBB_LENGTH, 0),
|
||||
CSN_DESCR_END (EGPRS_AckNack_t)
|
||||
M_LEFT_VAR_BMP_1(EGPRS_AckNack_Desc_t, URBB, URBB_LENGTH, 0),
|
||||
CSN_DESCR_END (EGPRS_AckNack_Desc_t)
|
||||
|
||||
/*< EGPRS Ack/Nack Description IE >*/
|
||||
gint16 Egprs_Ack_Nack_Desc_w_len_Dissector(csnStream_t* ar, bitvec *vector, unsigned& readIndex, void* data)
|
||||
{
|
||||
if (ar->direction == 0)
|
||||
{
|
||||
return csnStreamEncoder(ar, CSNDESCR(EGPRS_AckNack_Desc_t), vector, readIndex, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
return csnStreamDecoder(ar, CSNDESCR(EGPRS_AckNack_Desc_t), vector, readIndex, data);
|
||||
}
|
||||
}
|
||||
|
||||
/* this intermediate structure is only required because M_SERIALIZE cannot be used as a member of M_UNION */
|
||||
static const
|
||||
CSN_DESCR_BEGIN(EGPRS_AckNack_w_len_t)
|
||||
M_SERIALIZE (EGPRS_AckNack_w_len_t, Desc, 8, Egprs_Ack_Nack_Desc_w_len_Dissector),
|
||||
CSN_DESCR_END (EGPRS_AckNack_w_len_t)
|
||||
|
||||
static const
|
||||
CSN_DESCR_BEGIN(EGPRS_AckNack_t)
|
||||
M_UNION (EGPRS_AckNack_t, 2),
|
||||
M_TYPE (EGPRS_AckNack_t, Desc, EGPRS_AckNack_Desc_t),
|
||||
M_TYPE (EGPRS_AckNack_t, Desc, EGPRS_AckNack_w_len_t),
|
||||
CSN_DESCR_END (EGPRS_AckNack_t)
|
||||
|
||||
/*<P1 Rest Octets>*/
|
||||
/*<P2 Rest Octets>*/
|
||||
|
@ -517,6 +542,7 @@ CSN_DESCR_BEGIN(Packet_Polling_Request_t)
|
|||
M_UINT (Packet_Polling_Request_t, PAGE_MODE, 2),
|
||||
M_TYPE (Packet_Polling_Request_t, ID, PacketPollingID_t),
|
||||
M_BIT (Packet_Polling_Request_t, TYPE_OF_ACK),
|
||||
M_PADDING_BITS(Packet_Polling_Request_t),
|
||||
CSN_DESCR_END (Packet_Polling_Request_t)
|
||||
|
||||
static const
|
||||
|
@ -652,6 +678,7 @@ CSN_DESCR_BEGIN(Packet_TBF_Release_t)
|
|||
M_BIT (Packet_TBF_Release_t, UPLINK_RELEASE),
|
||||
M_BIT (Packet_TBF_Release_t, DOWNLINK_RELEASE),
|
||||
M_UINT (Packet_TBF_Release_t, TBF_RELEASE_CAUSE, 4),
|
||||
M_PADDING_BITS(Packet_TBF_Release_t ),
|
||||
CSN_DESCR_END (Packet_TBF_Release_t)
|
||||
|
||||
/*< Packet Control Acknowledgement message content >*/
|
||||
|
@ -684,6 +711,7 @@ CSN_DESCR_BEGIN (Packet_Control_Acknowledgement_t)
|
|||
M_UINT (Packet_Control_Acknowledgement_t, CTRL_ACK, 2),
|
||||
M_NEXT_EXIST_OR_NULL (Packet_Control_Acknowledgement_t, Exist_AdditionsR5, 1),
|
||||
M_TYPE (Packet_Control_Acknowledgement_t, AdditionsR5, Packet_Control_Acknowledgement_AdditionsR5_t),
|
||||
M_PADDING_BITS (Packet_Control_Acknowledgement_t),
|
||||
CSN_DESCR_END (Packet_Control_Acknowledgement_t)
|
||||
|
||||
/*< Packet Downlink Dummy Control Block message content >*/
|
||||
|
@ -694,6 +722,7 @@ CSN_DESCR_BEGIN(Packet_Downlink_Dummy_Control_Block_t)
|
|||
|
||||
M_NEXT_EXIST (Packet_Downlink_Dummy_Control_Block_t, Exist_PERSISTENCE_LEVEL, 1),
|
||||
M_UINT_ARRAY (Packet_Downlink_Dummy_Control_Block_t, PERSISTENCE_LEVEL, 4, 4),
|
||||
M_PADDING_BITS(Packet_Downlink_Dummy_Control_Block_t ),
|
||||
CSN_DESCR_END (Packet_Downlink_Dummy_Control_Block_t)
|
||||
|
||||
/*< Packet Uplink Dummy Control Block message content >*/
|
||||
|
@ -706,6 +735,7 @@ CSN_DESCR_BEGIN(Packet_Uplink_Dummy_Control_Block_t)
|
|||
M_UINT (Packet_Uplink_Dummy_Control_Block_t, MESSAGE_TYPE, 6),
|
||||
M_UINT (Packet_Uplink_Dummy_Control_Block_t, TLLI, 32),
|
||||
/*M_FIXED (Packet_Uplink_Dummy_Control_Block_t, 1, 0),*/
|
||||
M_PADDING_BITS(Packet_Uplink_Dummy_Control_Block_t),
|
||||
CSN_DESCR_END (Packet_Uplink_Dummy_Control_Block_t)
|
||||
|
||||
static const
|
||||
|
@ -728,7 +758,7 @@ gint16 Receive_N_PDU_Number_list_Dissector(csnStream_t* ar, bitvec *vector, unsi
|
|||
|
||||
static const
|
||||
CSN_DESCR_BEGIN(Receive_N_PDU_Number_list_t)
|
||||
M_SERIALIZE (Receive_N_PDU_Number_list_t, IEI, Receive_N_PDU_Number_list_Dissector),
|
||||
M_SERIALIZE (Receive_N_PDU_Number_list_t, IEI, 7, Receive_N_PDU_Number_list_Dissector),
|
||||
M_VAR_TARRAY (Receive_N_PDU_Number_list_t, Receive_N_PDU_Number, Receive_N_PDU_Number_t, Count_Receive_N_PDU_Number),
|
||||
CSN_DESCR_END (Receive_N_PDU_Number_list_t)
|
||||
|
||||
|
@ -747,25 +777,25 @@ CSN_DESCR_END (DTM_EGPRS_HighMultislotClass_t)
|
|||
|
||||
static const
|
||||
CSN_DESCR_BEGIN (Multislot_capability_t)
|
||||
M_NEXT_EXIST (Multislot_capability_t, Exist_HSCSD_multislot_class, 1),
|
||||
M_NEXT_EXIST_OR_NULL(Multislot_capability_t, Exist_HSCSD_multislot_class, 1),
|
||||
M_UINT (Multislot_capability_t, HSCSD_multislot_class, 5),
|
||||
|
||||
M_NEXT_EXIST (Multislot_capability_t, Exist_GPRS_multislot_class, 2),
|
||||
M_NEXT_EXIST_OR_NULL(Multislot_capability_t, Exist_GPRS_multislot_class, 2),
|
||||
M_UINT (Multislot_capability_t, GPRS_multislot_class, 5),
|
||||
M_UINT (Multislot_capability_t, GPRS_Extended_Dynamic_Allocation_Capability, 1),
|
||||
|
||||
M_NEXT_EXIST (Multislot_capability_t, Exist_SM, 2),
|
||||
M_NEXT_EXIST_OR_NULL(Multislot_capability_t, Exist_SM, 2),
|
||||
M_UINT (Multislot_capability_t, SMS_VALUE, 4),
|
||||
M_UINT (Multislot_capability_t, SM_VALUE, 4),
|
||||
|
||||
M_NEXT_EXIST (Multislot_capability_t, Exist_ECSD_multislot_class, 1),
|
||||
M_NEXT_EXIST_OR_NULL(Multislot_capability_t, Exist_ECSD_multislot_class, 1),
|
||||
M_UINT (Multislot_capability_t, ECSD_multislot_class, 5),
|
||||
|
||||
M_NEXT_EXIST (Multislot_capability_t, Exist_EGPRS_multislot_class, 2),
|
||||
M_NEXT_EXIST_OR_NULL(Multislot_capability_t, Exist_EGPRS_multislot_class, 2),
|
||||
M_UINT (Multislot_capability_t, EGPRS_multislot_class, 5),
|
||||
M_UINT (Multislot_capability_t, EGPRS_Extended_Dynamic_Allocation_Capability, 1),
|
||||
|
||||
M_NEXT_EXIST (Multislot_capability_t, Exist_DTM_GPRS_multislot_class, 3),
|
||||
M_NEXT_EXIST_OR_NULL(Multislot_capability_t, Exist_DTM_GPRS_multislot_class, 3),
|
||||
M_UINT (Multislot_capability_t, DTM_GPRS_multislot_class, 2),
|
||||
M_UINT (Multislot_capability_t, Single_Slot_DTM, 1),
|
||||
M_TYPE (Multislot_capability_t, DTM_EGPRS_Params, DTM_EGPRS_t),
|
||||
|
@ -775,54 +805,54 @@ static const
|
|||
CSN_DESCR_BEGIN (Content_t)
|
||||
M_UINT (Content_t, RF_Power_Capability, 3),
|
||||
|
||||
M_NEXT_EXIST (Content_t, Exist_A5_bits, 1),
|
||||
M_UINT (Content_t, A5_bits, 7),
|
||||
M_NEXT_EXIST_OR_NULL(Content_t, Exist_A5_bits, 1),
|
||||
M_UINT_OR_NULL (Content_t, A5_bits, 7),
|
||||
|
||||
M_UINT (Content_t, ES_IND, 1),
|
||||
M_UINT (Content_t, PS, 1),
|
||||
M_UINT (Content_t, VGCS, 1),
|
||||
M_UINT (Content_t, VBS, 1),
|
||||
M_UINT_OR_NULL (Content_t, ES_IND, 1),
|
||||
M_UINT_OR_NULL (Content_t, PS, 1),
|
||||
M_UINT_OR_NULL (Content_t, VGCS, 1),
|
||||
M_UINT_OR_NULL (Content_t, VBS, 1),
|
||||
|
||||
M_NEXT_EXIST_OR_NULL(Content_t, Exist_Multislot_capability, 1),
|
||||
M_TYPE (Content_t, Multislot_capability, Multislot_capability_t),
|
||||
|
||||
M_NEXT_EXIST (Content_t, Exist_Eight_PSK_Power_Capability, 1),
|
||||
M_NEXT_EXIST_OR_NULL(Content_t, Exist_Eight_PSK_Power_Capability, 1),
|
||||
M_UINT (Content_t, Eight_PSK_Power_Capability, 2),
|
||||
|
||||
M_UINT (Content_t, COMPACT_Interference_Measurement_Capability, 1),
|
||||
M_UINT (Content_t, Revision_Level_Indicator, 1),
|
||||
M_UINT (Content_t, UMTS_FDD_Radio_Access_Technology_Capability, 1),
|
||||
M_UINT (Content_t, UMTS_384_TDD_Radio_Access_Technology_Capability, 1),
|
||||
M_UINT (Content_t, CDMA2000_Radio_Access_Technology_Capability, 1),
|
||||
M_UINT_OR_NULL (Content_t, COMPACT_Interference_Measurement_Capability, 1),
|
||||
M_UINT_OR_NULL (Content_t, Revision_Level_Indicator, 1),
|
||||
M_UINT_OR_NULL (Content_t, UMTS_FDD_Radio_Access_Technology_Capability, 1),
|
||||
M_UINT_OR_NULL (Content_t, UMTS_384_TDD_Radio_Access_Technology_Capability, 1),
|
||||
M_UINT_OR_NULL (Content_t, CDMA2000_Radio_Access_Technology_Capability, 1),
|
||||
|
||||
M_UINT (Content_t, UMTS_128_TDD_Radio_Access_Technology_Capability, 1),
|
||||
M_UINT (Content_t, GERAN_Feature_Package_1, 1),
|
||||
M_UINT_OR_NULL (Content_t, UMTS_128_TDD_Radio_Access_Technology_Capability, 1),
|
||||
M_UINT_OR_NULL (Content_t, GERAN_Feature_Package_1, 1),
|
||||
|
||||
M_NEXT_EXIST (Content_t, Exist_Extended_DTM_multislot_class, 2),
|
||||
M_NEXT_EXIST_OR_NULL(Content_t, Exist_Extended_DTM_multislot_class, 2),
|
||||
M_UINT (Content_t, Extended_DTM_GPRS_multislot_class, 2),
|
||||
M_UINT (Content_t, Extended_DTM_EGPRS_multislot_class, 2),
|
||||
|
||||
M_UINT (Content_t, Modulation_based_multislot_class_support, 1),
|
||||
M_UINT_OR_NULL (Content_t, Modulation_based_multislot_class_support, 1),
|
||||
|
||||
M_NEXT_EXIST (Content_t, Exist_HighMultislotCapability, 1),
|
||||
M_NEXT_EXIST_OR_NULL(Content_t, Exist_HighMultislotCapability, 1),
|
||||
M_UINT (Content_t, HighMultislotCapability, 2),
|
||||
|
||||
M_NEXT_EXIST (Content_t, Exist_GERAN_lu_ModeCapability, 1),
|
||||
M_NEXT_EXIST_OR_NULL(Content_t, Exist_GERAN_lu_ModeCapability, 1),
|
||||
M_UINT (Content_t, GERAN_lu_ModeCapability, 4),
|
||||
|
||||
M_UINT (Content_t, GMSK_MultislotPowerProfile, 2),
|
||||
M_UINT (Content_t, EightPSK_MultislotProfile, 2),
|
||||
M_UINT_OR_NULL (Content_t, GMSK_MultislotPowerProfile, 2),
|
||||
M_UINT_OR_NULL (Content_t, EightPSK_MultislotProfile, 2),
|
||||
|
||||
M_UINT (Content_t, MultipleTBF_Capability, 1),
|
||||
M_UINT (Content_t, DownlinkAdvancedReceiverPerformance, 2),
|
||||
M_UINT (Content_t, ExtendedRLC_MAC_ControlMessageSegmentionsCapability, 1),
|
||||
M_UINT (Content_t, DTM_EnhancementsCapability, 1),
|
||||
M_UINT_OR_NULL (Content_t, MultipleTBF_Capability, 1),
|
||||
M_UINT_OR_NULL (Content_t, DownlinkAdvancedReceiverPerformance, 2),
|
||||
M_UINT_OR_NULL (Content_t, ExtendedRLC_MAC_ControlMessageSegmentionsCapability, 1),
|
||||
M_UINT_OR_NULL (Content_t, DTM_EnhancementsCapability, 1),
|
||||
|
||||
M_NEXT_EXIST (Content_t, Exist_DTM_GPRS_HighMultislotClass, 2),
|
||||
M_NEXT_EXIST_OR_NULL(Content_t, Exist_DTM_GPRS_HighMultislotClass, 2),
|
||||
M_UINT (Content_t, DTM_GPRS_HighMultislotClass, 3),
|
||||
M_TYPE (Content_t, DTM_EGPRS_HighMultislotClass, DTM_EGPRS_HighMultislotClass_t),
|
||||
|
||||
M_UINT (Content_t, PS_HandoverCapability, 1),
|
||||
M_UINT_OR_NULL (Content_t, PS_HandoverCapability, 1),
|
||||
CSN_DESCR_END (Content_t)
|
||||
|
||||
gint16 Content_Dissector(csnStream_t* ar, bitvec *vector, unsigned& readIndex, void* data)
|
||||
|
@ -864,12 +894,12 @@ gint16 Additional_access_technologies_Dissector(csnStream_t* ar, bitvec* vector,
|
|||
static const
|
||||
CSN_ChoiceElement_t MS_RA_capability_value_Choice[] =
|
||||
{
|
||||
{4, AccTech_GSMP, M_SERIALIZE (MS_RA_capability_value_t, u.Content, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSME, M_SERIALIZE (MS_RA_capability_value_t, u.Content, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSM1800, M_SERIALIZE (MS_RA_capability_value_t, u.Content, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSM1900, M_SERIALIZE (MS_RA_capability_value_t, u.Content, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSM850, M_SERIALIZE (MS_RA_capability_value_t, u.Content, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSMOther, M_SERIALIZE (MS_RA_capability_value_t, u.Additional_access_technologies, Additional_access_technologies_Dissector)}, /* Short Form */
|
||||
{4, AccTech_GSMP, M_SERIALIZE (MS_RA_capability_value_t, u.Content, 7, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSME, M_SERIALIZE (MS_RA_capability_value_t, u.Content, 7, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSM1800, M_SERIALIZE (MS_RA_capability_value_t, u.Content, 7, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSM1900, M_SERIALIZE (MS_RA_capability_value_t, u.Content, 7, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSM850, M_SERIALIZE (MS_RA_capability_value_t, u.Content, 7, Content_Dissector)}, /* Long Form */
|
||||
{4, AccTech_GSMOther, M_SERIALIZE (MS_RA_capability_value_t, u.Additional_access_technologies, 7, Additional_access_technologies_Dissector)}, /* Short Form */
|
||||
};
|
||||
|
||||
static const
|
||||
|
@ -883,7 +913,7 @@ CSN_DESCR_BEGIN (MS_Radio_Access_capability_t)
|
|||
/*M_UINT (MS_Radio_Access_capability_t, IEI, 8),*/
|
||||
/*M_UINT (MS_Radio_Access_capability_t, Length, 8),*/
|
||||
|
||||
M_REC_TARRAY_1(MS_Radio_Access_capability_t, MS_RA_capability_value[0], MS_RA_capability_value_t, Count_MS_RA_capability_value),
|
||||
M_REC_TARRAY_1(MS_Radio_Access_capability_t, MS_RA_capability_value, MS_RA_capability_value_t, Count_MS_RA_capability_value),
|
||||
CSN_DESCR_END (MS_Radio_Access_capability_t)
|
||||
|
||||
/*< MS Classmark 3 IE >*/
|
||||
|
@ -1111,6 +1141,7 @@ CSN_DESCR_BEGIN (Packet_Resource_Request_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL(Packet_Resource_Request_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (Packet_Resource_Request_t, AdditionsR99, PRR_AdditionsR99_t),
|
||||
M_PADDING_BITS (Packet_Resource_Request_t),
|
||||
CSN_DESCR_END (Packet_Resource_Request_t)
|
||||
|
||||
/*< Packet Mobile TBF Status message content > */
|
||||
|
@ -1128,6 +1159,7 @@ CSN_DESCR_BEGIN(Packet_Mobile_TBF_Status_t)
|
|||
|
||||
M_NEXT_EXIST (Packet_Mobile_TBF_Status_t, Exist_STATUS_MESSAGE_TYPE, 1),
|
||||
M_UINT (Packet_Mobile_TBF_Status_t, STATUS_MESSAGE_TYPE, 6),
|
||||
M_PADDING_BITS(Packet_Mobile_TBF_Status_t),
|
||||
CSN_DESCR_END (Packet_Mobile_TBF_Status_t)
|
||||
|
||||
/*< Packet PSI Status message content > */
|
||||
|
@ -1166,6 +1198,7 @@ CSN_DESCR_BEGIN(Packet_PSI_Status_t)
|
|||
M_UINT (Packet_PSI_Status_t, PBCCH_CHANGE_MARK, 3),
|
||||
M_TYPE (Packet_PSI_Status_t, PSI_Message_List, PSI_Message_List_t),
|
||||
M_TYPE (Packet_PSI_Status_t, Unknown_PSI_Message_List, Unknown_PSI_Message_List_t),
|
||||
M_PADDING_BITS(Packet_PSI_Status_t),
|
||||
CSN_DESCR_END (Packet_PSI_Status_t)
|
||||
|
||||
/* < Packet SI Status message content > */
|
||||
|
@ -1202,6 +1235,7 @@ CSN_DESCR_BEGIN(Packet_SI_Status_t)
|
|||
M_UINT (Packet_SI_Status_t, BCCH_CHANGE_MARK, 3),
|
||||
M_TYPE (Packet_SI_Status_t, SI_Message_List, SI_Message_List_t),
|
||||
M_TYPE (Packet_SI_Status_t, Unknown_SI_Message_List, Unknown_SI_Message_List_t),
|
||||
M_PADDING_BITS(Packet_SI_Status_t),
|
||||
CSN_DESCR_END (Packet_SI_Status_t)
|
||||
|
||||
/* < Packet Downlink Ack/Nack message content > */
|
||||
|
@ -1227,6 +1261,7 @@ CSN_DESCR_BEGIN (Packet_Downlink_Ack_Nack_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL(Packet_Downlink_Ack_Nack_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (Packet_Downlink_Ack_Nack_t, AdditionsR99, PD_AckNack_AdditionsR99_t),
|
||||
M_PADDING_BITS (Packet_Downlink_Ack_Nack_t),
|
||||
CSN_DESCR_END (Packet_Downlink_Ack_Nack_t)
|
||||
|
||||
|
||||
|
@ -1263,7 +1298,7 @@ CSN_DESCR_BEGIN(EGPRS_PD_AckNack_t)
|
|||
|
||||
M_TYPE (EGPRS_PD_AckNack_t, EGPRS_AckNack, EGPRS_AckNack_t),
|
||||
/* M_CALLBACK (EGPRS_PD_AckNack_t, (void*)24, EGPRS_AckNack, EGPRS_AckNack), */
|
||||
M_LEFT_VAR_BMP (EGPRS_PD_AckNack_t, EGPRS_AckNack.URBB, EGPRS_AckNack.URBB_LENGTH, 0),
|
||||
M_PADDING_BITS(EGPRS_PD_AckNack_t),
|
||||
|
||||
CSN_DESCR_END (EGPRS_PD_AckNack_t)
|
||||
|
||||
|
@ -1360,6 +1395,8 @@ CSN_DESCR_BEGIN(Packet_Cell_Change_Failure_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL (Packet_Cell_Change_Failure_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (Packet_Cell_Change_Failure_t, AdditionsR99, PCCF_AdditionsR99_t),
|
||||
|
||||
M_PADDING_BITS (Packet_Cell_Change_Failure_t),
|
||||
CSN_DESCR_END (Packet_Cell_Change_Failure_t)
|
||||
|
||||
/*< Packet Uplink Ack/Nack message content > */
|
||||
|
@ -1452,7 +1489,6 @@ CSN_DESCR_BEGIN(PU_AckNack_EGPRS_00_t)
|
|||
|
||||
M_TYPE (PU_AckNack_EGPRS_00_t, EGPRS_AckNack, EGPRS_AckNack_t),
|
||||
/* M_CALLBACK (PU_AckNack_EGPRS_00_t, (void*)24, EGPRS_AckNack, EGPRS_AckNack), */
|
||||
M_LEFT_VAR_BMP (PU_AckNack_EGPRS_00_t, EGPRS_AckNack.URBB, EGPRS_AckNack.URBB_LENGTH, 0),
|
||||
CSN_DESCR_END (PU_AckNack_EGPRS_00_t)
|
||||
|
||||
static const
|
||||
|
@ -1475,6 +1511,7 @@ CSN_DESCR_BEGIN(Packet_Uplink_Ack_Nack_t)
|
|||
M_UNION (Packet_Uplink_Ack_Nack_t, 2),
|
||||
M_TYPE (Packet_Uplink_Ack_Nack_t, u.PU_AckNack_GPRS_Struct, PU_AckNack_GPRS_t),
|
||||
M_TYPE (Packet_Uplink_Ack_Nack_t, u.PU_AckNack_EGPRS_Struct, PU_AckNack_EGPRS_t),
|
||||
M_PADDING_BITS(Packet_Uplink_Ack_Nack_t ),
|
||||
CSN_DESCR_END (Packet_Uplink_Ack_Nack_t)
|
||||
|
||||
/*< Packet Uplink Assignment message content > */
|
||||
|
@ -1813,6 +1850,8 @@ CSN_DESCR_BEGIN(Packet_Uplink_Assignment_t)
|
|||
M_UNION (Packet_Uplink_Assignment_t, 2),
|
||||
M_TYPE (Packet_Uplink_Assignment_t, u.PUA_GPRS_Struct, PUA_GPRS_t),
|
||||
M_TYPE (Packet_Uplink_Assignment_t, u.PUA_EGPRS_Struct, PUA_EGPRS_t),
|
||||
|
||||
M_PADDING_BITS(Packet_Uplink_Assignment_t ),
|
||||
CSN_DESCR_END (Packet_Uplink_Assignment_t)
|
||||
|
||||
/*< Packet Downlink Assignment message content > */
|
||||
|
@ -1890,6 +1929,8 @@ CSN_DESCR_BEGIN (Packet_Downlink_Assignment_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL(Packet_Downlink_Assignment_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (Packet_Downlink_Assignment_t, AdditionsR99, PDA_AdditionsR99_t),
|
||||
|
||||
M_PADDING_BITS (Packet_Downlink_Assignment_t),
|
||||
CSN_DESCR_END (Packet_Downlink_Assignment_t)
|
||||
|
||||
typedef Packet_Downlink_Assignment_t pdlaCheck_t;
|
||||
|
@ -2034,6 +2075,7 @@ CSN_DESCR_BEGIN(Packet_Paging_Request_t)
|
|||
M_UINT (Packet_Paging_Request_t, NLN, 2),
|
||||
|
||||
M_REC_TARRAY (Packet_Paging_Request_t, Repeated_Page_info, Repeated_Page_info_t, Count_Repeated_Page_info),
|
||||
M_PADDING_BITS(Packet_Paging_Request_t),
|
||||
CSN_DESCR_END (Packet_Paging_Request_t)
|
||||
|
||||
static const
|
||||
|
@ -2043,6 +2085,7 @@ CSN_DESCR_BEGIN(Packet_PDCH_Release_t)
|
|||
|
||||
M_FIXED (Packet_PDCH_Release_t, 1, 0x01),
|
||||
M_UINT (Packet_PDCH_Release_t, TIMESLOTS_AVAILABLE, 8),
|
||||
M_PADDING_BITS(Packet_PDCH_Release_t),
|
||||
CSN_DESCR_END (Packet_PDCH_Release_t)
|
||||
|
||||
/*< Packet Power Control/Timing Advance message content >*/
|
||||
|
@ -2088,6 +2131,8 @@ CSN_DESCR_BEGIN(Packet_Power_Control_Timing_Advance_t)
|
|||
M_UNION (Packet_Power_Control_Timing_Advance_t, 2),
|
||||
M_TYPE (Packet_Power_Control_Timing_Advance_t, u.GlobalTimingAndPower, GlobalTimingAndPower_t),
|
||||
M_TYPE (Packet_Power_Control_Timing_Advance_t, u.GlobalTimingOrPower, GlobalTimingOrPower_t),
|
||||
|
||||
M_PADDING_BITS(Packet_Power_Control_Timing_Advance_t),
|
||||
CSN_DESCR_END (Packet_Power_Control_Timing_Advance_t)
|
||||
|
||||
/*< Packet Queueing Notification message content > */
|
||||
|
@ -2100,6 +2145,7 @@ CSN_DESCR_BEGIN(Packet_Queueing_Notification_t)
|
|||
M_TYPE (Packet_Queueing_Notification_t, Packet_Request_Reference, Packet_Request_Reference_t),
|
||||
|
||||
M_UINT (Packet_Queueing_Notification_t, TQI, 16),
|
||||
M_PADDING_BITS(Packet_Queueing_Notification_t),
|
||||
CSN_DESCR_END (Packet_Queueing_Notification_t)
|
||||
|
||||
/* USED in Packet Timeslot Reconfigure message content
|
||||
|
@ -2220,6 +2266,8 @@ CSN_DESCR_BEGIN(Packet_Timeslot_Reconfigure_t)
|
|||
M_UNION (Packet_Timeslot_Reconfigure_t, 2),
|
||||
M_TYPE (Packet_Timeslot_Reconfigure_t, u.PTR_GPRS_Struct, PTR_GPRS_t),
|
||||
M_TYPE (Packet_Timeslot_Reconfigure_t, u.PTR_EGPRS_Struct, PTR_EGPRS_t),
|
||||
|
||||
M_PADDING_BITS(Packet_Timeslot_Reconfigure_t),
|
||||
CSN_DESCR_END (Packet_Timeslot_Reconfigure_t)
|
||||
|
||||
typedef Packet_Timeslot_Reconfigure_t PTRCheck_t;
|
||||
|
@ -2332,6 +2380,7 @@ CSN_DESCR_BEGIN(Packet_PRACH_Parameters_t)
|
|||
M_UINT (Packet_PRACH_Parameters_t, PAGE_MODE, 2),
|
||||
|
||||
M_TYPE (Packet_PRACH_Parameters_t, PRACH_Control, PRACH_Control_t),
|
||||
M_PADDING_BITS(Packet_PRACH_Parameters_t),
|
||||
CSN_DESCR_END (Packet_PRACH_Parameters_t)
|
||||
|
||||
/* < Packet Access Reject message content > */
|
||||
|
@ -2364,6 +2413,7 @@ CSN_DESCR_BEGIN(Packet_Access_Reject_t)
|
|||
|
||||
M_TYPE (Packet_Access_Reject_t, Reject, Reject_t),
|
||||
M_REC_TARRAY (Packet_Access_Reject_t, Reject[1], Reject_t, Count_Reject),
|
||||
M_PADDING_BITS(Packet_Access_Reject_t),
|
||||
CSN_DESCR_END (Packet_Access_Reject_t)
|
||||
|
||||
/* < Packet Cell Change Order message content > */
|
||||
|
@ -3273,6 +3323,8 @@ CSN_DESCR_BEGIN(Packet_Cell_Change_Order_t)
|
|||
M_UNION (Packet_Cell_Change_Order_t, 2),
|
||||
M_TYPE (Packet_Cell_Change_Order_t, u.Target_Cell_GSM, Target_Cell_GSM_t),
|
||||
M_TYPE (Packet_Cell_Change_Order_t, u.Target_Cell_3G, Target_Cell_3G_t),
|
||||
|
||||
M_PADDING_BITS(Packet_Cell_Change_Order_t),
|
||||
CSN_DESCR_END (Packet_Cell_Change_Order_t)
|
||||
|
||||
/*< Packet (Enhanced) Measurement Report message contents > */
|
||||
|
@ -3496,6 +3548,8 @@ CSN_DESCR_BEGIN (Packet_Measurement_Report_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL(Packet_Measurement_Report_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (Packet_Measurement_Report_t, AdditionsR99, PMR_AdditionsR99_t),
|
||||
|
||||
M_PADDING_BITS (Packet_Measurement_Report_t),
|
||||
CSN_DESCR_END (Packet_Measurement_Report_t)
|
||||
|
||||
static const
|
||||
|
@ -3546,6 +3600,8 @@ CSN_DESCR_BEGIN (Packet_Enh_Measurement_Report_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL(Packet_Enh_Measurement_Report_t, Exist_AdditionsR5, 1),
|
||||
M_TYPE (Packet_Enh_Measurement_Report_t, AdditionsR5, PEMR_AdditionsR5_t),
|
||||
|
||||
M_PADDING_BITS(Packet_Enh_Measurement_Report_t),
|
||||
CSN_DESCR_END (Packet_Enh_Measurement_Report_t)
|
||||
|
||||
/*< Packet Measurement Order message contents >*/
|
||||
|
@ -3579,6 +3635,8 @@ CSN_DESCR_BEGIN (Packet_Measurement_Order_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL (Packet_Measurement_Order_t, Exist_AdditionsR98, 1),
|
||||
M_TYPE (Packet_Measurement_Order_t, AdditionsR98, PMO_AdditionsR98_t),
|
||||
|
||||
M_PADDING_BITS (Packet_Measurement_Order_t),
|
||||
CSN_DESCR_END (Packet_Measurement_Order_t)
|
||||
|
||||
static const
|
||||
|
@ -3724,6 +3782,8 @@ CSN_DESCR_BEGIN(Packet_Cell_Change_Notification_t)
|
|||
|
||||
M_NEXT_EXIST_OR_NULL(Packet_Cell_Change_Notification_t, Exist_AdditionsR6, 1),
|
||||
M_TYPE (Packet_Cell_Change_Notification_t, AdditionsR6, PCCN_AdditionsR6_t),
|
||||
|
||||
M_PADDING_BITS(Packet_Cell_Change_Notification_t),
|
||||
CSN_DESCR_END (Packet_Cell_Change_Notification_t)
|
||||
|
||||
/*< Packet Cell Change Continue message contents > */
|
||||
|
@ -3738,6 +3798,8 @@ CSN_DESCR_BEGIN(Packet_Cell_Change_Continue_t)
|
|||
M_UINT (Packet_Cell_Change_Continue_t, ARFCN, 10),
|
||||
M_UINT (Packet_Cell_Change_Continue_t, BSIC, 6),
|
||||
M_UINT (Packet_Cell_Change_Continue_t, CONTAINER_ID, 2),
|
||||
|
||||
M_PADDING_BITS(Packet_Cell_Change_Continue_t),
|
||||
CSN_DESCR_END (Packet_Cell_Change_Continue_t)
|
||||
|
||||
/*< Packet Neighbour Cell Data message contents > */
|
||||
|
@ -3777,6 +3839,7 @@ CSN_DESCR_BEGIN(Packet_Neighbour_Cell_Data_t)
|
|||
M_UINT (Packet_Neighbour_Cell_Data_t, CONTAINER_INDEX, 5),
|
||||
|
||||
M_TYPE (Packet_Neighbour_Cell_Data_t, Container, PNCDContainer_t),
|
||||
M_PADDING_BITS(Packet_Neighbour_Cell_Data_t),
|
||||
CSN_DESCR_END (Packet_Neighbour_Cell_Data_t)
|
||||
|
||||
/*< Packet Serving Cell Data message contents > */
|
||||
|
@ -3790,6 +3853,7 @@ CSN_DESCR_BEGIN(Packet_Serving_Cell_Data_t)
|
|||
M_UINT (Packet_Serving_Cell_Data_t, spare, 4),
|
||||
M_UINT (Packet_Serving_Cell_Data_t, CONTAINER_INDEX, 5),
|
||||
M_UINT_ARRAY (Packet_Serving_Cell_Data_t, CONTAINER, 8, 19),/* 8*19 bits */
|
||||
M_PADDING_BITS(Packet_Serving_Cell_Data_t),
|
||||
CSN_DESCR_END (Packet_Serving_Cell_Data_t)
|
||||
|
||||
|
||||
|
@ -4033,6 +4097,8 @@ CSN_DESCR_BEGIN(Packet_Handover_Command_t)
|
|||
M_TYPE (Packet_Handover_Command_t, u.PS_HandoverTo_UTRAN_Payload, PS_HandoverTo_UTRAN_Payload_t),
|
||||
CSN_ERROR (Packet_Handover_Command_t, "10 <extension> not implemented", CSN_ERROR_STREAM_NOT_SUPPORTED),
|
||||
CSN_ERROR (Packet_Handover_Command_t, "11 <extension> not implemented", CSN_ERROR_STREAM_NOT_SUPPORTED),
|
||||
|
||||
M_PADDING_BITS(Packet_Handover_Command_t),
|
||||
CSN_DESCR_END (Packet_Handover_Command_t)
|
||||
|
||||
/*< End Packet Handover Command >*/
|
||||
|
@ -4047,6 +4113,7 @@ CSN_DESCR_BEGIN(Packet_PhysicalInformation_t)
|
|||
M_TYPE (Packet_PhysicalInformation_t, Global_TFI, Global_TFI_t),
|
||||
|
||||
M_UINT (Packet_PhysicalInformation_t, TimingAdvance, 8),
|
||||
M_PADDING_BITS(Packet_PhysicalInformation_t),
|
||||
CSN_DESCR_END (Packet_PhysicalInformation_t)
|
||||
|
||||
/*< End Packet Physical Information > */
|
||||
|
@ -4077,6 +4144,7 @@ CSN_DESCR_BEGIN (Additional_MS_Rad_Access_Cap_t)
|
|||
|
||||
M_TYPE (Additional_MS_Rad_Access_Cap_t, ID, AdditionalMsRadAccessCapID_t),
|
||||
M_TYPE (Additional_MS_Rad_Access_Cap_t, MS_Radio_Access_capability, MS_Radio_Access_capability_t),
|
||||
M_PADDING_BITS (Additional_MS_Rad_Access_Cap_t),
|
||||
CSN_DESCR_END (Additional_MS_Rad_Access_Cap_t)
|
||||
|
||||
|
||||
|
@ -4090,6 +4158,7 @@ CSN_DESCR_BEGIN (Packet_Pause_t)
|
|||
M_UINT (Packet_Pause_t, MESSAGE_TYPE, 2),
|
||||
M_UINT (Packet_Pause_t, TLLI, 32),
|
||||
M_BITMAP (Packet_Pause_t, RAI, 48),
|
||||
M_PADDING_BITS (Packet_Pause_t),
|
||||
CSN_DESCR_END (Packet_Pause_t)
|
||||
|
||||
|
||||
|
@ -4135,6 +4204,8 @@ CSN_DESCR_BEGIN(PSI1_t)
|
|||
|
||||
M_NEXT_EXIST (PSI1_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (PSI1_t, AdditionsR99, PSI1_AdditionsR99_t),
|
||||
|
||||
M_PADDING_BITS(PSI1_t),
|
||||
CSN_DESCR_END (PSI1_t)
|
||||
/*< End Packet System Information Type 1 message content >*/
|
||||
|
||||
|
@ -4240,6 +4311,7 @@ CSN_DESCR_BEGIN(PSI2_t)
|
|||
M_TYPE (PSI2_t, Cell_Allocation, Cell_Allocation_t),
|
||||
M_REC_TARRAY (PSI2_t, GPRS_MA[0], PSI2_MA_t, Count_GPRS_MA),
|
||||
M_REC_TARRAY (PSI2_t, PCCCH_Description[0], PCCCH_Description_t, Count_PCCCH_Description),
|
||||
M_PADDING_BITS(PSI2_t),
|
||||
CSN_DESCR_END (PSI2_t)
|
||||
/*< End Packet System Information Type 2 message content >*/
|
||||
|
||||
|
@ -4364,6 +4436,8 @@ CSN_DESCR_BEGIN(PSI3_t)
|
|||
|
||||
M_NEXT_EXIST (PSI3_t, Exist_AdditionR98, 1),
|
||||
M_TYPE (PSI3_t, AdditionR98, PSI3_AdditionR98_t),
|
||||
|
||||
M_PADDING_BITS(PSI3_t),
|
||||
CSN_DESCR_END (PSI3_t)
|
||||
/*< End Packet System Information Type 3 message content >*/
|
||||
|
||||
|
@ -4472,6 +4546,8 @@ CSN_DESCR_BEGIN(PSI5_t)
|
|||
|
||||
M_NEXT_EXIST (PSI5_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (PSI5_t, AdditionsR99, PSI5_AdditionsR99),
|
||||
|
||||
M_PADDING_BITS(PSI5_t),
|
||||
CSN_DESCR_END (PSI5_t)
|
||||
/*< End Packet System Information Type 5 message content >*/
|
||||
|
||||
|
@ -4515,6 +4591,8 @@ CSN_DESCR_BEGIN(PSI13_t)
|
|||
|
||||
M_NEXT_EXIST (PSI13_t, Exist_AdditionsR99, 1),
|
||||
M_TYPE (PSI13_t, AdditionsR99, PSI13_AdditionR99),
|
||||
|
||||
M_PADDING_BITS(PSI13_t),
|
||||
CSN_DESCR_END (PSI13_t)
|
||||
/*< End Packet System Information Type 13 message content >*/
|
||||
|
||||
|
@ -4732,7 +4810,7 @@ void decode_gsm_rlcmac_uplink(bitvec * vector, RlcMacUplink_t * data)
|
|||
LOGPC(DRLCMACDATA, LOGL_NOTICE, "Payload Type: RESERVED (3)");
|
||||
return;
|
||||
}
|
||||
data->NrOfBits = (23 - 1) * 8;
|
||||
data->NrOfBits = 23 * 8;
|
||||
csnStreamInit(&ar, 0, data->NrOfBits);
|
||||
readIndex += 6;
|
||||
data->u.MESSAGE_TYPE = bitvec_read_field(vector, readIndex, 6);
|
||||
|
@ -5017,7 +5095,7 @@ void encode_gsm_rlcmac_uplink(bitvec * vector, RlcMacUplink_t * data)
|
|||
{
|
||||
csnStream_t ar;
|
||||
unsigned writeIndex = 0;
|
||||
data->NrOfBits = (23 - 1) * 8;
|
||||
data->NrOfBits = 23 * 8;
|
||||
csnStreamInit(&ar, 0, data->NrOfBits);
|
||||
writeIndex = 0;
|
||||
switch (data->u.MESSAGE_TYPE)
|
||||
|
|
|
@ -454,9 +454,6 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
gboolean Exist_LENGTH;
|
||||
guint8 LENGTH;
|
||||
|
||||
guint8 FINAL_ACK_INDICATION;
|
||||
guint8 BEGINNING_OF_WINDOW;
|
||||
guint8 END_OF_WINDOW;
|
||||
|
@ -469,8 +466,20 @@ typedef struct
|
|||
|
||||
guint16 URBB_LENGTH;
|
||||
guint8 URBB[URBB_MAX_BITS/8];
|
||||
} EGPRS_AckNack_Desc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint8 UnionType;
|
||||
EGPRS_AckNack_Desc_t Desc;
|
||||
} EGPRS_AckNack_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guint8 LENGTH;
|
||||
EGPRS_AckNack_Desc_t Desc;
|
||||
} EGPRS_AckNack_w_len_t;
|
||||
|
||||
|
||||
/* <P1 Rest Octets>
|
||||
* <P2 Rest Octets>
|
||||
|
|
Loading…
Reference in New Issue