/* color_filters.h
* Definitions for color filters
*
- * $Id$
- *
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __COLOR_FILTERS_H__
#define __COLOR_FILTERS_H__
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct epan_dissect;
+
+#define CONVERSATION_COLOR_PREFIX "___conversation_color_filter___"
/** @file
* Color filters.
*/
/* Data for a color filter. */
typedef struct _color_filter {
- gchar *filter_name; /* name of the filter */
- gchar *filter_text; /* text of the filter expression */
- color_t bg_color; /* background color for packets that match */
- color_t fg_color; /* foreground color for packets that match */
- gboolean disabled; /* set if the filter is disabled */
- gboolean selected; /* set if the filter is selected in the color dialog box */
-
- /* only used inside of color_filters.c */
- dfilter_t *c_colorfilter; /* compiled filter expression */
-
- /* only used outside of color_filters.c (beside init) */
- void *edit_dialog; /* if filter is being edited, dialog
- * box for it */
+ gchar *filter_name; /* name of the filter */
+ gchar *filter_text; /* text of the filter expression */
+ color_t bg_color; /* background color for packets that match */
+ color_t fg_color; /* foreground color for packets that match */
+ gboolean disabled; /* set if the filter is disabled */
+ gboolean selected; /* set if the filter is selected in the color dialog box */
+
+ /* only used inside of color_filters.c */
+ struct epan_dfilter *c_colorfilter; /* compiled filter expression */
+
+ /* only used outside of color_filters.c (beside init) */
+ void *color_edit_dlg_info; /* if filter is being edited, ptr to req'd info */
} color_filter_t;
/** Init the color filters (incl. initial read from file). */
void color_filters_init(void);
+/** Reload the color filters */
+void color_filters_reload(void);
+
/** Cleanup remaining color filter zombies */
void color_filters_cleanup(void);
*/
gboolean color_filters_used(void);
+/** Are there any temporary coloring filters used?
+ *
+ * @return TRUE, if temporary coloring filters are used
+ */
+gboolean tmp_color_filters_used(void);
+
/** En-/disable color filters
*
* @param enable TRUE to enable (default)
void
color_filters_enable(gboolean enable);
+/** Set the filter string of a temporary color filter
+ *
+ * @param filt_nr a number 1-10 pointing to a temporary color
+ * @param filter the new filter-string
+ * @param disabled whether the filter-rule should be disabled
+ */
+void
+color_filters_set_tmp(guint8 filt_nr, gchar *filter, gboolean disabled);
+/** Reset the temporary color filters
+ *
+ */
+void
+color_filters_reset_tmp(void);
/* Prime the epan_dissect_t with all the compiler
- * color filters of the current filter list.
+ * color filters of the current filter list.
*
* @param the epan dissector details
*/
-void color_filters_prime_edt(epan_dissect_t *edt);
+void color_filters_prime_edt(struct epan_dissect *edt);
/** Colorize a specific packet.
*
- * @param row the row in the packet list
* @param edt the dissected packet
* @return the matching color filter or NULL
*/
-color_filter_t *
-color_filters_colorize_packet(gint row, epan_dissect_t *edt);
-
-
+const color_filter_t *
+color_filters_colorize_packet(struct epan_dissect *edt);
/** Clone the currently active filter list.
*
/** Apply a changed filter list.
*
- * @param cfl the filter list to apply
+ * @param tmp_cfl the temporary color filter list to apply
+ * @param edit_cfl the edited permanent color filter list to apply
*/
-void color_filters_apply(GSList *cfl);
+void color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl);
/** Save filters in users filter file.
*
* @param filter_string the filter string
* @param bg_color background color
* @param fg_color foreground color
+ * @param disabled gboolean
* @return the new color filter
*/
color_filter_t *color_filter_new(
*/
void color_filter_list_delete(GSList **cfl);
-
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
#endif
+
+/*
+ * 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:
+ */