| Wireshark 4.7.0 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

## Typedefs
typedef struct _file_priv_t | file_priv_t

## 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)
int | set_wth_priv_table_ref (lua_State *L, wtap *wth)
void | remove_wth_priv (lua_State *L, wtap *wth)
void | create_wdh_priv (lua_State *L, wtap_dumper *wdh)
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_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.

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

Parameters

  L | Lua state.
  wdh | Pointer to the wtap_dumper 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.

Parameters

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

Returns
  int Number of values on the stack.