diff options
Diffstat (limited to 'asn1/isdn-sup/packet-isdn-sup-template.c')
-rw-r--r-- | asn1/isdn-sup/packet-isdn-sup-template.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/asn1/isdn-sup/packet-isdn-sup-template.c b/asn1/isdn-sup/packet-isdn-sup-template.c index 235b3595f0..68333e5792 100644 --- a/asn1/isdn-sup/packet-isdn-sup-template.c +++ b/asn1/isdn-sup/packet-isdn-sup-template.c @@ -27,7 +27,7 @@ #include <glib.h> #include <epan/packet.h> - +#include <epan/expert.h> #include "packet-ber.h" @@ -91,6 +91,9 @@ static gint ett_isdn_sup = -1; #include "packet-isdn-sup-ett.c" +static expert_field ei_isdn_sup_unsupported_arg_type = EI_INIT; +static expert_field ei_isdn_sup_unsupported_result_type = EI_INIT; +static expert_field ei_isdn_sup_unsupported_error_type = EI_INIT; /* Preference settings default */ @@ -177,7 +180,7 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * offset = op_ptr->arg_pdu(tvb, pinfo, isdn_sup_tree, NULL); else if (tvb_reported_length_remaining(tvb, offset) > 0) { - proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ARGUMENT TYPE (ETSI Sup)"); + proto_tree_add_expert(tree, pinfo, &ei_isdn_sup_unsupported_error_type, tvb, offset, -1); offset += tvb_reported_length_remaining(tvb, offset); } @@ -226,7 +229,7 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * offset = op_ptr->res_pdu(tvb, pinfo, isdn_sup_tree, NULL); else if (tvb_reported_length_remaining(tvb, offset) > 0) { - proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED RESULT TYPE (ETSI sup)"); + proto_tree_add_expert(tree, pinfo, &ei_isdn_sup_unsupported_result_type, tvb, offset, -1); offset += tvb_reported_length_remaining(tvb, offset); } @@ -276,7 +279,7 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * offset = err_ptr->err_pdu(tvb, pinfo, isdn_sup_tree, NULL); else if (tvb_reported_length_remaining(tvb, offset) > 0) { - proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ERROR TYPE (ETSI sup)"); + proto_tree_add_expert(tree, pinfo, &ei_isdn_sup_unsupported_error_type, tvb, offset, -1); offset += tvb_reported_length_remaining(tvb, offset); } @@ -352,11 +355,20 @@ void proto_register_isdn_sup(void) { #include "packet-isdn-sup-ettarr.c" }; - /* Register fields and subtrees */ - proto_register_field_array(proto_isdn_sup, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); + static ei_register_info ei[] = { + { &ei_isdn_sup_unsupported_arg_type, { "isdn_sup.unsupported.arg_type", PI_UNDECODED, PI_WARN, "UNSUPPORTED ARGUMENT TYPE (ETSI sup)", EXPFILL }}, + { &ei_isdn_sup_unsupported_result_type, { "isdn_sup.unsupported.result_type", PI_UNDECODED, PI_WARN, "UNSUPPORTED RESULT TYPE (ETSI sup)", EXPFILL }}, + { &ei_isdn_sup_unsupported_error_type, { "isdn_sup.unsupported.error_type", PI_UNDECODED, PI_WARN, "UNSUPPORTED ERROR TYPE (ETSI sup)", EXPFILL }}, + }; + + expert_module_t* expert_isdn_sup; /* Register protocol */ proto_isdn_sup = proto_register_protocol(PNAME, PSNAME, PFNAME); + /* Register fields and subtrees */ + proto_register_field_array(proto_isdn_sup, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + expert_isdn_sup = expert_register_protocol(proto_isdn_sup); + expert_register_field_array(expert_isdn_sup, ei, array_length(ei)); } |