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;
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,
212#define CSN_DESCR_BEGIN(_STRUCT)\
213 CSN_DESCR CSNDESCR_##_STRUCT[] = {
215#define CSN_DESCR_END(_STRUCT)\
216 {CSN_END, 0, {0}, 0, false, "", NULL, 0, NULL, NULL, NULL} };
226#define CSN_ERROR(_STRUCT, _Text, _ERRCODE, _EI_ERROR)\
227 {CSN_TRAP_ERROR, _ERRCODE, {_Text}, 0, false, _Text, _EI_ERROR, 0, NULL, NULL, NULL}
236#define M_BIT(_STRUCT, _MEMBER, _HF_PTR)\
237 {CSN_BIT, 0, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
246#define M_BIT_OR_NULL(_STRUCT, _MEMBER, _HF_PTR)\
247 {CSN_BIT, 0, {0}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
257#define M_NEXT_EXIST(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
258 {CSN_NEXT_EXIST, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
267#define M_NEXT_EXIST_LH(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
268 {CSN_NEXT_EXIST_LH, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
277#define M_NEXT_EXIST_OR_NULL(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
278 {CSN_NEXT_EXIST, _NoOfExisting, {0}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
287#define M_NEXT_EXIST_OR_NULL_LH(_STRUCT, _MEMBER, _NoOfExisting, _HF_PTR)\
288 {CSN_NEXT_EXIST_LH, _NoOfExisting, {(void*)1}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
298#define M_UINT(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
299 {CSN_UINT, _BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
310#define M_SPLIT_BITS(_STRUCT, _MEMBER, _SPEC, _BITS, _HF_PTR)\
311 {CSN_SPLIT_BITS, _BITS, {_SPEC}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
321#define M_BITS_CRUMB(_STRUCT, _MEMBER, _SPEC, _SEG, _HF_PTR)\
322 {CSN_SPLIT_BITS_CRUMB, _SEG, {_SPEC}, 0, false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
331#define M_UINT_OR_NULL(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
332 {CSN_UINT, _BITS, {0}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
341#define M_UINT_LH(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
342 {CSN_UINT_LH, _BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
352#define M_UINT_OFFSET(_STRUCT, _MEMBER, _BITS, _OFFSET, _HF_PTR)\
353 {CSN_UINT_OFFSET, _BITS, {(void*)_OFFSET}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
363#define M_UINT_ARRAY(_STRUCT, _MEMBER, _BITS, _ElementCount, _HF_PTR)\
364 {CSN_UINT_ARRAY, _BITS, {(void*)_ElementCount}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
375#define M_VAR_UINT_ARRAY(_STRUCT, _MEMBER, _BITS, _ElementCountField, _HF_PTR)\
376 {CSN_UINT_ARRAY, _BITS, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 1, _HF_PTR, NULL, NULL}
386#define M_VAR_ARRAY(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
387 {CSN_VARIABLE_ARRAY, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
397#define M_VAR_TARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
398 {CSN_VARIABLE_TARRAY, offsetof(_STRUCT, _ElementCountField), {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), NULL, NULL, NULL}
404#define M_VAR_TARRAY_OFFSET(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
405 {CSN_VARIABLE_TARRAY_OFFSET, offsetof(_STRUCT, _ElementCountField), {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), NULL, NULL, NULL}
423#define M_REC_ARRAY(_STRUCT, _MEMBER, _ElementCountField, _BITS, _HF_PTR, _HF_PTR_EXIST)\
424 {CSN_RECURSIVE_ARRAY, _BITS, {(const void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, _HF_PTR_EXIST, NULL}
434#define M_TYPE_ARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCount)\
435 {CSN_TYPE_ARRAY, _ElementCount, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, sizeof(_MEMBER_TYPE), NULL, NULL, NULL}
446#define M_REC_TARRAY(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField, _HF_PTR)\
447 {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)}
454#define M_REC_TARRAY_1(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField, _HF_PTR)\
455 {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)}
462#define M_REC_TARRAY_2(_STRUCT, _MEMBER, _MEMBER_TYPE, _ElementCountField)\
463 {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)}
473#define M_TYPE(_STRUCT, _MEMBER, _MEMBER_TYPE)\
474 {CSN_TYPE, 0, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, NULL, NULL, NULL}
483#define M_TYPE_OR_NULL(_STRUCT, _MEMBER, _MEMBER_TYPE)\
484 {CSN_TYPE, 0, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), true, #_MEMBER, NULL, 0, NULL, NULL, NULL}
496#define M_TYPE_LABEL(_STRUCT, _MEMBER, _MEMBER_TYPE, _LABEL)\
497 {CSN_TYPE, 0, {(const void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), false, _LABEL, NULL, 0, NULL, NULL, NULL}
509#define M_UNION(_STRUCT, _COUNT, _HF_PTR)\
510 {CSN_UNION, _COUNT, {0}, offsetof(_STRUCT, UnionType), false, "UnionType", NULL, 0, _HF_PTR, NULL, NULL}
516#define M_UNION_LH(_STRUCT, _COUNT, _HF_PTR)\
517 {CSN_UNION_LH, _COUNT, {0}, offsetof(_STRUCT, UnionType), false, "UnionType", NULL, 0, _HF_PTR, NULL, NULL}
545#define M_CHOICE(_STRUCT, _MEMBER, _CHOICE, _ElementCount, _HF_PTR)\
546 {CSN_CHOICE, _ElementCount, {(const void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), false, #_CHOICE, NULL, 0, _HF_PTR, NULL, NULL}
553#define M_CHOICE_IL(_STRUCT, _MEMBER, _CHOICE, _ElementCount, _HF_PTR)\
554 {CSN_CHOICE, _ElementCount, {(const void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), false, NULL, NULL, 0, _HF_PTR, NULL, NULL}
565#define M_FIXED(_STRUCT, _BITS, _BITVALUE, _HF_PTR)\
566 {CSN_FIXED, _BITS, {0}, _BITVALUE, false, #_BITVALUE, NULL, 0, _HF_PTR, NULL, NULL}
577#define M_FIXED_LABEL(_STRUCT, _BITS, _BITVALUE, _LABEL, _HF_PTR)\
578 {CSN_FIXED, _BITS, {0}, _BITVALUE, false, _LABEL, NULL, 0, _HF_PTR, NULL, NULL}
590#define M_SERIALIZE(_STRUCT, _MEMBER, _LENGTH_LEN, _HF_PTR, _SERIALIZEFCN)\
591 {CSN_SERIALIZE, _LENGTH_LEN, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, (void_fn_t)_SERIALIZEFCN}
593#define M_CALLBACK(_STRUCT, _CSNCALLBACKFCN, _PARAM1, _PARAM2)\
594 {CSN_CALLBACK, offsetof(_STRUCT, _PARAM1), {0}, offsetof(_STRUCT, _PARAM2), false, "CallBack_"#_CSNCALLBACKFCN, NULL, 0, NULL, NULL, (void_fn_t)_CSNCALLBACKFCN}
604#define M_BITMAP(_STRUCT, _MEMBER, _BITS, _HF_PTR)\
605 {CSN_BITMAP, _BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
608#define M_VAR_BITMAP(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
609 {CSN_VARIABLE_BITMAP, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
615#define M_VAR_BITMAP_1(_STRUCT, _MEMBER, _ElementCountField, _OFFSET)\
616 {CSN_VARIABLE_BITMAP_1, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, NULL, NULL, NULL}
619#define M_LEFT_VAR_BMP(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
620 {CSN_LEFT_ALIGNED_VAR_BMP, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
626#define M_LEFT_VAR_BMP_1(_STRUCT, _MEMBER, _ElementCountField, _OFFSET, _HF_PTR)\
627 {CSN_LEFT_ALIGNED_VAR_BMP_1, _OFFSET, {(void*)offsetof(_STRUCT, _ElementCountField)}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, _HF_PTR, NULL, NULL}
630#define M_PADDING_BITS(_STRUCT, _HF_PTR)\
631 {CSN_PADDING_BITS, 0, {0}, 0, true, "Padding", NULL, 0, _HF_PTR, NULL, NULL}
633#define M_NULL(_STRUCT, _MEMBER, _SKIP_BITS)\
634 {CSN_NULL, _SKIP_BITS, {0}, offsetof(_STRUCT, _MEMBER), false, #_MEMBER, NULL, 0, NULL, NULL, NULL}
636#define M_THIS_EXIST(_STRUCT, _HF_PTR)\
637 {CSN_EXIST, 0, {0}, offsetof(_STRUCT, Exist), false, "Exist", NULL, 0, _HF_PTR, NULL, NULL}
639#define M_THIS_EXIST_LH(_STRUCT, _HF_PTR)\
640 {CSN_EXIST_LH, 0, {0}, offsetof(_STRUCT, Exist), false, "Exist", NULL, 0, _HF_PTR, NULL, NULL}
643typedef int16_t (*CsnCallBackFcn_t)(
void* pv ,...);
645#define CSNDESCR(_FuncType) CSNDESCR_##_FuncType
Definition packet_info.h:43
Definition packet-csn1.h:184
Definition packet-csn1.h:162
Definition packet-csn1.h:48
Definition tvbuff-int.h:35