aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-csn1.h
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2012-02-05 08:14:09 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2012-02-05 08:14:09 +0000
commit089a7a3c69f5c0056ac6ce77566ce4019551c839 (patch)
tree6a117edfda0b071b3e90e80914784596f0244dbc /epan/dissectors/packet-csn1.h
parentd5808626c1ce9160a01ba6fa6d324dfce1aa2259 (diff)
From Sylvain Munaut:
0001-packet-csn1-Fix-indenting-of-the-CSN_UINT-subsection.patch 0002-packet-csn1-Add-new-maro-M_TYPE_LABEL-to-customize-n.patch 0003-packet-csn1-New-macro-M_FIXED_LABEL-to-customize-str.patch 0004-packet-csn1-Allow-CHOICE-elements-to-re-process-the-.patch 0005-packet-csn1-Make-new-M_CHOICE_IL-option-that-doesn-t.patch 0006-packet-csn-Extend-CSN_SERIALIZE-to-allow-0-bit-of-le.patch https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6789 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40847 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-csn1.h')
-rw-r--r--epan/dissectors/packet-csn1.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/epan/dissectors/packet-csn1.h b/epan/dissectors/packet-csn1.h
index 889afa1357..672f162750 100644
--- a/epan/dissectors/packet-csn1.h
+++ b/epan/dissectors/packet-csn1.h
@@ -192,6 +192,7 @@ typedef struct
{
guint8 bits;
guint8 value;
+ gboolean keep_bits;
CSN_DESCR descr;
} CSN_ChoiceElement_t;
@@ -457,6 +458,18 @@ gint16 csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pD
{CSN_TYPE, 0, {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, #_MEMBER, {(StreamSerializeFcn_t)0}}
/******************************************************************************
+ * M_TYPE_LABEL(Par1, Par2, Par3, Par4)
+ * Same as M_TYPE but allows to define a custom string for the subtree
+ * <list> ::= {1 <type>} ** 0 ;
+ * Par1: C structure name
+ * Par2: C structure element name
+ * Par3: type of member
+ * Par4: C string for the text
+ *****************************************************************************/
+#define M_TYPE_LABEL(_STRUCT, _MEMBER, _MEMBER_TYPE, _LABEL)\
+ {CSN_TYPE, 0, {(void*)CSNDESCR_##_MEMBER_TYPE}, offsetof(_STRUCT, _MEMBER), FALSE, _LABEL, {(StreamSerializeFcn_t)0}}
+
+/******************************************************************************
* M_UNION(Par1, Par2)
* Informs the CSN.1 library that a union follows and how many possible choices
* there are in the union. The actual value of the choice, which points out the
@@ -506,18 +519,38 @@ gint16 csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pD
{CSN_CHOICE, _ElementCount, {(void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), FALSE, #_CHOICE, {(StreamSerializeFcn_t)0}}
/******************************************************************************
+ * M_CHOICE_IL(Par1, Par2, Par3, Par4)
+ * See M_CHOICE above, but displayed inline (i.e. no specific elements are
+ * displayed to show there was a choice
+ *****************************************************************************/
+#define M_CHOICE_IL(_STRUCT, _MEMBER, _CHOICE, _ElementCount)\
+ {CSN_CHOICE, _ElementCount, {(void*)_CHOICE}, offsetof(_STRUCT, _MEMBER), FALSE, NULL, {(StreamSerializeFcn_t)0}}
+
+/******************************************************************************
* M_FIXED(Par1, Par2, Par3)
* Defines a fixed value of type integer which should be fetched from or stored
* in the message
* Par1: C structure name
* Par2: gives the length of the fixed number in bits.
* Par3: the value of the number. If the expected value is not present in
-* the message the unpacking procedure is aborted
+ * the message the unpacking procedure is aborted
*****************************************************************************/
#define M_FIXED(_STRUCT, _BITS, _BITVALUE)\
{CSN_FIXED, _BITS, {0}, _BITVALUE, FALSE, #_BITVALUE, {(StreamSerializeFcn_t)0}}
/******************************************************************************
+ * M_FIXED_LABEL(Par1, Par2, Par3, Par4)
+ * Same as M_FIXED but allows to define a custom string for the subtree
+ * Par1: C structure name
+ * Par2: gives the length of the fixed number in bits.
+ * Par3: the value of the number. If the expected value is not present in
+ * the message the unpacking procedure is aborted
+ * Par4: C string for the text
+ *****************************************************************************/
+#define M_FIXED_LABEL(_STRUCT, _BITS, _BITVALUE, _LABEL)\
+ {CSN_FIXED, _BITS, {0}, _BITVALUE, FALSE, _LABEL, {(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 encounted during encoding or decoding of a message