| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Attributes | List of all members
wtap_wslua_file_info Struct Reference

Companion metadata block for Lua-based file writers registered via wslua, carrying the write-open callback reference and its associated state. More...

`#include <wtap.h>`

## Public Attributes
int(* | wslua_can_write_encap )(int, void *)
void * | wslua_data

## Detailed Description

Companion metadata block for Lua-based file writers registered via wslua, carrying the write-open callback reference and its associated state.

Similar to the wtap_open_routine_info for open routines, the following wtap_wslua_file_info struct is used by wslua code for Lua-based file writers.

This concept is necessary because when wslua goes to invoke the registered dump/write_open routine callback in Lua, it needs the ref number representing the hooked function inside Lua. This will be stored in the thing pointed to by the void* data here. This 'data' pointer will be copied into the wtap_dumper struct's 'void* data' member when calling the dump_open function, which is how wslua finally retrieves it. Unlike wtap_dumper's 'priv' member, its 'data' member is not free'd in wtap_dump_close().

## Member Data Documentation

## ◆ wslua_can_write_encap

int(* wtap_wslua_file_info::wslua_can_write_encap) (int, void *)

Callback that returns non-zero if the Lua writer supports the given WTAP_ENCAP_ encapsulation type; the void* receives wslua_data.

## ◆ wslua_data

void* wtap_wslua_file_info::wslua_data

Opaque pointer to the Lua state or ref data needed by wslua when invoking the registered write-open and dump callbacks.

The documentation for this struct was generated from the following file:

- /builds/wireshark/wireshark/wiretap/wtap.h