aboutsummaryrefslogtreecommitdiffstats
path: root/epan/decode_as.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-07-09 13:47:59 -0400
committerMichael Mann <mmann78@netscape.net>2017-09-16 11:12:29 +0000
commit7d65b573f2734017be416f31852c4ede42bd987b (patch)
tree5fc5e6ebe6c44a5060292541f9664f0244a5e0e4 /epan/decode_as.c
parentd992e85fe8e9192cb730abf8796336d3b6d6fd50 (diff)
Have register_decode_as_next_proto create dissector table.
For protocols that have don't have a unique identifier for their payload, have register_decode_as_next_proto be a one stop shop to create Decode As functionality and a dissector table of type FT_NONE. Change-Id: Ic1f2e9ed0aee0554a4eb8f232630b99c0604dfc0 Reviewed-on: https://code.wireshark.org/review/22575 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/decode_as.c')
-rw-r--r--epan/decode_as.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/epan/decode_as.c b/epan/decode_as.c
index 3222f9fb6e..30e60abd86 100644
--- a/epan/decode_as.c
+++ b/epan/decode_as.c
@@ -69,17 +69,14 @@ static build_valid_func next_proto_values[] = { next_proto_value };
static decode_as_value_t next_proto_da_values =
{ next_proto_prompt, 1, next_proto_values };
-void register_decode_as_next_proto(
- const char *name, const gchar *title, const gchar *table_name, build_label_func* label_func)
+dissector_table_t register_decode_as_next_proto(int proto, const gchar *title, const gchar *table_name, const gchar *ui_name, build_label_func* label_func)
{
decode_as_t *da;
- dissector_table_t dt;
- dt = find_dissector_table(table_name);
- g_assert(IS_FT_UINT(dissector_table_get_type(dt)));
+ dissector_table_t dt = register_dissector_table(table_name, ui_name, proto, FT_NONE, BASE_NONE);
da = wmem_new0(wmem_epan_scope(), decode_as_t);
- da->name = wmem_strdup(wmem_epan_scope(), name);
+ da->name = wmem_strdup(wmem_epan_scope(), proto_get_protocol_filter_name(proto));
da->title = wmem_strdup(wmem_epan_scope(), title);
da->table_name = wmem_strdup(wmem_epan_scope(), table_name);
da->num_items = 1;
@@ -99,6 +96,7 @@ void register_decode_as_next_proto(
da->change_value = decode_as_default_change;
register_decode_as(da);
+ return dt;
}
struct decode_as_default_populate