diff options
Diffstat (limited to 'plugins/docsis/packet-dsarsp.c')
-rw-r--r-- | plugins/docsis/packet-dsarsp.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/plugins/docsis/packet-dsarsp.c b/plugins/docsis/packet-dsarsp.c index eb31168b15..5d85ed326e 100644 --- a/plugins/docsis/packet-dsarsp.c +++ b/plugins/docsis/packet-dsarsp.c @@ -46,34 +46,23 @@ static int dissect_dsarsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_) { proto_item *it; - proto_tree *dsarsp_tree = NULL; - guint16 transid; - guint8 response; + proto_tree *dsarsp_tree; + guint32 transid, response; tvbuff_t *next_tvb; - transid = tvb_get_ntohs (tvb, 0); - response = tvb_get_guint8 (tvb, 2); + it = proto_tree_add_item (tree, proto_docsis_dsarsp, tvb, 0, -1, ENC_NA); + dsarsp_tree = proto_item_add_subtree (it, ett_docsis_dsarsp); + proto_tree_add_item_ret_uint (dsarsp_tree, hf_docsis_dsarsp_tranid, tvb, 0, 2, ENC_BIG_ENDIAN, &transid); + proto_tree_add_item_ret_uint (dsarsp_tree, hf_docsis_dsarsp_response, tvb, 2, 1, ENC_BIG_ENDIAN, &response); col_add_fstr (pinfo->cinfo, COL_INFO, "Dynamic Service Add Response ID = %u (%s)", transid, val_to_str (response, docsis_conf_code, "%d")); - if (tree) - { - it = - proto_tree_add_protocol_format (tree, proto_docsis_dsarsp, tvb, 0, -1, - "DSA Response"); - dsarsp_tree = proto_item_add_subtree (it, ett_docsis_dsarsp); - proto_tree_add_item (dsarsp_tree, hf_docsis_dsarsp_tranid, tvb, 0, 2, - ENC_BIG_ENDIAN); - proto_tree_add_item (dsarsp_tree, hf_docsis_dsarsp_response, tvb, 2, 1, - ENC_BIG_ENDIAN); - } - - /* Call dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset_remaining (tvb, 3); - call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsarsp_tree); - return tvb_captured_length(tvb); + /* Call dissector for Appendix C TLV's */ + next_tvb = tvb_new_subset_remaining (tvb, 3); + call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsarsp_tree); + return tvb_captured_length(tvb); } /* Register the protocol with Wireshark */ |