From 26eec29b44ee6b20b6eae78f4658a9277c69c696 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Tue, 13 Oct 2015 20:34:43 -0400 Subject: [PATCH] Remove ability to make dissectors "private" Change-Id: If5897e8137f729503edf2cafb49b2ebeab4716ad Reviewed-on: https://code.wireshark.org/review/10997 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- debian/libwireshark0.symbols | 2 - epan/proto.c | 20 --------- epan/proto.h | 12 ----- ui/gtk/main.c | 86 ++++++++++++------------------------ ui/qt/main_window_slots.cpp | 2 +- 5 files changed, 30 insertions(+), 92 deletions(-) diff --git a/debian/libwireshark0.symbols b/debian/libwireshark0.symbols index 5f9177f608..61986c2462 100644 --- a/debian/libwireshark0.symbols +++ b/debian/libwireshark0.symbols @@ -949,7 +949,6 @@ libwireshark.so.0 libwireshark0 #MINVER# proto_get_protocol_name@Base 1.9.1 proto_get_protocol_short_name@Base 1.9.1 proto_initialize_all_prefixes@Base 1.9.1 - proto_is_private@Base 1.9.1 proto_is_protocol_enabled@Base 1.9.1 proto_is_frame_protocol@Base 1.99.1 proto_item_add_subtree@Base 1.9.1 @@ -964,7 +963,6 @@ libwireshark.so.0 libwireshark0 #MINVER# proto_item_set_end@Base 1.9.1 proto_item_set_len@Base 1.9.1 proto_item_set_text@Base 1.9.1 - proto_mark_private@Base 1.9.1 proto_register_field_array@Base 1.9.1 proto_register_fields_manual@Base 1.12.0~rc1 proto_register_fields_section@Base 1.12.0~rc1 diff --git a/epan/proto.c b/epan/proto.c index a5e20566a4..8bfb8df073 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -289,7 +289,6 @@ struct _protocol { int proto_id; /* field ID for this protocol */ gboolean is_enabled; /* TRUE if protocol is enabled */ gboolean can_toggle; /* TRUE if is_enabled can be changed */ - gboolean is_private; /* TRUE is protocol is private */ GList *heur_list; /* Heuristic dissectors associated with this protocol */ }; @@ -5301,7 +5300,6 @@ proto_register_protocol(const char *name, const char *short_name, protocol->fields = g_ptr_array_new(); protocol->is_enabled = TRUE; /* protocol is enabled by default */ protocol->can_toggle = TRUE; - protocol->is_private = FALSE; protocol->heur_list = NULL; /* list will be sorted later by name, when all protocols completed registering */ protocols = g_list_prepend(protocols, protocol); @@ -5368,24 +5366,6 @@ proto_deregister_protocol(const char *short_name) return TRUE; } -void -proto_mark_private(const int proto_id) -{ - protocol_t *protocol = find_protocol_by_id(proto_id); - if (protocol) - protocol->is_private = TRUE; -} - -gboolean -proto_is_private(const int proto_id) -{ - protocol_t *protocol = find_protocol_by_id(proto_id); - if (protocol) - return protocol->is_private; - else - return FALSE; -} - /* * Routines to use to iterate over the protocols. * The argument passed to the iterator routines is an opaque cookie to diff --git a/epan/proto.h b/epan/proto.h index 61003f3743..e0623f7de4 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -2015,18 +2015,6 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi WS_DLL_PUBLIC gboolean proto_deregister_protocol(const char *short_name); -/** Mark protocol as private - @param proto_id the handle of the protocol */ -WS_DLL_PUBLIC -void -proto_mark_private(const int proto_id); - -/** Return if protocol is private - @param proto_id the handle of the protocol - @return TRUE if it is a private protocol, FALSE is not. */ -WS_DLL_PUBLIC gboolean -proto_is_private(const int proto_id); - /** This type of function can be registered to get called whenever a given field was not found but a its prefix is matched; It can be used to procrastinate the hf array registration. diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 5870daef0b..86a3574843 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -426,41 +426,27 @@ selected_ptree_info_cb(GtkWidget *widget _U_, gpointer data _U_) proto_abbrev = proto_registrar_get_abbrev(field_id); - if (!proto_is_private(field_id)) { - /* ask the user if the wiki page really should be opened */ - dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_OK_CANCEL, - "%sOpen Wireshark Wiki page of protocol \"%s\"?%s\n" - "\n" - "This will open the \"%s\" related Wireshark Wiki page in your Web browser.\n" - "\n" - "The Wireshark Wiki is a collaborative approach to provide information " - "about Wireshark in several ways (not limited to protocol specifics).\n" - "\n" - "This Wiki is new, so the page of the selected protocol " - "may not exist and/or may not contain valuable information.\n" - "\n" - "As everyone can edit the Wiki and add new content (or extend existing), " - "you are encouraged to add information if you can.\n" - "\n" - "Hint 1: If you are new to wiki editing, try out editing the Sandbox first!\n" - "\n" - "Hint 2: If you want to add a new protocol page, you should use the ProtocolTemplate, " - "which will save you a lot of editing and will give a consistent look over the pages.", - simple_dialog_primary_start(), proto_abbrev, simple_dialog_primary_end(), proto_abbrev); - simple_dialog_set_cb(dialog, selected_ptree_info_answered_cb, (gpointer)proto_abbrev); - } else { - /* appologize to the user that the wiki page cannot be opened */ - simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "%sCan't open Wireshark Wiki page of protocol \"%s\"%s\n" - "\n" - "This would open the \"%s\" related Wireshark Wiki page in your Web browser.\n" - "\n" - "Since this is a private protocol, such information is not available in " - "a public wiki. Therefore this wiki entry is blocked.\n" - "\n" - "Sorry for the inconvenience.\n", - simple_dialog_primary_start(), proto_abbrev, simple_dialog_primary_end(), proto_abbrev); - } + /* ask the user if the wiki page really should be opened */ + dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_OK_CANCEL, + "%sOpen Wireshark Wiki page of protocol \"%s\"?%s\n" + "\n" + "This will open the \"%s\" related Wireshark Wiki page in your Web browser.\n" + "\n" + "The Wireshark Wiki is a collaborative approach to provide information " + "about Wireshark in several ways (not limited to protocol specifics).\n" + "\n" + "This Wiki is new, so the page of the selected protocol " + "may not exist and/or may not contain valuable information.\n" + "\n" + "As everyone can edit the Wiki and add new content (or extend existing), " + "you are encouraged to add information if you can.\n" + "\n" + "Hint 1: If you are new to wiki editing, try out editing the Sandbox first!\n" + "\n" + "Hint 2: If you want to add a new protocol page, you should use the ProtocolTemplate, " + "which will save you a lot of editing and will give a consistent look over the pages.", + simple_dialog_primary_start(), proto_abbrev, simple_dialog_primary_end(), proto_abbrev); + simple_dialog_set_cb(dialog, selected_ptree_info_answered_cb, (gpointer)proto_abbrev); } } @@ -504,28 +490,14 @@ selected_ptree_ref_cb(GtkWidget *widget _U_, gpointer data _U_) proto_abbrev = proto_registrar_get_abbrev(field_id); - if (!proto_is_private(field_id)) { - /* ask the user if the wiki page really should be opened */ - dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_OK_CANCEL, - "%sOpen Wireshark filter reference page of protocol \"%s\"?%s\n" - "\n" - "This will open the \"%s\" related Wireshark filter reference page in your Web browser.\n" - "\n", - simple_dialog_primary_start(), proto_abbrev, simple_dialog_primary_end(), proto_abbrev); - simple_dialog_set_cb(dialog, selected_ptree_ref_answered_cb, (gpointer)proto_abbrev); - } else { - /* appologize to the user that the wiki page cannot be opened */ - simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "%sCan't open Wireshark filter reference page of protocol \"%s\"%s\n" - "\n" - "This would open the \"%s\" related Wireshark filter reference page in your Web browser.\n" - "\n" - "Since this is a private protocol, such information is not available on " - "a public website. Therefore this filter entry is blocked.\n" - "\n" - "Sorry for the inconvenience.\n", - simple_dialog_primary_start(), proto_abbrev, simple_dialog_primary_end(), proto_abbrev); - } + /* ask the user if the wiki page really should be opened */ + dialog = simple_dialog(ESD_TYPE_CONFIRMATION, ESD_BTNS_OK_CANCEL, + "%sOpen Wireshark filter reference page of protocol \"%s\"?%s\n" + "\n" + "This will open the \"%s\" related Wireshark filter reference page in your Web browser.\n" + "\n", + simple_dialog_primary_start(), proto_abbrev, simple_dialog_primary_end(), proto_abbrev); + simple_dialog_set_cb(dialog, selected_ptree_ref_answered_cb, (gpointer)proto_abbrev); } } diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 460fdcb591..f0b3cf0a25 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -1234,7 +1234,7 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) { field_id = proto_registrar_get_parent(fi->hfinfo->id); } - if (field_id >= 0 && !proto_is_private(field_id)) { + if (field_id >= 0) { can_open_url = true; main_ui_->actionContextWikiProtocolPage->setData(field_id); main_ui_->actionContextFilterFieldReference->setData(field_id);