aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-csn1.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-03-24 09:20:14 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-03-24 09:20:14 +0000
commit4cd37afb6c0b5743d578e2d6a240bdc988f0ff94 (patch)
tree3bada72b4e81a96b5ac1c073c0bd9826545bb6c9 /epan/dissectors/packet-csn1.c
parentbb61772be78f1d553163da1509210895b14b1bbb (diff)
From Vincent Helfre:
I updated again the csn1 dissector to associate hf_field to each element. svn path=/trunk/; revision=36306
Diffstat (limited to 'epan/dissectors/packet-csn1.c')
-rw-r--r--epan/dissectors/packet-csn1.c43
1 files changed, 9 insertions, 34 deletions
diff --git a/epan/dissectors/packet-csn1.c b/epan/dissectors/packet-csn1.c
index 18a140211b..9044f2cc11 100644
--- a/epan/dissectors/packet-csn1.c
+++ b/epan/dissectors/packet-csn1.c
@@ -234,33 +234,21 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
guint8 ui8 = tvb_get_bits8(tvb, bit_offset, no_of_bits);
pui8 = pui8DATA(data, pDescr->offset);
*pui8 = ui8;
-
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s: %d",
- decode_bits_in_field(bit_offset, no_of_bits, *pui8),
- pDescr->sz,
- *pui8);
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
}
else if (no_of_bits <= 16)
{
guint16 ui16 = tvb_get_bits16(tvb, bit_offset, no_of_bits, FALSE);
pui16 = pui16DATA(data, pDescr->offset);
*pui16 = ui16;
-
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s: %d",
- decode_bits_in_field(bit_offset, no_of_bits, *pui16),
- pDescr->sz,
- *pui16);
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
}
else if (no_of_bits <= 32)
{
guint32 ui32 = tvb_get_bits32(tvb, bit_offset, no_of_bits, FALSE);
pui32 = pui32DATA(data, pDescr->offset);
*pui32 = ui32;
-
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s: %d",
- decode_bits_in_field(bit_offset, no_of_bits, *pui32),
- pDescr->sz,
- *pui32);
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
}
else
{
@@ -343,10 +331,8 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
guint8 ui8 = tvb_get_masked_bits8(tvb, bit_offset, no_of_bits);
pui8 = pui8DATA(data, pDescr->offset);
*pui8 = ui8;
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s",
- decode_bits_in_field(bit_offset, no_of_bits, tvb_get_bits8(tvb, bit_offset, no_of_bits)),
- pDescr->sz);
}
else
{/* Maybe we should support more than 8 bits ? */
@@ -431,7 +417,7 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
else if (pDescr->type == CSN_VARIABLE_TARRAY_OFFSET)
{ /* Count specified in field */
nCount = *pui8DATA(data, pDescr->i);
- /* nCount--; Offset 1 -- except that the 1 offset is already taken into account in CSN_UINT_OFFSET */
+ /* nCount--; the 1 offset is already taken into account in CSN_UINT_OFFSET */
}
while (nCount > 0)
@@ -698,10 +684,7 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
guint8 ui8 = tvb_get_bits8(tvb, bit_offset, no_of_bits);
pui8 = pui8DATA(data, pDescr->offset);
*pui8 = ui8;
-
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s",
- decode_bits_in_field(bit_offset, no_of_bits, *pui8),
- pDescr->sz);
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
}
else if (no_of_bits <= 16)
@@ -709,20 +692,14 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
guint16 ui16 = tvb_get_bits16(tvb, bit_offset, no_of_bits, FALSE);
pui16 = pui16DATA(data, pDescr->offset);
*pui16 = ui16;
-
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s",
- decode_bits_in_field(bit_offset, no_of_bits, *pui16),
- pDescr->sz);
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
}
else if (no_of_bits <= 32)
{
guint32 ui32 = tvb_get_bits32(tvb, bit_offset, no_of_bits, FALSE);
pui32 = pui32DATA(data, pDescr->offset);
*pui32 = ui32;
-
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s",
- decode_bits_in_field(bit_offset, no_of_bits, *pui32),
- pDescr->sz);
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
}
else
@@ -799,9 +776,7 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t
guint8 ui8 = tvb_get_masked_bits8(tvb, bit_offset, no_of_bits);
pui8 = pui8DATA(data, pDescr->offset);
*pui8 = ui8;
- item = proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s",
- decode_bits_in_field(bit_offset, no_of_bits, *pui8),
- pDescr->sz);
+ proto_tree_add_bits_item(tree, *(pDescr->serialize.hf_ptr), tvb, bit_offset, no_of_bits, FALSE);
}
else
{ /* Maybe we should support more than 8 bits ? */