summaryrefslogtreecommitdiff
path: root/plugins/docsis/packet-rngreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/docsis/packet-rngreq.c')
-rw-r--r--plugins/docsis/packet-rngreq.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/plugins/docsis/packet-rngreq.c b/plugins/docsis/packet-rngreq.c
index 94b99ef762..2e93daa188 100644
--- a/plugins/docsis/packet-rngreq.c
+++ b/plugins/docsis/packet-rngreq.c
@@ -45,9 +45,11 @@ dissect_rngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* da
{
proto_item *it;
proto_tree *rngreq_tree;
- guint16 sid;
+ guint32 sid;
- sid = tvb_get_ntohs (tvb, 0);
+ it = proto_tree_add_item(tree, proto_docsis_rngreq, tvb, 0, -1, ENC_NA);
+ rngreq_tree = proto_item_add_subtree (it, ett_docsis_rngreq);
+ proto_tree_add_item_ret_uint (rngreq_tree, hf_docsis_rngreq_sid, tvb, 0, 2, ENC_BIG_ENDIAN, &sid);
if (sid > 0)
col_add_fstr (pinfo->cinfo, COL_INFO, "Ranging Request: SID = %u",
@@ -55,20 +57,10 @@ dissect_rngreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* da
else
col_set_str(pinfo->cinfo, COL_INFO, "Initial Ranging Request SID = 0");
- if (tree)
- {
- it =
- proto_tree_add_protocol_format (tree, proto_docsis_rngreq, tvb, 0, -1,
- "Ranging Request");
- rngreq_tree = proto_item_add_subtree (it, ett_docsis_rngreq);
- proto_tree_add_item (rngreq_tree, hf_docsis_rngreq_sid, tvb, 0, 2,
- ENC_BIG_ENDIAN);
- proto_tree_add_item (rngreq_tree, hf_docsis_rngreq_down_chid, tvb, 2, 1,
- ENC_BIG_ENDIAN);
- proto_tree_add_item (rngreq_tree, hf_docsis_rngreq_pend_compl, tvb, 3,
- 1, ENC_BIG_ENDIAN);
- }
- return tvb_captured_length(tvb);
+ proto_tree_add_item (rngreq_tree, hf_docsis_rngreq_down_chid, tvb, 2, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item (rngreq_tree, hf_docsis_rngreq_pend_compl, tvb, 3, 1, ENC_BIG_ENDIAN);
+
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */