aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-enip.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-07-08 21:48:36 -0400
committerAnders Broman <a.broman58@gmail.com>2017-07-11 08:41:49 +0000
commit9b3c8d4515c9a1a307c141c25fa59694391efe3a (patch)
treeb71ff7c6590321de7a9f7141f2e4f3cf39bb426b /epan/dissectors/packet-enip.c
parentd4d30faeb85c5adf39aca3ae5e52db225c88ea48 (diff)
Expand register_decode_as_next_proto to include prompt string.
Many dissectors don't have an identifier to pass to a dissector table. When using Decode As they all have a "value" function that returns 0 just so something is returned. A first step to a cleaner refactor of the functionality is to allow dissectors to provide a "prompt" function when registering Decode As with register_decode_as_next_proto() so that the text exposed in the GUI can vary, but the function that returns 0 (nothing) can be consolidated under decode as registration functionality. This casts a wider net for register_decode_as_next_proto() use. Change-Id: I2995b3c251dae70f5f529b672473d25c6288ed5c Reviewed-on: https://code.wireshark.org/review/22562 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-enip.c')
-rw-r--r--epan/dissectors/packet-enip.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index 677dc6fe1c..4ef8b0b4c1 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -724,11 +724,6 @@ static void enip_prompt(packet_info *pinfo _U_, gchar* result)
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect unidentified I/O traffic as");
}
-static gpointer enip_value(packet_info *pinfo _U_)
-{
- return 0;
-}
-
static wmem_map_t *enip_request_hashtable = NULL;
/* Return codes of function classifying packets as query/response */
@@ -4330,12 +4325,6 @@ proto_register_enip(void)
module_t *enip_module;
expert_module_t* expert_enip;
- /* Decode As handling */
- static build_valid_func enip_da_build_value[1] = {enip_value};
- static decode_as_value_t enip_da_values = {enip_prompt, 1, enip_da_build_value};
- static decode_as_t enip_da = {"enip", "ENIP I/O", "enip.io", 1, 0, &enip_da_values, NULL, NULL,
- decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
-
/* Register the protocol name and description */
proto_enip = proto_register_protocol("EtherNet/IP (Industrial Protocol)", "ENIP", "enip");
proto_enipio = proto_register_protocol("EtherNet/IP I/O", "ENIP I/O", "enip_io");
@@ -4389,8 +4378,7 @@ proto_register_enip(void)
register_conversation_filter("enip", "ENIP IO", enip_io_conv_valid, enip_io_conv_filter);
register_conversation_filter("enip", "ENIP Explicit", enip_exp_conv_valid, enip_exp_conv_filter);
- register_decode_as(&enip_da);
-
+ register_decode_as_next_proto("enip", "ENIP I/O", "enip.io", (build_label_func*)&enip_prompt);
} /* end of proto_register_enip() */