Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
funnel.h
Go to the documentation of this file.
1
13#ifndef __FUNNEL_H__
14#define __FUNNEL_H__
15
16#include <wireshark.h>
17#include <epan/stat_groups.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif /* __cplusplus */
22
23typedef struct _funnel_ops_id_t funnel_ops_id_t; /* Opaque pointer to ops instance */
25
26typedef void (*text_win_close_cb_t)(void*);
27
28typedef void (*funnel_dlg_cb_t)(char** user_input, void* data);
29typedef void (*funnel_dlg_cb_data_free_t)(void* data);
30
31typedef bool (*funnel_bt_cb_t)(funnel_text_window_t* tw, void* data);
32
33typedef void (* funnel_menu_callback)(void *);
34typedef void (* funnel_menu_callback_data_free)(void *);
35
36typedef struct _funnel_bt_t {
38 funnel_bt_cb_t func;
39 void* data;
40 void (*free_fcn)(void*);
41 void (*free_data_fcn)(void*);
43
44struct progdlg;
45
46typedef struct _funnel_ops_t {
47 funnel_ops_id_t *ops_id;
48 funnel_text_window_t* (*new_text_window)(funnel_ops_id_t *ops_id, const char* label);
49 void (*set_text)(funnel_text_window_t* win, const char* text);
50 void (*append_text)(funnel_text_window_t* win, const char* text);
51 void (*prepend_text)(funnel_text_window_t* win, const char* text);
52 void (*clear_text)(funnel_text_window_t* win);
53 const char* (*get_text)(funnel_text_window_t* win);
54 void (*set_close_cb)(funnel_text_window_t* win, text_win_close_cb_t cb, void* data);
55 void (*set_editable)(funnel_text_window_t* win, bool editable);
56 void (*destroy_text_window)(funnel_text_window_t* win);
57 void (*add_button)(funnel_text_window_t* win, funnel_bt_t* cb, const char* label);
58
59 void (*new_dialog)(funnel_ops_id_t *ops_id,
60 const char* title,
61 const char** field_names,
62 const char** field_values,
63 funnel_dlg_cb_t dlg_cb,
64 void* data,
65 funnel_dlg_cb_data_free_t dlg_cb_data_free);
66
67 void (*close_dialogs)(void);
68
69 void (*retap_packets)(funnel_ops_id_t *ops_id);
70 void (*copy_to_clipboard)(GString *str);
71
72 const char * (*get_filter)(funnel_ops_id_t *ops_id);
73 void (*set_filter)(funnel_ops_id_t *ops_id, const char* filter);
74 char * (*get_color_filter_slot)(uint8_t filt_nr);
75 void (*set_color_filter_slot)(uint8_t filt_nr, const char* filter);
76 bool (*open_file)(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char** error);
77 void (*reload_packets)(funnel_ops_id_t *ops_id);
78 void (*redissect_packets)(funnel_ops_id_t *ops_id);
79 void (*reload_lua_plugins)(funnel_ops_id_t *ops_id);
80 void (*apply_filter)(funnel_ops_id_t *ops_id);
81
82 bool (*browser_open_url)(const char *url);
83 void (*browser_open_data_file)(const char *filename);
84
85 struct progdlg* (*new_progress_window)(funnel_ops_id_t *ops_id, const char* label, const char* task, bool terminate_is_stop, bool *stop_flag);
86 void (*update_progress)(struct progdlg*, float pr, const char* task);
87 void (*destroy_progress_window)(struct progdlg*);
89
90WS_DLL_PUBLIC const funnel_ops_t* funnel_get_funnel_ops(void);
91WS_DLL_PUBLIC void funnel_set_funnel_ops(const funnel_ops_t*);
92
93WS_DLL_PUBLIC void funnel_register_menu(const char *name,
95 funnel_menu_callback callback,
96 void *callback_data,
97 funnel_menu_callback_data_free callback_data_free,
98 bool retap);
99void funnel_deregister_menus(void (*callback)(void *));
100
101typedef void (*funnel_registration_cb_t)(const char *name,
103 funnel_menu_callback callback,
104 void *callback_data,
105 bool retap);
106typedef void (*funnel_deregistration_cb_t)(funnel_menu_callback callback);
107
108WS_DLL_PUBLIC void funnel_register_all_menus(funnel_registration_cb_t r_cb);
109WS_DLL_PUBLIC void funnel_reload_menus(funnel_deregistration_cb_t d_cb,
110 funnel_registration_cb_t r_cb);
111WS_DLL_PUBLIC void funnel_cleanup(void);
112
116typedef void (* funnel_packet_menu_callback)(void *, GPtrArray*);
117
121typedef void (*funnel_registration_packet_cb_t)(const char *name,
122 const char *required_fields,
124 void *callback_data,
125 bool retap);
126
133
143WS_DLL_PUBLIC void funnel_register_packet_menu(const char *name,
144 const char *required_fields,
146 void *callback_data,
147 bool retap);
148
154WS_DLL_PUBLIC bool funnel_packet_menus_modified(void);
155
156/*
157 * The functions below allow registering a funnel "console". A console is just a GUI
158 * dialog that has an input text widget, an output text widget, and for each user
159 * generated input it calls a callback to generate the corresponding output.
160 * Very simple... each console type has a name and an entry in the Tools menu to invoke it.
161 * Mainly used to present a Lua console to allow inspecting Lua internals and run Lua
162 * code using the embedded interpreter.
163 */
164
169typedef int (*funnel_console_eval_cb_t)(const char *console_input,
170 char **error_ptr,
171 char **error_hint,
172 void *callback_data);
173
177typedef void (*funnel_console_open_cb_t)(void (*print_func)(const char *, void *), void *print_data, void *callback_data);
178
182typedef void (*funnel_console_close_cb_t)(void *callback_data);
183
187typedef void (*funnel_console_data_free_cb_t)(void *callback_data);
188
192WS_DLL_PUBLIC void funnel_register_console_menu(const char *name,
196 void *callback_data,
198
202typedef void (*funnel_registration_console_cb_t)(const char *name,
206 void *callback_data);
207
214
215extern void initialize_funnel_ops(void);
216
217extern void funnel_dump_all_text_windows(void);
218
219#ifdef __cplusplus
220}
221#endif /* __cplusplus */
222
223#endif /* __FUNNEL_H__ */
void(* funnel_packet_menu_callback)(void *, GPtrArray *)
Definition funnel.h:116
WS_DLL_PUBLIC void funnel_register_console_menu(const char *name, funnel_console_eval_cb_t eval_cb, funnel_console_open_cb_t open_cb, funnel_console_close_cb_t close_cb, void *callback_data, funnel_console_data_free_cb_t free_data)
Definition funnel.c:300
void(* funnel_registration_console_cb_t)(const char *name, funnel_console_eval_cb_t eval_cb, funnel_console_open_cb_t open_cb, funnel_console_close_cb_t close_cb, void *callback_data)
Definition funnel.h:202
WS_DLL_PUBLIC bool funnel_packet_menus_modified(void)
Definition funnel.c:285
void(* funnel_console_open_cb_t)(void(*print_func)(const char *, void *), void *print_data, void *callback_data)
Definition funnel.h:177
WS_DLL_PUBLIC void funnel_register_packet_menu(const char *name, const char *required_fields, funnel_packet_menu_callback callback, void *callback_data, bool retap)
Definition funnel.c:223
void(* funnel_console_data_free_cb_t)(void *callback_data)
Definition funnel.h:187
WS_DLL_PUBLIC void funnel_register_all_console_menus(funnel_registration_console_cb_t r_cb)
Definition funnel.c:318
WS_DLL_PUBLIC void funnel_register_all_packet_menus(funnel_registration_packet_cb_t r_cb)
Definition funnel.c:271
int(* funnel_console_eval_cb_t)(const char *console_input, char **error_ptr, char **error_hint, void *callback_data)
Definition funnel.h:169
void(* funnel_console_close_cb_t)(void *callback_data)
Definition funnel.h:182
void(* funnel_registration_packet_cb_t)(const char *name, const char *required_fields, funnel_packet_menu_callback callback, void *callback_data, bool retap)
Definition funnel.h:121
enum register_stat_group_e register_stat_group_t
Definition funnel.h:36
Definition funnel_statistics.cpp:249
Definition funnel.h:46
Definition tap-funnel.c:27
Definition print.c:41
Definition progress_frame.h:31