Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dfilter / dfilter-translator.h
blob54a977c44cec73ac8bcc555a89b13cdfd1e16007
1 /** @file
3 * Wireshark - Network traffic analyzer
5 * Copyright 1998 Gerald Combs <gerald@wireshark.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #pragma once
12 #include <glib.h>
13 #include <epan/dfilter/syntax-tree.h>
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
19 /* The run-time logic of the dfilter function */
20 typedef bool (*DFTranslator)(stnode_t *root_node, GString *translated);
23 /** Initialize our built-in translators
25 void dfilter_translator_init(void);
27 /** Clean up our built-in translators
29 void dfilter_translator_cleanup(void);
31 /** Register a display filter translator
32 * @param translator_name A unique, proper name for the translator, suitable for display.
33 * @param translator A function which will handle translating the syntax tree.
34 * @return true on success, false on failure.
36 WS_DLL_PUBLIC
37 bool register_dfilter_translator(const char *translator_name, DFTranslator translator);
39 /** Deregister a display filter translator
40 * @param translator_name The name provided in register_dfilter_translator.
42 WS_DLL_PUBLIC
43 void deregister_dfilter_translator(const char *translator_name);
45 /** Get the current translator list
46 * @return A NULL terminated array of translator names.
47 * The return value must be g_freed, but the names themselves must not be g_freed.
49 WS_DLL_PUBLIC
50 char **get_dfilter_translator_list(void);
52 /** Translate a display filter.
54 * The root node and data pointer will be passed to the
55 * @param translator_name The name of a registered translator.
56 * @param dfilter The Wireshark display filter to translate.
57 * @return A translated filter or rule on success, NULL on failure.
59 WS_DLL_PUBLIC
60 const char *translate_dfilter(const char *translator_name, const char *dfilter);
62 #ifdef __cplusplus
64 #endif /* __cplusplus */