aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-10-25 10:32:29 -0400
committerMichael Mann <mmann78@netscape.net>2015-10-27 11:41:35 +0000
commit616dbd78d6afc4f8825ce159de23b19752859605 (patch)
tree83ff123d37b33132a242c26aaf0f2504c2ab4e5b
parentb90267bb7549c7be9900141f6737fd127a9a0515 (diff)
Replace all "dissector filter" registrations with "dissector color filter" registration.
In the GTK, there was "colorize" (via context menu using color_dissector_filter.{c,h}) or "not colorize" (via main menu using dissector_filters.{c,h}). In Qt, you have the option to colorize (via context menu using color_dissector_filter.{c,h}) or not colorize (via main menu using color_dissector_filter.{c,h}). Combine all into "colorize" and convert GTK to use color_dissector_filter.{c,h} in the "not colorize" main menu like Qt. Change-Id: Ib3ca1c822f5f66ab5b812632d808f7905b328483 Reviewed-on: https://code.wireshark.org/review/11263 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--debian/libwireshark0.symbols2
-rw-r--r--epan/CMakeLists.txt1
-rw-r--r--epan/Makefile.common2
-rw-r--r--epan/dissector_filters.c57
-rw-r--r--epan/dissector_filters.h61
-rw-r--r--epan/dissectors/packet-enip.c10
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c10
-rw-r--r--ui/gtk/main_menubar.c25
8 files changed, 23 insertions, 145 deletions
diff --git a/debian/libwireshark0.symbols b/debian/libwireshark0.symbols
index 61986c2462..d9fcaea206 100644
--- a/debian/libwireshark0.symbols
+++ b/debian/libwireshark0.symbols
@@ -420,7 +420,6 @@ libwireshark.so.0 libwireshark0 #MINVER#
dissector_dump_decodes@Base 1.9.1
dissector_dump_dissector_tables@Base 1.99.1
dissector_dump_heur_decodes@Base 1.9.1
- dissector_filter_list@Base 1.9.1
dissector_get_custom_table_handle@Base 1.99.8
dissector_get_default_string_handle@Base 1.12.0~rc1
dissector_get_default_uint_handle@Base 1.12.0~rc1
@@ -1115,7 +1114,6 @@ libwireshark.so.0 libwireshark0 #MINVER#
register_custom_dissector_table@Base 1.99.8
register_decode_as@Base 1.12.0~rc1
register_dissector@Base 1.9.1
- register_dissector_filter@Base 1.9.1
register_dissector_table@Base 1.9.1
register_export_pdu_tap@Base 1.99.0
register_final_registration_routine@Base 1.9.1
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 29785efa9a..66c0f948f5 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -1604,7 +1604,6 @@ set(LIBWIRESHARK_FILES
crc8-tvb.c
decode_as.c
disabled_protos.c
- dissector_filters.c
dvb_chartbl.c
dwarf.c
epan.c
diff --git a/epan/Makefile.common b/epan/Makefile.common
index fe81b1c7ea..f6b6b92277 100644
--- a/epan/Makefile.common
+++ b/epan/Makefile.common
@@ -43,7 +43,6 @@ LIBWIRESHARK_SRC = \
crc8-tvb.c \
decode_as.c \
disabled_protos.c \
- dissector_filters.c \
dvb_chartbl.c \
dwarf.c \
epan.c \
@@ -176,7 +175,6 @@ LIBWIRESHARK_INCLUDES = \
decode_as.h \
diam_dict.h \
disabled_protos.h \
- dissector_filters.h \
dtd.h \
dtd_parse.h \
dvb_chartbl.h \
diff --git a/epan/dissector_filters.c b/epan/dissector_filters.c
deleted file mode 100644
index 04ab235119..0000000000
--- a/epan/dissector_filters.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* dissector_filters.c
- * Routines for dissector generated display filters
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "config.h"
-
-#include <glib.h>
-#include "packet.h"
-
-#include "dissector_filters.h"
-
-
-GList *dissector_filter_list = NULL;
-
-
-void register_dissector_filter(const char *name, is_filter_valid_func is_filter_valid, build_filter_string_func build_filter_string) {
- dissector_filter_t *entry;
-
- entry = (dissector_filter_t *)g_malloc(sizeof(dissector_filter_t));
-
- entry->name = name;
- entry->is_filter_valid = is_filter_valid;
- entry->build_filter_string = build_filter_string;
-
- dissector_filter_list = g_list_append(dissector_filter_list, entry);
-}
-
-/*
- * Editor modelines - http://www.wireshark.org/tools/modelines.html
- *
- * Local variables:
- * c-basic-offset: 4
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- *
- * vi: set shiftwidth=4 tabstop=8 expandtab:
- * :indentSize=4:tabSize=8:noTabs=true:
- */
diff --git a/epan/dissector_filters.h b/epan/dissector_filters.h
deleted file mode 100644
index 020fb107ed..0000000000
--- a/epan/dissector_filters.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* dissector_filters.h
- * Routines for dissector generated display filters
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef __DISSECTOR_FILTERS_H__
-#define __DISSECTOR_FILTERS_H__
-
-#include "ws_symbol_export.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/** @file
- */
-
-/** callback function definition: is a filter available for this packet? */
-typedef gboolean (*is_filter_valid_func)(packet_info *pinfo);
-
-/** callback function definition: return the available filter for this packet or NULL if no filter is available */
-typedef const gchar* (*build_filter_string_func)(packet_info *pinfo);
-
-
-/** register a dissector filter */
-WS_DLL_PUBLIC void register_dissector_filter(const char *name, is_filter_valid_func is_filter_valid, build_filter_string_func build_filter_string);
-
-
-
-/*** THE FOLLOWING SHOULD NOT BE USED BY ANY DISSECTORS!!! ***/
-
-typedef struct dissector_filter_s {
- const char * name;
- is_filter_valid_func is_filter_valid;
- build_filter_string_func build_filter_string;
-} dissector_filter_t;
-
-WS_DLL_PUBLIC GList *dissector_filter_list;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* dissector_filters.h */
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index 2f5c444341..409c601682 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -36,7 +36,7 @@
#include "config.h"
#include <epan/packet.h>
-#include <epan/dissector_filters.h>
+#include <epan/color_dissector_filters.h>
#include <epan/prefs.h>
#include <epan/etypes.h>
#include <epan/expert.h>
@@ -848,7 +848,7 @@ enip_io_conv_valid(packet_info *pinfo)
((conn->TransportClass_trigger & CI_TRANSPORT_CLASS_MASK) == 1));
}
-static const gchar *
+static gchar *
enip_io_conv_filter(packet_info *pinfo)
{
char *buf;
@@ -894,7 +894,7 @@ enip_exp_conv_valid(packet_info *pinfo)
((conn->TransportClass_trigger & CI_TRANSPORT_CLASS_MASK) == 3));
}
-static const gchar *
+static gchar *
enip_exp_conv_filter(packet_info *pinfo)
{
char *buf;
@@ -3736,8 +3736,8 @@ proto_register_enip(void)
proto_register_field_array(proto_dlr, hfdlr, array_length(hfdlr));
proto_register_subtree_array(ettdlr, array_length(ettdlr));
- register_dissector_filter("ENIP IO", enip_io_conv_valid, enip_io_conv_filter);
- register_dissector_filter("ENIP Explicit", enip_exp_conv_valid, enip_exp_conv_filter);
+ register_color_conversation_filter("enip", "ENIP IO", enip_io_conv_valid, enip_io_conv_filter);
+ register_color_conversation_filter("enip", "ENIP Explicit", enip_exp_conv_valid, enip_exp_conv_filter);
register_decode_as(&enip_da);
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index 69ebaceb97..4aa82820df 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -50,7 +50,7 @@
#include <epan/packet.h>
#include <epan/to_str.h>
#include <epan/expert.h>
-#include <epan/dissector_filters.h>
+#include <epan/color_dissector_filters.h>
#include <epan/dissectors/packet-dcerpc.h>
#include "packet-pn.h"
@@ -9671,7 +9671,7 @@ pn_io_ar_conv_valid(packet_info *pinfo)
return ((profinet_type != NULL) && (GPOINTER_TO_UINT(profinet_type) == 10));
}
-static const gchar *
+static gchar *
pn_io_ar_conv_filter(packet_info *pinfo)
{
pnio_ar_t *ar = (pnio_ar_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pn_io, 0);
@@ -9698,7 +9698,7 @@ pn_io_ar_conv_filter(packet_info *pinfo)
return buf;
}
-static const gchar *
+static gchar *
pn_io_ar_conv_data_filter(packet_info *pinfo)
{
pnio_ar_t *ar = (pnio_ar_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pn_io, 0);
@@ -12260,8 +12260,8 @@ proto_register_pn_io (void)
register_cleanup_routine(pnio_cleanup);
- register_dissector_filter("PN-IO AR", pn_io_ar_conv_valid, pn_io_ar_conv_filter);
- register_dissector_filter("PN-IO AR (with data)", pn_io_ar_conv_valid, pn_io_ar_conv_data_filter);
+ register_color_conversation_filter("pn_io", "PN-IO AR", pn_io_ar_conv_valid, pn_io_ar_conv_filter);
+ register_color_conversation_filter("pn_io", "PN-IO AR (with data)", pn_io_ar_conv_valid, pn_io_ar_conv_data_filter);
}
void
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c
index a0ebe76491..e6f5345ec9 100644
--- a/ui/gtk/main_menubar.c
+++ b/ui/gtk/main_menubar.c
@@ -31,7 +31,6 @@
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/prefs-int.h>
-#include <epan/dissector_filters.h>
#include <epan/color_dissector_filters.h>
#include <epan/epan_dissect.h>
#include <epan/column.h>
@@ -2558,7 +2557,7 @@ main_menu_new(GtkAccelGroup ** table)
static void
menu_dissector_filter_cb(GtkAction *action _U_, gpointer callback_data)
{
- dissector_filter_t *filter_entry = (dissector_filter_t *)callback_data;
+ color_conversation_filter_t *filter_entry = (color_conversation_filter_t *)callback_data;
GtkWidget *filter_te;
const char *buf;
@@ -2581,7 +2580,7 @@ menu_dissector_filter_cb(GtkAction *action _U_, gpointer callback_data)
static gboolean
menu_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer callback_data)
{
- dissector_filter_t *filter_entry = (dissector_filter_t *)callback_data;
+ color_conversation_filter_t *filter_entry = (color_conversation_filter_t*)callback_data;
/* XXX - this gets the packet_info of the last dissected packet, */
/* which is not necessarily the last selected packet */
@@ -2592,8 +2591,8 @@ menu_dissector_filter_spe_cb(frame_data *fd _U_, epan_dissect_t *edt, gpointer c
static void
menu_dissector_filter(capture_file *cf)
{
- GList *list_entry = dissector_filter_list;
- dissector_filter_t *filter_entry;
+ GList *list_entry = color_conv_filter_list;
+ color_conversation_filter_t *filter_entry;
guint merge_id;
GtkActionGroup *action_group;
@@ -2639,12 +2638,12 @@ menu_dissector_filter(capture_file *cf)
}
while (list_entry != NULL) {
- filter_entry = (dissector_filter_t *)list_entry->data;
+ filter_entry = (color_conversation_filter_t *)list_entry->data;
action_name = g_strdup_printf ("filter-%u", i);
/*g_warning("action_name %s, filter_entry->name %s",action_name,filter_entry->name);*/
action = (GtkAction *)g_object_new (GTK_TYPE_ACTION,
"name", action_name,
- "label", filter_entry->name,
+ "label", filter_entry->display_name,
"sensitive", menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry),
NULL);
g_signal_connect (action, "activate",
@@ -4518,7 +4517,6 @@ set_menus_for_captured_packets(gboolean have_captured_packets)
void
set_menus_for_selected_packet(capture_file *cf)
{
- GList *list_entry = dissector_filter_list;
GList *color_list_entry = color_conv_filter_list;
guint i = 0;
gboolean properties = FALSE;
@@ -4705,21 +4703,24 @@ set_menus_for_selected_packet(capture_file *cf)
set_menu_sensitivity(ui_manager_main_menubar, "/Menubar/TelephonyMenu/LTEmenu/LTE_RLC_Graph",
is_lte_rlc);
- while (list_entry != NULL) {
- dissector_filter_t *filter_entry;
+ i = 0;
+ color_list_entry = color_conv_filter_list;
+ while (color_list_entry != NULL) {
+ color_conversation_filter_t *filter_entry;
gchar *path;
- filter_entry = (dissector_filter_t *)list_entry->data;
+ filter_entry = (color_conversation_filter_t *)color_list_entry->data;
path = g_strdup_printf("/Menubar/AnalyzeMenu/ConversationFilterMenu/Filters/filter-%u", i);
set_menu_sensitivity(ui_manager_main_menubar, path,
menu_dissector_filter_spe_cb(/* frame_data *fd _U_*/ NULL, cf->edt, filter_entry));
g_free(path);
i++;
- list_entry = g_list_next(list_entry);
+ color_list_entry = g_list_next(color_list_entry);
}
i = 0;
+ color_list_entry = color_conv_filter_list;
while (color_list_entry != NULL) {
color_conversation_filter_t* color_filter;
gchar *path;