GSMTAP: add definitions for new LTE RRC channels
[metze/wireshark/wip.git] / epan / dissector_filters.h
1 /* dissector_filters.h
2  * Routines for dissector-generated conversation filters for use as
3  * display and color filters
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11
12 #ifndef __DISSECTOR_FILTERS_H__
13 #define __DISSECTOR_FILTERS_H__
14
15 #include "ws_symbol_export.h"
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20
21 /** @file
22  */
23
24 /** callback function definition: is a filter available for this packet? */
25 typedef gboolean (*is_filter_valid_func)(struct _packet_info *pinfo);
26
27 /** callback function definition: return the available filter for this packet or NULL if no filter is available,
28     Filter needs to be freed after use */
29 typedef gchar* (*build_filter_string_func)(struct _packet_info *pinfo);
30
31 /** register a dissector filter */
32 WS_DLL_PUBLIC void register_conversation_filter(const char *proto_name, const char *display_name,
33                                                       is_filter_valid_func is_filter_valid, build_filter_string_func build_filter_string);
34
35 WS_DLL_PUBLIC struct conversation_filter_s* find_conversation_filter(const char *proto_name);
36
37 /* Cleanup internal structures */
38 extern void conversation_filters_cleanup(void);
39
40 /**
41  * Tries to build a suitable display filter for the conversation in the current
42  * packet. More specific matches are tried first (like TCP ports) followed by
43  * less specific ones (IP addresses). NULL is returned when no filter is found.
44  *
45  * The returned filter should be freed with g_free.
46  */
47 WS_DLL_PUBLIC gchar *conversation_filter_from_packet(struct _packet_info *pinfo);
48
49 /*** THE FOLLOWING SHOULD NOT BE USED BY ANY DISSECTORS!!! ***/
50
51 typedef struct conversation_filter_s {
52     const char *              proto_name;
53     const char *              display_name;
54     is_filter_valid_func      is_filter_valid;
55     build_filter_string_func  build_filter_string;
56 } conversation_filter_t;
57
58 WS_DLL_PUBLIC GList *conv_filter_list;
59
60 #ifdef __cplusplus
61 }
62 #endif /* __cplusplus */
63
64 #endif /* dissector_filters.h */