| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Typedefs | Functions
funnel.h File Reference
`#include <wireshark.h>`
`#include <epan/stat_groups.h>`

Go to the source code of this file.

## Classes
struct | _funnel_bt_t
| Represents a button attached to a funnel text window, bundling its callback, data, and cleanup functions. More...
struct | _funnel_ops_t
| Vtable of GUI operations provided to the Lua funnel API, abstracting all UI interactions behind function pointers. More...

## Typedefs
typedef struct _funnel_ops_id_t | funnel_ops_id_t
typedef struct _funnel_text_window_t | funnel_text_window_t
typedef void(* | text_win_close_cb_t) (void *)
typedef void(* | funnel_dlg_cb_t) (char **user_input, void *data)
typedef void(* | funnel_dlg_cb_data_free_t) (void *data)
typedef bool(* | funnel_bt_cb_t) (funnel_text_window_t *tw, void *data)
typedef void(* | funnel_menu_callback) (void *)
typedef void(* | funnel_menu_callback_data_free) (void *)
typedef struct _funnel_bt_t | funnel_bt_t
| Represents a button attached to a funnel text window, bundling its callback, data, and cleanup functions.
typedef struct _funnel_ops_t | funnel_ops_t
| Vtable of GUI operations provided to the Lua funnel API, abstracting all UI interactions behind function pointers.
typedef void(* | funnel_registration_cb_t) (const char *name, register_stat_group_t group, funnel_menu_callback callback, void *callback_data, bool retap)
typedef void(* | funnel_deregistration_cb_t) (funnel_menu_callback callback)
typedef void(* | funnel_packet_menu_callback) (void *, GPtrArray *)
typedef void(* | funnel_registration_packet_cb_t) (const char *name, const char *required_fields, funnel_packet_menu_callback callback, void *callback_data, bool retap)
typedef int(* | funnel_console_eval_cb_t) (const char *console_input, char **error_ptr, char **error_hint, void *callback_data)
typedef void(* | funnel_console_open_cb_t) (void(*print_func) (const char *, void *), void *print_data, void *callback_data)
typedef void(* | funnel_console_close_cb_t) (void *callback_data)
typedef void(* | funnel_console_data_free_cb_t) (void *callback_data)
typedef 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)

## Functions
WS_DLL_PUBLIC const funnel_ops_t * | funnel_get_funnel_ops (void)
| Get the funnel operations.
WS_DLL_PUBLIC void | funnel_set_funnel_ops (const funnel_ops_t *o)
| Set the funnel operations.
WS_DLL_PUBLIC bool | funnel_menu_registered (void)
| Checks if a menu is registered.
WS_DLL_PUBLIC void | funnel_register_menu (const char *name, register_stat_group_t group, funnel_menu_callback callback, void *callback_data, funnel_menu_callback_data_free callback_data_free, bool retap)
| Registers a menu callback.
void | funnel_deregister_menus (funnel_menu_callback callback)
| Deregisters a menu callback.
WS_DLL_PUBLIC void | funnel_reload_menus (funnel_deregistration_cb_t d_cb, funnel_registration_cb_t r_cb)
| Reloads the menus by deregistering and registering them again using provided callbacks.
WS_DLL_PUBLIC void | funnel_cleanup (void)
| Cleans up resources used by the funnel subsystem.
WS_DLL_PUBLIC void | funnel_register_all_packet_menus (funnel_registration_packet_cb_t r_cb)
| Entry point for Wireshark GUI to obtain all registered packet menus.
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)
| Entry point for Lua code to register a packet menu.
WS_DLL_PUBLIC bool | funnel_packet_menus_modified (void)
| Returns whether the packet menus have been modified since they were last registered.
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)
WS_DLL_PUBLIC void | funnel_ops_init (funnel_registration_cb_t r_cb, funnel_registration_console_cb_t rconsole_cb)
| Register the funnel menus. This is done outside of epan_init() because the funnel operations depend on GUI code.

## Detailed Description

EPAN's GUI mini-API

(c) 2006, Luis E. Garcia Ontanon luis@.nosp@m.onta.nosp@m.non.o.nosp@m.rg

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

## Typedef Documentation

## ◆ funnel_console_close_cb_t

typedef void(* funnel_console_close_cb_t) (void *callback_data)

Signature of function that can be called to remove logger.

## ◆ funnel_console_data_free_cb_t

typedef void(* funnel_console_data_free_cb_t) (void *callback_data)

Signature of function that can be called to free user data.

## ◆ funnel_console_eval_cb_t

typedef int(* funnel_console_eval_cb_t) (const char *console_input, char **error_ptr, char **error_hint, void *callback_data)

Signature of function that can be called to evaluate code. Returns zero on success, -1 if precompilation failed, positive for runtime errors.

## ◆ funnel_console_open_cb_t

typedef void(* funnel_console_open_cb_t) (void(*print_func)(const char *, void *), void *print_data, void *callback_data)

Signature of function that can be called to install a logger.

## ◆ funnel_packet_menu_callback

typedef void(* funnel_packet_menu_callback) (void *, GPtrArray *)

Signature of function that can be called from a custom packet menu entry

## ◆ funnel_registration_console_cb_t

typedef 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)

Signature of callback function to register console menu entries

## ◆ funnel_registration_packet_cb_t

typedef void(* funnel_registration_packet_cb_t) (const char *name, const char *required_fields, funnel_packet_menu_callback callback, void *callback_data, bool retap)

Signature of callback function to register packet menu entries

## Function Documentation

## ◆ funnel_cleanup()

WS_DLL_PUBLIC void funnel_cleanup | ( | void |  | ) |

Cleans up resources used by the funnel subsystem.

This function is responsible for freeing all allocated resources and cleaning up any state held by the funnel subsystem before it is terminated.

## ◆ funnel_deregister_menus()

void funnel_deregister_menus | ( | funnel_menu_callback | callback | ) |

Deregisters a menu callback.

Parameters

  callback | The callback function to be deregistered.

## ◆ funnel_get_funnel_ops()

WS_DLL_PUBLIC const funnel_ops_t * funnel_get_funnel_ops | ( | void |  | ) |

Get the funnel operations.

Returns
  Pointer to the funnel operations structure.

## ◆ funnel_menu_registered()

WS_DLL_PUBLIC bool funnel_menu_registered | ( | void |  | ) |

Checks if a menu is registered.

Returns
  true if the menu is registered, false otherwise.

## ◆ funnel_ops_init()

WS_DLL_PUBLIC void funnel_ops_init | ( | funnel_registration_cb_t | r_cb,
|  | funnel_registration_console_cb_t | rconsole_cb )

Register the funnel menus. This is done outside of epan_init() because the funnel operations depend on GUI code.

Parameters

  r_cb | function which will be called to register each menu entry
  rconsole_cb | function which will be called to register each console menu entry

## ◆ funnel_packet_menus_modified()

WS_DLL_PUBLIC bool funnel_packet_menus_modified | ( | void |  | ) |

Returns whether the packet menus have been modified since they were last registered.

Returns
  true if the packet menus were modified since the last registration

Returns whether the packet menus have been modified since they were last registered

Returns
  true if the packet menus were modified since the last registration

## ◆ funnel_register_all_packet_menus()

WS_DLL_PUBLIC void funnel_register_all_packet_menus | ( | funnel_registration_packet_cb_t | r_cb | ) |

Entry point for Wireshark GUI to obtain all registered packet menus.

Parameters

  r_cb | function which will be called to register each packet menu entry

Entry point for Wireshark GUI to obtain all registered packet menus

Calls the supplied callback for each packet menu registered with funnel_register_packet_menu().

Parameters

  r_cb | the callback function to call with each registered packet menu

## ◆ 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 )

Entry point for Lua code to register a console menu

Entry point for code to register a console menu

## ◆ funnel_register_menu()

WS_DLL_PUBLIC void funnel_register_menu | ( | const char * | name,
|  | register_stat_group_t | group,
|  | funnel_menu_callback | callback,
|  | void * | callback_data,
|  | funnel_menu_callback_data_free | callback_data_free,
|  | bool | retap )

Registers a menu callback.

Parameters

  name | The name of the menu to register.
  group | The group to which the menu belongs.
  callback | The callback function to be called when the menu is invoked.
  callback_data | User data to be passed to the callback function.
  callback_data_free | Function to free the user data when it's no longer needed.
  retap | Whether to retap packets after registering the menu.

## ◆ 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 )

Entry point for Lua code to register a packet menu.

Parameters

  name | packet menu item's name
  required_fields | fields required to be present for the packet menu to be displayed
  callback | function called when the menu item is invoked. The function must take one argument and return nothing.
  callback_data | Lua state for the callback function
  retap | whether or not to rescan all packets

Entry point for Lua code to register a packet menu

Stores the menu name and callback from the Lua code into registered_packet_menus so that the Wireshark GUI code can retrieve it with funnel_register_all_packet_menus().

## ◆ funnel_reload_menus()

WS_DLL_PUBLIC void funnel_reload_menus | ( | funnel_deregistration_cb_t | d_cb,
|  | funnel_registration_cb_t | r_cb )

Reloads the menus by deregistering and registering them again using provided callbacks.

Parameters

  d_cb | Callback function to deregister menu items.
  r_cb | Callback function to register new menu items.

## ◆ funnel_set_funnel_ops()

WS_DLL_PUBLIC void funnel_set_funnel_ops | ( | const funnel_ops_t * | o | ) |

Set the funnel operations.

Parameters

  o | Pointer to the opaque funnel operations structure.