| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Typedefs | Functions
wslua_file_common.h File Reference
`#include "wslua.h"`
`#include <wiretap/wtap_opttypes.h>`
`#include <wiretap/wtap_module.h>`

Go to the source code of this file.

## Classes
struct | _file_priv_t
| Holds private Lua-managed state for a file handler instance; structured for extensibility should additional members be needed. More...

## Typedefs
typedef struct _file_priv_t | file_priv_t
| Holds private Lua-managed state for a file handler instance; structured for extensibility should additional members be needed.

## Functions
void | create_wth_priv (lua_State *L, wtap *wth)
| Creates private data for a wtap structure.
int | get_wth_priv_table_ref (lua_State *L, wtap *wth)
| Retrieves the private data table reference from a wtap structure.
int | set_wth_priv_table_ref (lua_State *L, wtap *wth)
| Sets the private data table reference for a wtap structure.
void | remove_wth_priv (lua_State *L, wtap *wth)
| Removes private data associated with a wtap structure.
void | create_wdh_priv (lua_State *L, wtap_dumper *wdh)
| Creates private data for a wtap_dumper structure.
int | get_wdh_priv_table_ref (lua_State *L, wtap_dumper *wdh)
| Retrieves the private data table reference from a wtap_dumper structure.
int | set_wdh_priv_table_ref (lua_State *L, wtap_dumper *wdh)
| Set or remove a Lua table reference in the wtap_dumper's private data.
void | remove_wdh_priv (lua_State *L, wtap_dumper *wdh)
| Removes private data associated with a wtap_dumper.
CaptureInfo * | push_CaptureInfo (lua_State *L, wtap *wth, const bool first_time)
| Pushes a CaptureInfo object onto the Lua stack.
CaptureInfoConst * | push_CaptureInfoConst (lua_State *L, wtap_dumper *wdh)
| Pushes a CaptureInfoConst object onto the Lua stack.
File * | push_File (lua_State *L, FILE_T ft)
| Pushes a File object onto the Lua stack.
File * | push_Wdh (lua_State *L, wtap_dumper *wdh)
| Pushes a wtap_dumper object to Lua.
FrameInfo * | push_FrameInfo (lua_State *L, wtap_rec *rec)
| Pushes a FrameInfo object onto the Lua stack.
FrameInfoConst * | push_FrameInfoConst (lua_State *L, const wtap_rec *rec, const uint8_t *pd)
| Pushes a FrameInfoConst object onto the Lua stack.

## Detailed Description

Wireshark's interface to the Lua Programming Language for file handling related source files.

(c) 2014, Hadriel Kaplan hadri.nosp@m.elk@.nosp@m.yahoo.nosp@m..com

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

## Function Documentation

## ◆ create_wdh_priv()

void create_wdh_priv | ( | lua_State * | L,
|  | wtap_dumper * | wdh )
| extern

Creates private data for a wtap_dumper structure.

Create and set the wtap_dumper->priv private data for the file instance

Parameters

  L | Lua state.
  wdh | Pointer to the wtap_dumper structure.

## ◆ create_wth_priv()

void create_wth_priv | ( | lua_State * | L,
|  | wtap * | wth )
| extern

Creates private data for a wtap structure.

Parameters

  L | Lua state.
  wth | Pointer to the wtap structure.

## ◆ get_wdh_priv_table_ref()

int get_wdh_priv_table_ref | ( | lua_State * | L,
|  | wtap_dumper * | wdh )
| extern

Retrieves the private data table reference from a wtap_dumper structure.

Parameters

  L | Lua state.
  wdh | Pointer to the wtap_dumper structure.

Returns
  int Number of values on the stack.

## ◆ get_wth_priv_table_ref()

int get_wth_priv_table_ref | ( | lua_State * | L,
|  | wtap * | wth )
| extern

Retrieves the private data table reference from a wtap structure.

Parameters

  L | The Lua state.
  wth | The wtap structure.

Returns
  The number of values pushed onto the stack.

## ◆ push_CaptureInfo()

CaptureInfo * push_CaptureInfo | ( | lua_State * | L,
|  | wtap * | wth,
|  | const bool | first_time )
| extern

Pushes a CaptureInfo object onto the Lua stack.

Parameters

  L | The Lua state.
  wth | The wtap structure.
  first_time | Indicates if this is the first time the function is called.

Returns
  A pointer to the pushed CaptureInfo object or NULL on error.

## ◆ push_CaptureInfoConst()

CaptureInfoConst * push_CaptureInfoConst | ( | lua_State * | L,
|  | wtap_dumper * | wdh )
| extern

Pushes a CaptureInfoConst object onto the Lua stack.

Parameters

  L | The Lua state.
  wdh | The wtap_dumper pointer.

Returns
  A pointer to the pushed CaptureInfoConst object, or NULL if an error occurs.

## ◆ push_File()

File * push_File | ( | lua_State * | L,
|  | FILE_T | ft )
| extern

Pushes a File object onto the Lua stack.

Parameters

  L | The Lua state.
  ft | The FILE_T to wrap.

Returns
  A pointer to the pushed File object.

## ◆ push_FrameInfo()

FrameInfo * push_FrameInfo | ( | lua_State * | L,
|  | wtap_rec * | rec )
| extern

Pushes a FrameInfo object onto the Lua stack.

Parameters

  L | The Lua state to push the FrameInfo onto.
  rec | The wtap_rec structure containing frame information.

Returns
  A pointer to the pushed FrameInfo object.

## ◆ push_FrameInfoConst()

FrameInfoConst * push_FrameInfoConst | ( | lua_State * | L,
|  | const wtap_rec * | rec,
|  | const uint8_t * | pd )
| extern

Pushes a FrameInfoConst object onto the Lua stack.

Parameters

  L | The Lua state to operate on.
  rec | A pointer to the wtap_rec structure representing the frame record.
  pd | A pointer to the packet data.

Returns
  A pointer to the pushed FrameInfoConst object.

## ◆ push_Wdh()

File * push_Wdh | ( | lua_State * | L,
|  | wtap_dumper * | wdh )
| extern

Pushes a wtap_dumper object to Lua.

Parameters

  L | The Lua state.
  wdh | The wtap_dumper object to push.

Returns
  File* A pointer to the pushed File object.

## ◆ remove_wdh_priv()

void remove_wdh_priv | ( | lua_State * | L,
|  | wtap_dumper * | wdh )
| extern

Removes private data associated with a wtap_dumper.

remove and deref the wtap_dumper->priv data

Parameters

  L | Lua state.
  wdh | Pointer to the wtap_dumper whose private data is to be removed.

## ◆ remove_wth_priv()

void remove_wth_priv | ( | lua_State * | L,
|  | wtap * | wth )
| extern

Removes private data associated with a wtap structure.

remove, deref, and free the wtap->priv data

Parameters

  L | The Lua state.
  wth | Pointer to the wtap structure whose private data is to be removed.

## ◆ set_wdh_priv_table_ref()

int set_wdh_priv_table_ref | ( | lua_State * | L,
|  | wtap_dumper * | wdh )
| extern

Set or remove a Lua table reference in the wtap_dumper's private data.

sets the private data to wtap - the table is presumed on top of stack

Parameters

  L | The Lua state.
  wdh | The wtap_dumper structure.

Returns
  int Number of values on the stack.

## ◆ set_wth_priv_table_ref()

int set_wth_priv_table_ref | ( | lua_State * | L,
|  | wtap * | wth )
| extern

Sets the private data table reference for a wtap structure.

Sets the private data to wtap - the table is presumed on top of stack

Parameters

  L | The Lua state.
  wth | The wtap structure.

Returns
  The number of values pushed onto the stack.