| Wireshark 4.7.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
20 extern "C" {
21#endif /* __cplusplus */
22
23 typedef struct _funnel_ops_id_t funnel_ops_id_t; /* Opaque pointer to ops instance */
24 typedef struct _funnel_text_window_t funnel_text_window_t ;
25
26 typedef void (*text_win_close_cb_t)(void*);
27
28 typedef void (*funnel_dlg_cb_t)(char** user_input, void* data);
29 typedef void (*funnel_dlg_cb_data_free_t)(void* data);
30
31 typedef bool (*funnel_bt_cb_t)(funnel_text_window_t* tw, void* data);
32
33 typedef void (* funnel_menu_callback)(void *);
34 typedef void (* funnel_menu_callback_data_free)(void *);
35
36 typedef struct _funnel_bt_t {
37 funnel_text_window_t* tw;
38 funnel_bt_cb_t func;
39 void* data;
40 void (*free_fcn)(void*);
41 void (*free_data_fcn)(void*);
42} funnel_bt_t;
43
44 struct progdlg;
45
46 typedef 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*);
88} funnel_ops_t;
89
90WS_DLL_PUBLIC const funnel_ops_t* funnel_get_funnel_ops(void);
91WS_DLL_PUBLIC bool funnel_menu_registered(void);
92
93WS_DLL_PUBLIC void funnel_register_menu(const char *name,
94 register_stat_group_t group,
95 funnel_menu_callback callback,
96 void *callback_data,
97 funnel_menu_callback_data_free callback_data_free,
98 bool retap);
99
100 void funnel_deregister_menus(funnel_menu_callback callback);
101
102 typedef void (*funnel_registration_cb_t)(const char *name,
103 register_stat_group_t group,
104 funnel_menu_callback callback,
105 void *callback_data,
106 bool retap);
107 typedef void (*funnel_deregistration_cb_t)(funnel_menu_callback callback);
108
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
116 typedef void (* funnel_packet_menu_callback)(void *, GPtrArray*);
117
121 typedef void (*funnel_registration_packet_cb_t)(const char *name,
122 const char *required_fields,
123 funnel_packet_menu_callback callback,
124 void *callback_data,
125 bool retap);
126
132WS_DLL_PUBLIC void funnel_register_all_packet_menus(funnel_registration_packet_cb_t r_cb);
133
143WS_DLL_PUBLIC void funnel_register_packet_menu(const char *name,
144 const char *required_fields,
145 funnel_packet_menu_callback callback,
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
169 typedef int (*funnel_console_eval_cb_t)(const char *console_input,
170 char **error_ptr,
171 char **error_hint,
172 void *callback_data);
173
177 typedef void (*funnel_console_open_cb_t)(void (*print_func)(const char *, void *), void *print_data, void *callback_data);
178
182 typedef void (*funnel_console_close_cb_t)(void *callback_data);
183
187 typedef void (*funnel_console_data_free_cb_t)(void *callback_data);
188
192WS_DLL_PUBLIC void funnel_register_console_menu(const char *name,
193 funnel_console_eval_cb_t eval_cb,
194 funnel_console_open_cb_t open_cb,
195 funnel_console_close_cb_t close_cb,
196 void *callback_data,
197 funnel_console_data_free_cb_t free_data);
198
202 typedef void (*funnel_registration_console_cb_t)(const char *name,
203 funnel_console_eval_cb_t eval_cb,
204 funnel_console_open_cb_t open_cb,
205 funnel_console_close_cb_t close_cb,
206 void *callback_data);
207
214WS_DLL_PUBLIC void funnel_ops_init(const funnel_ops_t* ops, funnel_registration_cb_t r_cb, funnel_registration_console_cb_t rconsole_cb);
215
216#ifdef __cplusplus
217}
218#endif /* __cplusplus */
219
220#endif /* __FUNNEL_H__ */
funnel_packet_menu_callback
void(* funnel_packet_menu_callback)(void *, GPtrArray *)
Definition funnel.h:116
funnel_register_console_menu
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:253
funnel_registration_console_cb_t
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
funnel_packet_menus_modified
WS_DLL_PUBLIC bool funnel_packet_menus_modified(void)
Definition funnel.c:245
funnel_console_open_cb_t
void(* funnel_console_open_cb_t)(void(*print_func)(const char *, void *), void *print_data, void *callback_data)
Definition funnel.h:177
funnel_register_packet_menu
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:191
funnel_ops_init
WS_DLL_PUBLIC void funnel_ops_init(const funnel_ops_t *ops, funnel_registration_cb_t r_cb, funnel_registration_console_cb_t rconsole_cb)
Definition funnel.c:295
funnel_console_data_free_cb_t
void(* funnel_console_data_free_cb_t)(void *callback_data)
Definition funnel.h:187
funnel_register_all_packet_menus
WS_DLL_PUBLIC void funnel_register_all_packet_menus(funnel_registration_packet_cb_t r_cb)
Definition funnel.c:230
funnel_console_eval_cb_t
int(* funnel_console_eval_cb_t)(const char *console_input, char **error_ptr, char **error_hint, void *callback_data)
Definition funnel.h:169
funnel_console_close_cb_t
void(* funnel_console_close_cb_t)(void *callback_data)
Definition funnel.h:182
funnel_registration_packet_cb_t
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
stat_groups.h
register_stat_group_t
enum register_stat_group_e register_stat_group_t
_funnel_bt_t
Definition funnel.h:36
_funnel_ops_id_t
Definition funnel_statistics.cpp:250
_funnel_ops_t
Definition funnel.h:46
_funnel_text_window_t
Definition tap-funnel.c:21
print_data
Definition print.c:40
progdlg
Definition progress_frame.h:31