14#ifndef _PACKET_CSN1_H_
15#define _PACKET_CSN1_H_
22#define CSN_ERROR_GENERAL -1
23#define CSN_ERROR_DATA_NOT_VALID -2
24#define CSN_ERROR_IN_SCRIPT -3
25#define CSN_ERROR_INVALID_UNION_INDEX -4
26#define CSN_ERROR_NEED_MORE_BITS_TO_UNPACK -5
27#define CSN_ERROR_ILLEGAL_BIT_VALUE -6
28#define CSN_ERROR_INTERNAL -7
29#define CSN_ERROR_STREAM_NOT_SUPPORTED -8
30#define CSN_ERROR_MESSAGE_TOO_LONG -9
34typedef int16_t CSN_CallBackStatus_t;
37#define CSNCBS_NOT_OK -10
38#define CSNCBS_NOT_TO_US -11
39#define CSNCBS_NOT_COMPLETE -12
41#define CSNCBS_REVISION_LIMIT_STOP -20
42#define CSNCBS_NOT_SUPPORTED_IE -21
44typedef void(*void_fn_t)(void);
49 int remaining_bits_len;
54typedef int16_t (*StreamSerializeFcn_t)(proto_tree *tree,
csnStream_t* ar, tvbuff_t *tvb,
void* data,
int ett_csn1);
55typedef CSN_CallBackStatus_t (*DissectorCallbackFcn_t)(proto_tree *tree, tvbuff_t *tvb,
void* param1,
void* param2,
int bit_offset,
int ett_csn1,
packet_info* pinfo);
71 CSN_VARIABLE_BITMAP_1,
72 CSN_LEFT_ALIGNED_VAR_BMP,
73 CSN_LEFT_ALIGNED_VAR_BMP_1,
77 CSN_VARIABLE_TARRAY_OFFSET,
80 CSN_RECURSIVE_TARRAY_1,
81 CSN_RECURSIVE_TARRAY_2,
214int16_t csnStreamDissector(proto_tree *tree,
csnStream_t* ar,
const CSN_DESCR* pDescr, tvbuff_t *tvb,
void* data,
int ett_csn1);
217#define CSN_DESCR_BEGIN(_STRUCT)\
218 CSN_DESCR CSNDESCR_##_STRUCT[] = {
220#define CSN_DESCR_END(_STRUCT)\
221 {CSN_END, 0, {0}, 0, false, "", NULL, 0, NULL, NULL, NULL} };
231#define CSN_ERROR(_STRUCT, _Text, _ERRCODE, _EI_ERROR)\
232 {CSN_TRAP_ERROR, _ERRCODE, {_Text}, 0, false, _Text, _EI_ERROR, 0, NULL, NULL, NULL}
241#define M_BIT(_STRUCT, _MEMBER, _HF_PTR)\
242 {CSN_BIT, 0, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
251#define M_BIT_OR_NULL(_STRUCT, _MEMBER, _HF_PTR)\
252 {CSN_BIT, 0, {0}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
262#define M_NEXT_EXIST(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
263 {CSN_NEXT_EXIST, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
272#define M_NEXT_EXIST_LH(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
273 {CSN_NEXT_EXIST_LH, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
282#define M_NEXT_EXIST_OR_NULL(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
283 {CSN_NEXT_EXIST, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
292#define M_NEXT_EXIST_OR_NULL_LH(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
293 {CSN_NEXT_EXIST_LH, _NoOfExisting, {(void*)1}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
303#define M_UINT(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
304 {CSN_UINT, _BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
315#define M_SPLIT_BITS(_STRUCT, _MEMBER, _SPEC, _BITS, _HF_PTR)\
316 {CSN_SPLIT_BITS, _BITS, {_SPEC}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
326#define M_BITS_CRUMB(_STRUCT, _MEMBER, _SPEC, _SEG, _HF_PTR)\
327 {CSN_SPLIT_BITS_CRUMB, _SEG, {_SPEC}, 0, false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
336#define M_UINT_OR_NULL(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
337 {CSN_UINT, _BITS, {0}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
346#define M_UINT_LH(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
347 {CSN_UINT_LH, _BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
357#define M_UINT_OFFSET(_STRUCT, _MEMBER, _BITS, _OFFSET, _HF_PTR)\
358 {CSN_UINT_OFFSET, _BITS, {.value = _OFFSET}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
368#define M_UINT_ARRAY(_STRUCT, _MEMBER, _BITS, _ElementCount, _HF_PTR)\
369 {CSN_UINT_ARRAY, _BITS, {.value = _ElementCount}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
380#define M_VAR_UINT_ARRAY(_STRUCT, _MEMBER, _BITS, _ElementCountField, _HF_PTR)\
381 {CSN_UINT_ARRAY, _BITS, {.value = offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 1, _HF_PTR, NULL, NULL}
391#define M_VAR_ARRAY(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
392 {CSN_VARIABLE_ARRAY, _OFFSET, {.value = offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
402#define M_VAR_TARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
403 {CSN_VARIABLE_TARRAY, offsetof(_STRUCT, _ElementCountField), {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), NULL, NULL, (void_fn_t)array_length(((_STRUCT*)0)->_MEMBER)}
409#define M_VAR_TARRAY_OFFSET(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
410 {CSN_VARIABLE_TARRAY_OFFSET, offsetof(_STRUCT, _ElementCountField), {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), NULL, NULL, (void_fn_t)array_length(((_STRUCT*)0)->_MEMBER)}
428#define M_REC_ARRAY(_STRUCT, _MEMBER, _ElementCountField, _BITS, _HF_PTR, _HF_PTR_EXIST)\
429 {CSN_RECURSIVE_ARRAY, _BITS, {.value = offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, _HF_PTR_EXIST, (void_fn_t)array_length(((_STRUCT*)0)->_MEMBER)}
439#define M_TYPE_ARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCount)\
440 {CSN_TYPE_ARRAY, _ElementCount, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), NULL, NULL, NULL}
451#define M_REC_TARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField, _HF_PTR)\
452 {CSN_RECURSIVE_TARRAY, offsetof(_STRUCT, _ElementCountField), {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), _HF_PTR, NULL, (void_fn_t)array_length(((_STRUCT*)0)->_MEMBER)}
459#define M_REC_TARRAY_1(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField, _HF_PTR)\
460 {CSN_RECURSIVE_TARRAY_1, offsetof(_STRUCT, _ElementCountField), {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), _HF_PTR, NULL, (void_fn_t)array_length(((_STRUCT*)0)->_MEMBER)}
467#define M_REC_TARRAY_2(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
468 {CSN_RECURSIVE_TARRAY_2, offsetof(_STRUCT, _ElementCountField), {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), NULL, NULL, (void_fn_t)array_length(((_STRUCT*)0)->_MEMBER)}
478#define M_TYPE(_STRUCT, _MEMBER, _MEMBER_TYPE)\
479 {CSN_TYPE, 0, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, NULL, NULL, NULL}
488#define M_TYPE_OR_NULL(_STRUCT, _MEMBER, _MEMBER_TYPE)\
489 {CSN_TYPE, 0, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, NULL, NULL, NULL}
501#define M_TYPE_LABEL(_STRUCT, _MEMBER, _MEMBER_TYPE, _LABEL)\
502 {CSN_TYPE, 0, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, _LABEL, NULL, 0, NULL, NULL, NULL}
514#define M_UNION(_STRUCT, _COUNT, _HF_PTR)\
515 {CSN_UNION, _COUNT, {0}, offsetof(_STRUCT, UnionType), false, "UnionType", NULL, 0, _HF_PTR, NULL, NULL}
521#define M_UNION_LH(_STRUCT, _COUNT, _HF_PTR)\
522 {CSN_UNION_LH, _COUNT, {0}, offsetof(_STRUCT, UnionType), false, "UnionType", NULL, 0, _HF_PTR, NULL, NULL}
550#define M_CHOICE(_STRUCT, _MEMBER, _CHOICE, _ElementCount, _HF_PTR)\
551 {CSN_CHOICE, _ElementCount, {(const void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), false, #_CHOICE, NULL, 0, _HF_PTR, NULL, NULL}
558#define M_CHOICE_IL(_STRUCT, _MEMBER, _CHOICE, _ElementCount, _HF_PTR)\
559 {CSN_CHOICE, _ElementCount, {(const void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), false, NULL, NULL, 0, _HF_PTR, NULL, NULL}
570#define M_FIXED(_STRUCT, _BITS, _BITVALUE, _HF_PTR)\
571 {CSN_FIXED, _BITS, {0}, _BITVALUE, false, #_BITVALUE, NULL, 0, _HF_PTR, NULL, NULL}
582#define M_FIXED_LABEL(_STRUCT, _BITS, _BITVALUE, _LABEL, _HF_PTR)\
583 {CSN_FIXED, _BITS, {0}, _BITVALUE, false, _LABEL, NULL, 0, _HF_PTR, NULL, NULL}
595#define M_SERIALIZE(_STRUCT, _MEMBER, _LENGTH_LEN, _HF_PTR, _SERIALIZEFCN)\
596 {CSN_SERIALIZE, _LENGTH_LEN, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, (void_fn_t)_SERIALIZEFCN}
598#define M_CALLBACK(_STRUCT, _CSNCALLBACKFCN, _PARAM1, _PARAM2)\
599 {CSN_CALLBACK, offsetof(_STRUCT, _PARAM1), {0}, offsetof(_STRUCT, _PARAM2), false, "CallBack_"#_CSNCALLBACKFCN, NULL, 0, NULL, NULL, (void_fn_t)_CSNCALLBACKFCN}
609#define M_BITMAP(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
610 {CSN_BITMAP, _BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
613#define M_VAR_BITMAP(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
614 {CSN_VARIABLE_BITMAP, _OFFSET, {.value = offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
620#define M_VAR_BITMAP_1(_STRUCT, _MEMBER, _ElementCountField, _OFFSET)\
621 {CSN_VARIABLE_BITMAP_1, _OFFSET, {.value = offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, NULL, NULL, NULL}
624#define M_LEFT_VAR_BMP(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
625 {CSN_LEFT_ALIGNED_VAR_BMP, _OFFSET, {.value = offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
631#define M_LEFT_VAR_BMP_1(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
632 {CSN_LEFT_ALIGNED_VAR_BMP_1, _OFFSET, {.value = offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
635#define M_PADDING_BITS(_STRUCT, _HF_PTR)\
636 {CSN_PADDING_BITS, 0, {0}, 0, true, "Padding", NULL, 0, _HF_PTR, NULL, NULL}
638#define M_NULL(_STRUCT, _MEMBER, _SKIP_BITS)\
639 {CSN_NULL, _SKIP_BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, NULL, NULL, NULL}
641#define M_THIS_EXIST(_STRUCT, _HF_PTR)\
642 {CSN_EXIST, 0, {0}, offsetof(_STRUCT, Exist), false, "Exist", NULL, 0, _HF_PTR, NULL, NULL}
644#define M_THIS_EXIST_LH(_STRUCT, _HF_PTR)\
645 {CSN_EXIST_LH, 0, {0}, offsetof(_STRUCT, Exist), false, "Exist", NULL, 0, _HF_PTR, NULL, NULL}
648typedef int16_t (*CsnCallBackFcn_t)(
void* pv ,...);
650#define CSNDESCR(_FuncType) CSNDESCR_##_FuncType
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
Definition packet-csn1.h:189
Definition packet-csn1.h:162
This structure describes one segment of a split-bits item.
Definition proto.h:873
Definition packet-csn1.h:48
Pairs an expert info index with its associated header field index for registration and display.
Definition expert.h:41