aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthci_cmd.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-bthci_cmd.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-bthci_cmd.c')
-rw-r--r--epan/dissectors/packet-bthci_cmd.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c
index efdd41623b..de6b47c1b2 100644
--- a/epan/dissectors/packet-bthci_cmd.c
+++ b/epan/dissectors/packet-bthci_cmd.c
@@ -2105,11 +2105,6 @@ static void bthci_cmd_vendor_prompt(packet_info *pinfo _U_, gchar* result)
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as");
}
-static gpointer bthci_cmd_vendor_value(packet_info *pinfo _U_)
-{
- return NULL;
-}
-
static gint dissect_coding_format(proto_tree *tree, int hf_x, tvbuff_t *tvb, gint offset, gint ett_x)
{
proto_item *sub_item;
@@ -7114,12 +7109,6 @@ proto_register_bthci_cmd(void)
&ett_pattern
};
- /* Decode As handling */
- static build_valid_func bthci_cmd_vendor_da_build_value[1] = {bthci_cmd_vendor_value};
- static decode_as_value_t bthci_cmd_vendor_da_values = {bthci_cmd_vendor_prompt, 1, bthci_cmd_vendor_da_build_value};
- static decode_as_t bthci_cmd_vendor_da = {"bthci_evt", "Vendor", "bthci_cmd.vendor", 1, 0, &bthci_cmd_vendor_da_values, NULL, NULL,
- decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
-
proto_bthci_cmd = proto_register_protocol("Bluetooth HCI Command", "HCI_CMD", "bthci_cmd");
bthci_cmd_handle = register_dissector("bthci_cmd", dissect_bthci_cmd, proto_bthci_cmd);
@@ -7139,7 +7128,7 @@ proto_register_bthci_cmd(void)
"Bluetooth HCI version: 4.0 (Core)",
"Version of protocol supported by this dissector.");
- register_decode_as(&bthci_cmd_vendor_da);
+ register_decode_as_next_proto("bthci_evt", "Vendor", "bthci_cmd.vendor", (build_label_func*)&bthci_cmd_vendor_prompt);
}