Remove ability to make dissectors "private"

Change-Id: If5897e8137f729503edf2cafb49b2ebeab4716ad
Reviewed-on: https://code.wireshark.org/review/10997
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>
This commit is contained in:
Michael Mann 2015-10-13 20:34:43 -04:00 committed by Anders Broman
parent b212a4eb43
commit 26eec29b44
5 changed files with 30 additions and 92 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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);
}
}

View File

@ -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);