Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
wslua_file_common.h
1 /*
2  * wslua_file_common.h
3  *
4  * Wireshark's interface to the Lua Programming Language
5  * for file handling related source files.
6  *
7  * (c) 2014, Hadriel Kaplan <hadrielk@yahoo.com>
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
12  *
13  * SPDX-License-Identifier: GPL-2.0-or-later
14  */
15 
16 
17 /* See wslua_file_common.c for details */
18 
19 #include "config.h"
20 
21 #include "wslua.h"
22 #include <wiretap/wtap-int.h>
23 
24 /* this is way overkill for this one member, but in case we need to add
25  more in the future, the plumbing will be here */
26 typedef struct _file_priv_t {
27  int table_ref;
28 } file_priv_t;
29 
30 /* create and set the wtap->priv private data for the file instance */
31 extern void create_wth_priv(lua_State* L, wtap *wth);
32 
33 /* gets the private data table from wtap */
34 extern int get_wth_priv_table_ref(lua_State* L, wtap *wth);
35 
36 /* sets the private data to wtap - the table is presumed on top of stack */
37 extern int set_wth_priv_table_ref(lua_State* L, wtap *wth);
38 
39 /* remove, deref, and free the wtap->priv data */
40 extern void remove_wth_priv(lua_State* L, wtap *wth);
41 
42 /* create and set the wtap_dumper->priv private data for the file instance */
43 extern void create_wdh_priv(lua_State* L, wtap_dumper *wdh);
44 
45 /* get the private data from wtap_dumper */
46 extern int get_wdh_priv_table_ref(lua_State* L, wtap_dumper *wdh);
47 
48 /* sets the private data to wtap - the table is presumed on top of stack */
49 extern int set_wdh_priv_table_ref(lua_State* L, wtap_dumper *wdh);
50 
51 /* remove and deref the wtap_dumper->priv data */
52 extern void remove_wdh_priv(lua_State* L, wtap_dumper *wdh);
53 
54 /* implemented in other c files than wslua_file_common.c */
55 extern CaptureInfo* push_CaptureInfo(lua_State* L, wtap *wth, const gboolean first_time);
56 extern CaptureInfoConst* push_CaptureInfoConst(lua_State* L, wtap_dumper *wdh);
57 extern File* push_File(lua_State* L, FILE_T ft);
58 extern File* push_Wdh(lua_State* L, wtap_dumper *wdh);
59 extern FrameInfo* push_FrameInfo(lua_State* L, wtap_rec *rec, Buffer* buf);
60 extern FrameInfoConst* push_FrameInfoConst(lua_State* L, const wtap_rec *rec, const guint8 *pd);
61 
62 
63 /*
64  * Editor modelines - http://www.wireshark.org/tools/modelines.html
65  *
66  * Local variables:
67  * c-basic-offset: 4
68  * tab-width: 8
69  * indent-tabs-mode: nil
70  * End:
71  *
72  * vi: set shiftwidth=4 tabstop=8 expandtab:
73  * :indentSize=4:tabSize=8:noTabs=true:
74  */
Definition: wslua_file_common.h:26
Definition: wslua.h:251
Definition: wslua.h:263
Definition: wtap-int.h:34
Definition: buffer.h:21
Definition: wslua.h:257
Definition: wslua.h:244
Definition: wtap.h:1274
Definition: file_wrappers.c:78
Definition: wtap-int.h:86