aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dap.c
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 /epan/dissectors/packet-dap.c
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 'epan/dissectors/packet-dap.c')
-rw-r--r--epan/dissectors/packet-dap.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/epan/dissectors/packet-dap.c b/epan/dissectors/packet-dap.c
index 12da234f02..c05e810db7 100644
--- a/epan/dissectors/packet-dap.c
+++ b/epan/dissectors/packet-dap.c
@@ -34,6 +34,7 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
+#include <epan/expert.h>
#include <epan/oids.h>
#include <epan/asn1.h>
@@ -480,7 +481,7 @@ static int hf_dap_SearchControlOptions_separateFamilyMembers = -1;
static int hf_dap_SearchControlOptions_searchFamily = -1;
/*--- End of included file: packet-dap-hf.c ---*/
-#line 66 "../../asn1/dap/packet-dap-template.c"
+#line 67 "../../asn1/dap/packet-dap-template.c"
/* Initialize the subtree pointers */
static gint ett_dap = -1;
@@ -659,7 +660,9 @@ static gint ett_dap_UpdateError = -1;
static gint ett_dap_T_signedUpdateError = -1;
/*--- End of included file: packet-dap-ett.c ---*/
-#line 70 "../../asn1/dap/packet-dap-template.c"
+#line 71 "../../asn1/dap/packet-dap-template.c"
+
+static expert_field ei_dap_anonymous = EI_INIT;
/*--- Included file: packet-dap-val.h ---*/
@@ -684,7 +687,7 @@ static gint ett_dap_T_signedUpdateError = -1;
#define id_errcode_dsaReferral 9
/*--- End of included file: packet-dap-val.h ---*/
-#line 72 "../../asn1/dap/packet-dap-template.c"
+#line 75 "../../asn1/dap/packet-dap-template.c"
/*--- Included file: packet-dap-table.c ---*/
@@ -722,7 +725,7 @@ static const value_string dap_err_code_string_vals[] = {
/*--- End of included file: packet-dap-table.c ---*/
-#line 74 "../../asn1/dap/packet-dap-template.c"
+#line 77 "../../asn1/dap/packet-dap-template.c"
/*--- Included file: packet-dap-fn.c ---*/
@@ -2064,7 +2067,7 @@ dissect_dap_DirectoryBindArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
if(len == 0) {
/* its an empty set - i.e anonymous (assuming version is DEFAULTed) */
- proto_tree_add_text(tree, tvb, offset, -1,"Anonymous");
+ proto_tree_add_expert(tree, actx->pinfo, &ei_dap_anonymous, tvb, offset, -1);
col_append_str(actx->pinfo->cinfo, COL_INFO, " anonymous");
@@ -4772,7 +4775,7 @@ static int dissect_UpdateError_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
/*--- End of included file: packet-dap-fn.c ---*/
-#line 76 "../../asn1/dap/packet-dap-template.c"
+#line 79 "../../asn1/dap/packet-dap-template.c"
/*--- Included file: packet-dap-table11.c ---*/
@@ -4804,7 +4807,7 @@ static const ros_opr_t dap_opr_tab[] = {
/*--- End of included file: packet-dap-table11.c ---*/
-#line 78 "../../asn1/dap/packet-dap-template.c"
+#line 81 "../../asn1/dap/packet-dap-template.c"
/*--- Included file: packet-dap-table21.c ---*/
#line 1 "../../asn1/dap/packet-dap-table21.c"
@@ -4833,7 +4836,7 @@ static const ros_err_t dap_err_tab[] = {
/*--- End of included file: packet-dap-table21.c ---*/
-#line 79 "../../asn1/dap/packet-dap-template.c"
+#line 82 "../../asn1/dap/packet-dap-template.c"
static const ros_info_t dap_ros_info = {
"DAP",
@@ -6473,7 +6476,7 @@ void proto_register_dap(void) {
NULL, HFILL }},
/*--- End of included file: packet-dap-hfarr.c ---*/
-#line 98 "../../asn1/dap/packet-dap-template.c"
+#line 101 "../../asn1/dap/packet-dap-template.c"
};
/* List of subtrees */
@@ -6654,9 +6657,15 @@ void proto_register_dap(void) {
&ett_dap_T_signedUpdateError,
/*--- End of included file: packet-dap-ettarr.c ---*/
-#line 104 "../../asn1/dap/packet-dap-template.c"
+#line 107 "../../asn1/dap/packet-dap-template.c"
};
+
+ static ei_register_info ei[] = {
+ { &ei_dap_anonymous, { "dap.anonymous", PI_PROTOCOL, PI_NOTE, "Anonymous", EXPFILL }},
+ };
+
module_t *dap_module;
+ expert_module_t* expert_dap;
/* Register protocol */
proto_dap = proto_register_protocol(PNAME, PSNAME, PFNAME);
@@ -6664,6 +6673,8 @@ void proto_register_dap(void) {
/* Register fields and subtrees */
proto_register_field_array(proto_dap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ expert_dap = expert_register_protocol(proto_dap);
+ expert_register_field_array(expert_dap, ei, array_length(ei));
/* Register our configuration options for DAP, particularly our port */