aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/goose
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-08-08 09:19:29 -0400
committerMichael Mann <mmann78@netscape.net>2014-08-09 01:57:08 +0000
commitcd02af56a1e39c66b44fd7957aff3b7b77a59e9d (patch)
tree4a3e859751bb73268115a607e9dffcec008bb411 /asn1/goose
parentbb15274a4a82fcab1c06935fa1e249f436420a02 (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/goose')
-rw-r--r--asn1/goose/packet-goose-template.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/asn1/goose/packet-goose-template.c b/asn1/goose/packet-goose-template.c
index 6f550225ef..7a80be3a92 100644
--- a/asn1/goose/packet-goose-template.c
+++ b/asn1/goose/packet-goose-template.c
@@ -47,6 +47,7 @@ static int hf_goose_reserve1 = -1;
static int hf_goose_reserve2 = -1;
static expert_field ei_goose_mal_utctime = EI_INIT;
+static expert_field ei_goose_zero_pdu = EI_INIT;
#include "packet-goose-hf.c"
@@ -97,7 +98,7 @@ dissect_goose(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
old_offset = offset;
offset = dissect_goose_GOOSEpdu(FALSE, tvb, offset, &asn1_ctx , tree, -1);
if (offset == old_offset) {
- proto_tree_add_text(tree, tvb, offset, -1, "Internal error, zero-byte GOOSE PDU");
+ proto_tree_add_expert(tree, pinfo, &ei_goose_zero_pdu, tvb, offset, -1);
return;
}
}
@@ -134,6 +135,7 @@ void proto_register_goose(void) {
static ei_register_info ei[] = {
{ &ei_goose_mal_utctime, { "goose.malformed.utctime", PI_MALFORMED, PI_WARN, "BER Error: malformed UTCTime encoding", EXPFILL }},
+ { &ei_goose_zero_pdu, { "goose.zero_pdu", PI_PROTOCOL, PI_ERROR, "Internal error, zero-byte GOOSE PDU", EXPFILL }},
};
expert_module_t* expert_goose;