diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-08 09:19:29 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-08-09 01:57:08 +0000 |
commit | cd02af56a1e39c66b44fd7957aff3b7b77a59e9d (patch) | |
tree | 4a3e859751bb73268115a607e9dffcec008bb411 /asn1/idmp | |
parent | bb15274a4a82fcab1c06935fa1e249f436420a02 (diff) |
Eliminate (almost all) proto_tree_add_text calls from ASN.1 dissectors.
This mostly involved adding expert info capabilities to many of the dissectors so that they could correctly flag error conditions.
Only remaining proto_tree_add_text calls are in H248.cnf, which has a convoluted way of using hf_ data to make its tree.
Change-Id: I6412150c2ec1977d7fa38f3f0ed416680bdfb141
Reviewed-on: https://code.wireshark.org/review/3500
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'asn1/idmp')
-rw-r--r-- | asn1/idmp/packet-idmp-template.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/asn1/idmp/packet-idmp-template.c b/asn1/idmp/packet-idmp-template.c index a908b4b7ce..4a04124506 100644 --- a/asn1/idmp/packet-idmp-template.c +++ b/asn1/idmp/packet-idmp-template.c @@ -81,6 +81,7 @@ static int hf_idmp_fragment_error = -1; static int hf_idmp_fragment_count = -1; static int hf_idmp_reassembled_in = -1; static int hf_idmp_reassembled_length = -1; +static int hf_idmp_segment_data = -1; static gint ett_idmp_fragment = -1; static gint ett_idmp_fragments = -1; @@ -197,9 +198,7 @@ static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr idmp_length, !idmp_final); if(fd_head && fd_head->next) { - proto_tree_add_text(tree, tvb, offset, (idmp_length) ? -1 : 0, - "IDMP segment data (%u byte%s)", idmp_length, - plurality(idmp_length, "", "s")); + proto_tree_add_item(tree, hf_idmp_segment_data, tvb, offset, (idmp_length) ? -1 : 0, ENC_NA); if (idmp_final) { /* This is the last segment */ @@ -219,9 +218,8 @@ static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr col_append_fstr(pinfo->cinfo, COL_INFO, " [IDMP fragment, %u byte%s, IDMP reassembly not enabled]", idmp_length, plurality(idmp_length, "", "s")); - proto_tree_add_text(tree, tvb, offset, (idmp_length) ? -1 : 0, - "IDMP segment data (%u byte%s) (IDMP reassembly not enabled)", idmp_length, - plurality(idmp_length, "", "s")); + proto_tree_add_bytes_format_value(tree, hf_idmp_segment_data, tvb, offset, (idmp_length) ? -1 : 0, + NULL, "(IDMP reassembly not enabled)"); } } /* not reassembling - just dissect */ @@ -310,6 +308,9 @@ void proto_register_idmp(void) { &hf_idmp_reassembled_length, { "Reassembled IDMP length", "idmp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, "The total length of the reassembled payload", HFILL } }, + { &hf_idmp_segment_data, + { "IDMP segment data", "idmp.segment_data", FT_BYTES, BASE_NONE, + NULL, 0x00, NULL, HFILL } }, #include "packet-idmp-hfarr.c" }; |