aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/h225
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/h225
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/h225')
-rw-r--r--asn1/h225/h225.cnf9
-rw-r--r--asn1/h225/packet-h225-template.c4
2 files changed, 10 insertions, 3 deletions
diff --git a/asn1/h225/h225.cnf b/asn1/h225/h225.cnf
index 2bece14afe..b34a6dee49 100644
--- a/asn1/h225/h225.cnf
+++ b/asn1/h225/h225.cnf
@@ -666,12 +666,13 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode
#.FN_HDR GenericIdentifier
gef_ctx_t *gefx;
+ proto_item* ti;
#.FN_FTR
gef_ctx_update_key(gef_ctx_get(actx->private_data));
- /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG GenericIdentifier: %s", gef_ctx_get(actx->private_data)->key);*/
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
- /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/
+ ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
+ PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_name_dissector_table, gefx->key, tvb_new_subset(tvb, offset>>3, 0, 0), actx->pinfo, tree, actx);
}
actx->private_data = gefx; /* subdissector could overwrite it */
@@ -699,11 +700,13 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode
#.FN_BODY Content/raw VAL_PTR = &value_tvb
tvbuff_t *value_tvb;
gef_ctx_t *gefx;
+ proto_item* ti;
%(DEFAULT_BODY)s
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
- /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/
+ ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
+ PROTO_ITEM_SET_HIDDEN(ti);
dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, %(ACTX)s);
}
#.END
diff --git a/asn1/h225/packet-h225-template.c b/asn1/h225/packet-h225-template.c
index 74b01aa89e..c2aa870d64 100644
--- a/asn1/h225/packet-h225-template.c
+++ b/asn1/h225/packet-h225-template.c
@@ -101,6 +101,7 @@ static int hf_h225_ras_req_frame = -1;
static int hf_h225_ras_rsp_frame = -1;
static int hf_h225_ras_dup = -1;
static int hf_h225_ras_deltatime = -1;
+static int hf_h225_debug_dissector_try_string = -1;
#include "packet-h225-hf.c"
@@ -226,6 +227,9 @@ void proto_register_h225(void) {
{ &hf_h225_ras_deltatime,
{ "RAS Service Response Time", "h225.ras.timedelta", FT_RELATIVE_TIME, BASE_NONE,
NULL, 0, "Timedelta between RAS-Request and RAS-Response", HFILL }},
+ { &hf_h225_debug_dissector_try_string,
+ { "*** DEBUG dissector_try_string", "h225.debug.dissector_try_string", FT_STRING, BASE_NONE,
+ NULL, 0, NULL, HFILL }},
#include "packet-h225-hfarr.c"
};