3 * Wireshark's interface to the Lua Programming Language
4 * for file handling related source files.
6 * (c) 2014, Hadriel Kaplan <hadrielk@yahoo.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
16 /* See wslua_file_common.c for details */
19 #include <wiretap/wtap_opttypes.h>
20 #include <wiretap/wtap-int.h>
22 /* this is way overkill for this one member, but in case we need to add
23 more in the future, the plumbing will be here */
24 typedef struct _file_priv_t
{
28 /* create and set the wtap->priv private data for the file instance */
29 extern void create_wth_priv(lua_State
* L
, wtap
*wth
);
31 /* gets the private data table from wtap */
32 extern int get_wth_priv_table_ref(lua_State
* L
, wtap
*wth
);
34 /* sets the private data to wtap - the table is presumed on top of stack */
35 extern int set_wth_priv_table_ref(lua_State
* L
, wtap
*wth
);
37 /* remove, deref, and free the wtap->priv data */
38 extern void remove_wth_priv(lua_State
* L
, wtap
*wth
);
40 /* create and set the wtap_dumper->priv private data for the file instance */
41 extern void create_wdh_priv(lua_State
* L
, wtap_dumper
*wdh
);
43 /* get the private data from wtap_dumper */
44 extern int get_wdh_priv_table_ref(lua_State
* L
, wtap_dumper
*wdh
);
46 /* sets the private data to wtap - the table is presumed on top of stack */
47 extern int set_wdh_priv_table_ref(lua_State
* L
, wtap_dumper
*wdh
);
49 /* remove and deref the wtap_dumper->priv data */
50 extern void remove_wdh_priv(lua_State
* L
, wtap_dumper
*wdh
);
52 /* implemented in other c files than wslua_file_common.c */
53 extern CaptureInfo
* push_CaptureInfo(lua_State
* L
, wtap
*wth
, const bool first_time
);
54 extern CaptureInfoConst
* push_CaptureInfoConst(lua_State
* L
, wtap_dumper
*wdh
);
55 extern File
* push_File(lua_State
* L
, FILE_T ft
);
56 extern File
* push_Wdh(lua_State
* L
, wtap_dumper
*wdh
);
57 extern FrameInfo
* push_FrameInfo(lua_State
* L
, wtap_rec
*rec
, Buffer
* buf
);
58 extern FrameInfoConst
* push_FrameInfoConst(lua_State
* L
, const wtap_rec
*rec
, const uint8_t *pd
);
62 * Editor modelines - https://www.wireshark.org/tools/modelines.html
67 * indent-tabs-mode: nil
70 * vi: set shiftwidth=4 tabstop=8 expandtab:
71 * :indentSize=4:tabSize=8:noTabs=true: