diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-09 13:43:44 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-08-10 21:39:20 +0000 |
commit | 3635d7bed70aaf14e8172654f2b40be318e7dbfe (patch) | |
tree | 4b0fce1dba327df9a24b4ddc267a83375c817683 /epan/dissectors/packet-iax2.c | |
parent | 18346c84778019fe6eee6906758daa120f84d5d0 (diff) |
Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.
Change-Id: Ib76f4a9f89b5933425760af0a980c6a549031b8f
Reviewed-on: https://code.wireshark.org/review/3537
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-iax2.c')
-rw-r--r-- | epan/dissectors/packet-iax2.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c index 843e5e2658..43050b7a0b 100644 --- a/epan/dissectors/packet-iax2.c +++ b/epan/dissectors/packet-iax2.c @@ -116,6 +116,8 @@ static int hf_iax2_trunk_call_scallno = -1; static int hf_iax2_trunk_call_ts = -1; static int hf_iax2_trunk_call_data = -1; +static int hf_iax2_ie_id = -1; +static int hf_iax2_length = -1; static int hf_iax2_cap_g723_1 = -1; static int hf_iax2_cap_gsm = -1; static int hf_iax2_cap_ulaw = -1; @@ -140,6 +142,8 @@ static int hf_iax2_cap_h263_plus = -1; static int hf_iax2_cap_h264 = -1; static int hf_iax2_cap_mpeg4 = -1; +static int hf_iax2_fragment_unfinished = -1; +static int hf_iax2_payload_data = -1; static int hf_iax2_fragments = -1; static int hf_iax2_fragment = -1; static int hf_iax2_fragment_overlap = -1; @@ -1323,11 +1327,8 @@ static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, ies_tree = proto_tree_add_subtree(iax_tree, tvb, offset, ies_len+2, ett_iax2_ie, &ti, " "); - proto_tree_add_text(ies_tree, tvb, offset, 1, "IE id: %s (0x%02X)", - val_to_str_ext_const(ies_type, &iax_ies_type_ext, "Unknown"), - ies_type); - - proto_tree_add_text(ies_tree, tvb, offset + 1, 1, "Length: %u", ies_len); + proto_tree_add_uint(ies_tree, hf_iax2_ie_id, tvb, offset, 1, ies_type); + proto_tree_add_uint(ies_tree, hf_iax2_length, tvb, offset + 1, 1, ies_len); /* hf_iax2_ies[] is an array, indexed by IE number, of header-fields, one @@ -2362,8 +2363,7 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr PROTO_ITEM_SET_GENERATED(iax_tree_item); } else { /* this fragment is never reassembled */ - proto_tree_add_text(tree, tvb, deseg_offset, -1, - "IAX2 fragment, unfinished"); + proto_tree_add_item(tree, hf_iax2_fragment_unfinished, tvb, deseg_offset, -1, ENC_NA); } if (pinfo->desegment_offset == 0) { @@ -2413,9 +2413,7 @@ static void dissect_payload(tvbuff_t *tvb, guint32 offset, } nbytes = tvb_reported_length(sub_tvb); - proto_tree_add_text(iax2_tree, sub_tvb, 0, -1, - "IAX2 payload (%u byte%s)", nbytes, - plurality(nbytes, "", "s")); + proto_tree_add_item(iax2_tree, hf_iax2_payload_data, sub_tvb, 0, -1, ENC_NA); iax2_info->payload_len = nbytes; iax2_info->payload_data = tvb_get_ptr(sub_tvb, 0, -1); @@ -2978,6 +2976,16 @@ proto_register_iax2(void) FT_STRING, BASE_NONE, NULL, 0x0, "Raw data for unknown IEs", HFILL}}, + {&hf_iax2_ie_id, + {"IE id", "iax2.ie_id", + FT_UINT8, BASE_DEC|BASE_EXT_STRING, &iax_ies_type_ext, 0x0, + NULL, HFILL}}, + + {&hf_iax2_length, + {"Length", "iax2.length", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL}}, + /* capabilities */ {&hf_iax2_cap_g723_1, {"G.723.1 compression", "iax2.cap.g723_1", @@ -3094,6 +3102,16 @@ proto_register_iax2(void) FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_MP4_VIDEO, NULL, HFILL }}, + {&hf_iax2_fragment_unfinished, + {"IAX2 fragment, unfinished", "iax2.fragment_unfinished", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + {&hf_iax2_payload_data, + {"IAX2 payload", "iax2.payload_data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + /* reassembly stuff */ {&hf_iax2_fragments, {"IAX2 Fragments", "iax2.fragments", |