Wireshark  4.3.0
The Wireshark network protocol analyzer
filter_files.h
Go to the documentation of this file.
1 
12 #ifndef __FILTER_FILES_H__
13 #define __FILTER_FILES_H__
14 
15 #include <wireshark.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 /*
22  * Old filter file name.
23  */
24 #define FILTER_FILE_NAME "filters"
25 
26 /*
27  * Capture filter file name.
28  */
29 #define CFILTER_FILE_NAME "cfilters"
30 
31 /*
32  * Display filter file name.
33  */
34 #define DFILTER_FILE_NAME "dfilters"
35 
36 /*
37  * Filter lists.
38  */
39 typedef enum {
40  CFILTER_LIST, /* capture filter list - saved */
41  DFILTER_LIST /* display filter list - saved */
42 } filter_list_type_t;
43 
44 /*
45  * Item in a list of filters.
46  */
47 typedef struct {
48  char *name; /* filter name */
49  char *strval; /* filter expression */
50 } filter_def;
51 
52 /*
53  * Read in a list of filters.
54  *
55  * On error, report the error via the UI.
56  */
57 WS_DLL_PUBLIC
58 void read_filter_list(filter_list_type_t list_type);
59 
60 /*
61  * Get a pointer to the first entry in a filter list.
62  */
63 WS_DLL_PUBLIC
64 GList *get_filter_list_first(filter_list_type_t list);
65 
66 /*
67  * Add a new filter to the end of a list.
68  * Returns a pointer to the newly-added entry.
69  */
70 WS_DLL_PUBLIC
71 GList *add_to_filter_list(filter_list_type_t list, const char *name,
72  const char *expression);
73 
74 /*
75  * Remove a filter from a list.
76  */
77 WS_DLL_PUBLIC
78 void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
79 
80 /*
81  * Write out a list of filters.
82  *
83  * On error, report the error via the UI.
84  */
85 WS_DLL_PUBLIC
86 void save_filter_list(filter_list_type_t list_type);
87 
88 /*
89  * Free all filter lists
90  */
91 WS_DLL_PUBLIC
92 void free_filter_lists(void);
93 
94 #ifdef __cplusplus
95 }
96 #endif /* __cplusplus */
97 
98 #endif /* __FILTER_FILES_H__ */
Definition: filter_files.h:47