diff options
author | Michael Mann <mmann78@netscape.net> | 2017-07-08 21:48:36 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-07-11 08:41:49 +0000 |
commit | 9b3c8d4515c9a1a307c141c25fa59694391efe3a (patch) | |
tree | b71ff7c6590321de7a9f7141f2e4f3cf39bb426b /epan/dissectors/packet-pcli.c | |
parent | d4d30faeb85c5adf39aca3ae5e52db225c88ea48 (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-pcli.c')
-rw-r--r-- | epan/dissectors/packet-pcli.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/epan/dissectors/packet-pcli.c b/epan/dissectors/packet-pcli.c index 8dc4213329..3e35dcd1ea 100644 --- a/epan/dissectors/packet-pcli.c +++ b/epan/dissectors/packet-pcli.c @@ -208,12 +208,6 @@ pcli_prompt(packet_info *pinfo _U_, gchar* result) g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PCLI payload as"); } -static gpointer -pcli_value(packet_info *pinfo _U_) -{ - return NULL; -} - void proto_register_pcli(void) { @@ -238,18 +232,6 @@ proto_register_pcli(void) module_t *pcli_module; - /* Decode As handling */ - static build_valid_func pcli_payload_da_build_value[1] = {pcli_value}; - static decode_as_value_t pcli_payload_da_values = {pcli_prompt, 1, pcli_payload_da_build_value}; - static decode_as_t pcli_payload_da = { - "pcli", "PCLI payload", "pcli.payload", 1, 0, - &pcli_payload_da_values, NULL, NULL, - decode_as_default_populate_list, - decode_as_default_reset, - decode_as_default_change, - NULL, - }; - proto_pcli = proto_register_protocol("Packet Cable Lawful Intercept", "PCLI", "pcli"); /* Create "placeholders" to remove confusion with Decode As" */ proto_pcli8 = proto_register_protocol_in_name_only("Packet Cable Lawful Intercept (8 byte CCCID)", "PCLI8 (8 byte CCCID)", "pcli8", proto_pcli, FT_PROTOCOL); @@ -271,7 +253,7 @@ proto_register_pcli(void) "pcli.payload", "PCLI payload dissector", proto_pcli, FT_UINT32, BASE_DEC); - register_decode_as(&pcli_payload_da); + register_decode_as_next_proto("pcli", "PCLI payload", "pcli.payload", (build_label_func*)&pcli_prompt); } /* The registration hand-off routing */ |