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/p1 | |
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/p1')
-rw-r--r-- | asn1/p1/packet-p1-template.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/asn1/p1/packet-p1-template.c b/asn1/p1/packet-p1-template.c index 63a5b8462d..4c5825adf8 100644 --- a/asn1/p1/packet-p1-template.c +++ b/asn1/p1/packet-p1-template.c @@ -78,6 +78,8 @@ static expert_field ei_p1_unknown_extension_attribute_type = EI_INIT; static expert_field ei_p1_unknown_standard_extension = EI_INIT; static expert_field ei_p1_unknown_built_in_content_type = EI_INIT; static expert_field ei_p1_unknown_tokendata_type = EI_INIT; +static expert_field ei_p1_unsupported_pdu = EI_INIT; +static expert_field ei_p1_zero_pdu = EI_INIT; /* Dissector tables */ static dissector_table_t p1_extension_dissector_table; @@ -271,7 +273,7 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat hf_p1_index = hf_p1_MTS_APDU_PDU; break; default: - proto_tree_add_text(tree, tvb, offset, -1,"Unsupported P1 PDU"); + proto_tree_add_expert(tree, pinfo, &ei_p1_unsupported_pdu, tvb, offset, -1); return tvb_captured_length(tvb); } @@ -281,7 +283,7 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat old_offset=offset; offset=(*p1_dissector)(FALSE, tvb, offset, &asn1_ctx , tree, hf_p1_index); if(offset == old_offset){ - proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte P1 PDU"); + proto_tree_add_expert(tree, pinfo, &ei_p1_zero_pdu, tvb, offset, -1); break; } } @@ -335,6 +337,8 @@ void proto_register_p1(void) { { &ei_p1_unknown_standard_extension, { "p1.unknown.standard_extension", PI_UNDECODED, PI_WARN, "Unknown standard-extension", EXPFILL }}, { &ei_p1_unknown_built_in_content_type, { "p1.unknown.built_in_content_type", PI_UNDECODED, PI_WARN, "P1 Unknown Content (unknown built-in content-type)", EXPFILL }}, { &ei_p1_unknown_tokendata_type, { "p1.unknown.tokendata_type", PI_UNDECODED, PI_WARN, "Unknown tokendata-type", EXPFILL }}, + { &ei_p1_unsupported_pdu, { "p1.unsupported_pdu", PI_UNDECODED, PI_WARN, "Unsupported P1 PDU", EXPFILL }}, + { &ei_p1_zero_pdu, { "p1.zero_pdu", PI_PROTOCOL, PI_ERROR, "Internal error, zero-byte P1 PDU", EXPFILL }}, }; expert_module_t* expert_p1; |