aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tetra.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-06-12 03:33:44 +0000
committerMichael Mann <mmann78@netscape.net>2013-06-12 03:33:44 +0000
commit93be0fb393fb97016a188d0cb51dc4cba1cfec1d (patch)
tree6213793581988388de5f6540fe4cb0e4bd800bad /epan/dissectors/packet-tetra.c
parent66a7193699152461181bb742163fd386019cb986 (diff)
Batch of filterable expert infos with some minor cleanup I noticed while doing the filter conversions.
svn path=/trunk/; revision=49893
Diffstat (limited to 'epan/dissectors/packet-tetra.c')
-rw-r--r--epan/dissectors/packet-tetra.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/epan/dissectors/packet-tetra.c b/epan/dissectors/packet-tetra.c
index bfd3572aae..049e35f30c 100644
--- a/epan/dissectors/packet-tetra.c
+++ b/epan/dissectors/packet-tetra.c
@@ -974,6 +974,8 @@ static gint ett_tetra_Modify_type = -1;
/*--- End of included file: packet-tetra-ett.c ---*/
#line 96 "../../asn1/tetra/packet-tetra-template.c"
+static expert_field ei_tetra_channels_incorrect = EI_INIT;
+
/*--- Included file: packet-tetra-fn.c ---*/
#line 1 "../../asn1/tetra/packet-tetra-fn.c"
@@ -8774,7 +8776,7 @@ static void dissect_MAC_ACCESS_DEFINE_PDU(tvbuff_t *tvb _U_, packet_info *pinfo
/*--- End of included file: packet-tetra-fn.c ---*/
-#line 98 "../../asn1/tetra/packet-tetra-template.c"
+#line 100 "../../asn1/tetra/packet-tetra-template.c"
static const value_string channeltypenames[] = {
{ 0, "Reserved" },
@@ -9022,8 +9024,7 @@ static void dissect_tetra_UNITDATA_IND(tvbuff_t *tvb, packet_info *pinfo, proto_
tetra_sub_item = proto_tree_add_uint( tetra_tree, hf_tetra_channels, tvb, offset, 4, channels );
tetra_header_tree = proto_item_add_subtree(tetra_sub_item, ett_tetra);
if (channels > 3) {
- expert_add_info_format(pinfo, tetra_sub_item, PI_MALFORMED, PI_WARN,
- "Channel count incorrect, must be <= 3");
+ expert_add_info(pinfo, tetra_sub_item, &ei_tetra_channels_incorrect);
channels = 3;
}
@@ -9083,8 +9084,7 @@ void dissect_tetra_UNITDATA_REQ(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
txreg >>= 4;
if (channels > 3) {
- expert_add_info_format(pinfo, tetra_sub_item, PI_MALFORMED, PI_WARN,
- "Channel count incorrect, must be <= 3");
+ expert_add_info(pinfo, tetra_sub_item, &ei_tetra_channels_incorrect);
channels = 3;
}
@@ -9242,7 +9242,8 @@ void proto_reg_handoff_tetra(void)
void proto_register_tetra (void)
{
- module_t *per_module;
+ module_t *tetra_module;
+ expert_module_t* expert_tetra;
/*
* A header field is something you can search/filter on.
@@ -11674,7 +11675,7 @@ void proto_register_tetra (void)
"T_simplex_duplex_selection_05", HFILL }},
/*--- End of included file: packet-tetra-hfarr.c ---*/
-#line 625 "../../asn1/tetra/packet-tetra-template.c"
+#line 626 "../../asn1/tetra/packet-tetra-template.c"
};
/* List of subtrees */
@@ -11959,20 +11960,22 @@ void proto_register_tetra (void)
&ett_tetra_Modify_type,
/*--- End of included file: packet-tetra-ettarr.c ---*/
-#line 635 "../../asn1/tetra/packet-tetra-template.c"
+#line 636 "../../asn1/tetra/packet-tetra-template.c"
};
- /* execute protocol initialization only once */
- if (proto_tetra != -1)
- return;
+ static ei_register_info ei[] = {
+ { &ei_tetra_channels_incorrect, { "tetra.channels.incorrect", PI_MALFORMED, PI_WARN, "Channel count incorrect, must be <= 3", EXPFILL }},
+ };
proto_tetra = proto_register_protocol("TETRA Protocol", "tetra", "tetra");
proto_register_field_array (proto_tetra, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
register_dissector("tetra", dissect_tetra, proto_tetra);
+ expert_tetra = expert_register_protocol(proto_tetra);
+ expert_register_field_array(expert_tetra, ei, array_length(ei));
- per_module = prefs_register_protocol(proto_tetra, NULL);
- prefs_register_bool_preference(per_module, "include_carrier_number",
+ tetra_module = prefs_register_protocol(proto_tetra, NULL);
+ prefs_register_bool_preference(tetra_module, "include_carrier_number",
"The data include carrier numbers",
"Whether the captured data include carrier number",
&include_carrier_number);