| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
filter_files.h
Go to the documentation of this file.
1
11
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 * Capture filter file name.
23 */
24#define CFILTER_FILE_NAME "cfilters"
25
26/*
27 * Display filter file name.
28 */
29#define DFILTER_FILE_NAME "dfilters"
30
31/*
32 * Display filter file name.
33 */
34#define DMACROS_FILE_NAME "dmacros"
35
42 typedef enum {
43 CFILTER_LIST,
44 DFILTER_LIST,
45 DMACROS_LIST
46} filter_list_type_t;
47
54 typedef struct {
55 char *name;
56 char *strval;
57} filter_def;
58
65 typedef struct {
66 filter_list_type_t type;
67 GList *list;
68} filter_list_t;
69
80WS_DLL_PUBLIC
81WS_RETNONNULL
82 filter_list_t *ws_filter_list_read(filter_list_type_t list_type, const char* app_env_var_prefix);
83
93WS_DLL_PUBLIC
94 void ws_filter_list_add(filter_list_t *list, const char *name,
95 const char *expression);
96
106WS_DLL_PUBLIC
107GList *ws_filter_list_find(filter_list_t *list, const char *name);
108
118WS_DLL_PUBLIC
119 bool ws_filter_list_remove(filter_list_t *list, const char *name);
120
129WS_DLL_PUBLIC
130 void ws_filter_list_write(filter_list_t *list, const char* app_env_var_prefix);
131
139WS_DLL_PUBLIC
140 void ws_filter_list_free(filter_list_t *list);
141
142#ifdef __cplusplus
143}
144#endif /* __cplusplus */
145
146#endif /* __FILTER_FILES_H__ */
ws_filter_list_find
WS_DLL_PUBLIC GList * ws_filter_list_find(filter_list_t *list, const char *name)
Finds a filter in a list by name.
Definition filter_files.c:348
ws_filter_list_add
WS_DLL_PUBLIC void ws_filter_list_add(filter_list_t *list, const char *name, const char *expression)
Adds a new filter to the end of a filter list.
Definition filter_files.c:336
filter_list_type_t
filter_list_type_t
Types of filter lists supported.
Definition filter_files.h:42
DMACROS_LIST
@ DMACROS_LIST
Definition filter_files.h:45
CFILTER_LIST
@ CFILTER_LIST
Definition filter_files.h:43
DFILTER_LIST
@ DFILTER_LIST
Definition filter_files.h:44
ws_filter_list_write
WS_DLL_PUBLIC void ws_filter_list_write(filter_list_t *list, const char *app_env_var_prefix)
Writes a filter list to persistent storage.
Definition filter_files.c:374
ws_filter_list_remove
WS_DLL_PUBLIC bool ws_filter_list_remove(filter_list_t *list, const char *name)
Removes a filter from a list by name.
Definition filter_files.c:357
ws_filter_list_read
WS_DLL_PUBLIC WS_RETNONNULL filter_list_t * ws_filter_list_read(filter_list_type_t list_type, const char *app_env_var_prefix)
Reads a list of filters from persistent storage.
Definition filter_files.c:102
ws_filter_list_free
WS_DLL_PUBLIC void ws_filter_list_free(filter_list_t *list)
Frees all memory associated with a filter list.
Definition filter_files.c:53
filter_def
Represents a single filter entry.
Definition filter_files.h:54
filter_def::strval
char * strval
Definition filter_files.h:56
filter_def::name
char * name
Definition filter_files.h:55
filter_list_t
Represents a list of filters of a specific type.
Definition filter_files.h:65
filter_list_t::list
GList * list
Definition filter_files.h:67
filter_list_t::type
filter_list_type_t type
Definition filter_files.h:66