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/ftam/packet-ftam-template.c | |
parent | bb15274a4a82fcab1c06935fa1e249f436420a02 (diff) | |
download | wireshark-cd02af56a1e39c66b44fd7957aff3b7b77a59e9d.tar.gz wireshark-cd02af56a1e39c66b44fd7957aff3b7b77a59e9d.tar.bz2 wireshark-cd02af56a1e39c66b44fd7957aff3b7b77a59e9d.zip |
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/ftam/packet-ftam-template.c')
-rw-r--r-- | asn1/ftam/packet-ftam-template.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/asn1/ftam/packet-ftam-template.c b/asn1/ftam/packet-ftam-template.c index 3c34b69f2b..7e72f40dff 100644 --- a/asn1/ftam/packet-ftam-template.c +++ b/asn1/ftam/packet-ftam-template.c @@ -30,6 +30,7 @@ #include <glib.h> #include <epan/packet.h> +#include <epan/expert.h> #include <epan/oids.h> #include <epan/asn1.h> @@ -59,6 +60,8 @@ static int hf_ftam_unstructured_binary = -1; /* ISO FTAM unstructured static gint ett_ftam = -1; #include "packet-ftam-ett.c" +static expert_field ei_ftam_zero_pdu = EI_INIT; + #include "packet-ftam-fn.c" /* @@ -104,7 +107,7 @@ dissect_ftam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) old_offset=offset; offset=dissect_ftam_PDU(FALSE, tvb, offset, &asn1_ctx, tree, -1); if(offset == old_offset){ - proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte FTAM PDU"); + proto_tree_add_expert(tree, pinfo, &ei_ftam_zero_pdu, tvb, offset, -1); break; } } @@ -131,6 +134,11 @@ void proto_register_ftam(void) { &ett_ftam, #include "packet-ftam-ettarr.c" }; + static ei_register_info ei[] = { + { &ei_ftam_zero_pdu, { "ftam.zero_pdu", PI_PROTOCOL, PI_ERROR, "Internal error, zero-byte FTAM PDU", EXPFILL }}, + }; + + expert_module_t* expert_ftam; /* Register protocol */ proto_ftam = proto_register_protocol(PNAME, PSNAME, PFNAME); @@ -138,6 +146,8 @@ void proto_register_ftam(void) { /* Register fields and subtrees */ proto_register_field_array(proto_ftam, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + expert_ftam = expert_register_protocol(proto_ftam); + expert_register_field_array(expert_ftam, ei, array_length(ei)); } |