2017-04-09 04:24:45 +00:00
|
|
|
/* filter_filess.h
|
2001-01-28 04:43:26 +00:00
|
|
|
* Declarations of routines for reading and writing the filters file.
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
2008-01-08 22:54:51 +00:00
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-01-28 04:43:26 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later*/
|
2001-01-28 04:43:26 +00:00
|
|
|
|
2014-06-30 21:47:22 +00:00
|
|
|
#ifndef __UI_FILTERS_H__
|
|
|
|
#define __UI_FILTERS_H__
|
2011-12-29 00:08:47 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2001-01-28 04:43:26 +00:00
|
|
|
/*
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
* Filter lists.
|
2001-01-28 04:43:26 +00:00
|
|
|
*/
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
typedef enum {
|
2014-10-12 18:56:12 +00:00
|
|
|
CFILTER_LIST, /* capture filter list - saved */
|
|
|
|
DFILTER_LIST, /* display filter list - saved */
|
2015-06-03 23:26:00 +00:00
|
|
|
CFILTER_EDITED_LIST, /* capture filter list - currently edited. GTK+ only. */
|
|
|
|
DFILTER_EDITED_LIST /* display filter list - currently edited. GTK+ only. */
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
} filter_list_type_t;
|
2001-01-28 04:43:26 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Item in a list of filters.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
2014-10-12 18:56:12 +00:00
|
|
|
char *name; /* filter name */
|
|
|
|
char *strval; /* filter expression */
|
2001-01-28 04:43:26 +00:00
|
|
|
} filter_def;
|
|
|
|
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
/*
|
|
|
|
* Read in a list of filters.
|
|
|
|
*
|
2017-04-09 09:01:05 +00:00
|
|
|
* On error, report the error via the UI.
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
*/
|
2017-04-09 09:01:05 +00:00
|
|
|
void read_filter_list(filter_list_type_t list_type);
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get a pointer to the first entry in a filter list.
|
|
|
|
*/
|
|
|
|
GList *get_filter_list_first(filter_list_type_t list);
|
2001-01-28 04:43:26 +00:00
|
|
|
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
/*
|
|
|
|
* Add a new filter to the end of a list.
|
|
|
|
* Returns a pointer to the newly-added entry.
|
|
|
|
*/
|
2003-12-04 00:45:39 +00:00
|
|
|
GList *add_to_filter_list(filter_list_type_t list, const char *name,
|
2014-10-12 18:56:12 +00:00
|
|
|
const char *expression);
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Remove a filter from a list.
|
|
|
|
*/
|
|
|
|
void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Write out a list of filters.
|
|
|
|
*
|
2017-04-09 09:01:05 +00:00
|
|
|
* On error, report the error via the UI.
|
Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.
Have separate menu items for editing the capture and display filter
lists.
Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.
Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.
svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
|
|
|
*/
|
2017-04-09 09:01:05 +00:00
|
|
|
void save_filter_list(filter_list_type_t list_type);
|
2006-10-01 17:59:30 +00:00
|
|
|
|
|
|
|
/*
|
2015-06-03 23:26:00 +00:00
|
|
|
* Clone the filter list so it can be edited. GTK+ only.
|
2006-10-01 17:59:30 +00:00
|
|
|
*/
|
|
|
|
void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type);
|
|
|
|
|
2017-02-03 22:15:56 +00:00
|
|
|
/*
|
|
|
|
* Free all filter lists
|
|
|
|
*/
|
|
|
|
void free_filter_lists(void);
|
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2014-10-14 19:58:21 +00:00
|
|
|
#endif /* __UI_FILTERS_H__ */
|
|
|
|
|
2014-10-12 18:56:12 +00:00
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 2
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
2014-10-14 19:58:21 +00:00
|
|
|
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
2014-10-12 18:56:12 +00:00
|
|
|
* :indentSize=2:tabSize=8:noTabs=true:
|
|
|
|
*/
|