regen pidl all: rm epan/dissectors/pidl/*-stamp; pushd epan/dissectors/pidl/ && make...
[wireshark-sm.git] / epan / wslua / wslua_capture_info.c
blob6fb2578468947ece3e5b621f40e2a2a2f722a9ee
1 /*
2 * wslua_capture_info.c
4 * Wireshark's interface to the Lua Programming Language
5 * for capture file data and meta-data.
7 * (c) 2014, Hadriel Kaplan <hadrielk@yahoo.com>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include "config.h"
17 #include "wslua_file_common.h"
19 #include <epan/addr_resolv.h>
22 /* WSLUA_CONTINUE_MODULE File */
25 WSLUA_CLASS_DEFINE(CaptureInfo,FAIL_ON_NULL_OR_EXPIRED("CaptureInfo"));
27 A `CaptureInfo` object, passed into Lua as an argument by `FileHandler` callback
28 function `read_open()`, `read()`, `seek_read()`, `seq_read_close()`, and `read_close()`.
29 This object represents capture file data and meta-data (data about the
30 capture file) being read into Wireshark/TShark.
32 This object's fields can be written-to by Lua during the read-based function callbacks.
33 In other words, when the Lua plugin's `FileHandler.read_open()` function is invoked, a
34 `CaptureInfo` object will be passed in as one of the arguments, and its fields
35 should be written to by your Lua code to tell Wireshark about the capture.
38 CaptureInfo* push_CaptureInfo(lua_State* L, wtap *wth, const bool first_time) {
39 CaptureInfo f;
41 if (!wth) {
42 luaL_error(L, "Internal error: wth is NULL!");
43 return NULL;
46 f = (CaptureInfo) g_malloc0(sizeof(struct _wslua_captureinfo));
47 f->wth = wth;
48 f->wdh = NULL;
49 f->expired = false;
51 if (first_time) {
52 /* XXX: need to do this? */
53 wth->file_encap = WTAP_ENCAP_UNKNOWN;
54 wth->file_tsprec = WTAP_TSPREC_UNKNOWN;
55 wth->snapshot_length = 0;
58 return pushCaptureInfo(L,f);
61 WSLUA_METAMETHOD CaptureInfo__tostring(lua_State* L) {
62 /* Generates a string of debug info for the CaptureInfo */
63 CaptureInfo fi = toCaptureInfo(L,1);
65 if (!fi || !fi->wth) {
66 lua_pushstring(L,"CaptureInfo pointer is NULL!");
67 } else {
68 wtap *wth = fi->wth;
69 lua_pushfstring(L, "CaptureInfo: file_type_subtype=%d, snapshot_length=%d, file_encap=%d, file_tsprec='%s'",
70 wth->file_type_subtype, wth->snapshot_length, wth->file_encap, wth->file_tsprec);
73 WSLUA_RETURN(1); /* String of debug information. */
77 static int CaptureInfo__gc(lua_State* L) {
78 CaptureInfo fc = toCaptureInfo(L,1);
79 g_free(fc);
80 return 0;
83 /* WSLUA_ATTRIBUTE CaptureInfo_encap RW The packet encapsulation type for the whole file.
85 See `wtap_encaps` for available types. Set to `wtap_encaps.PER_PACKET` if packets can
86 have different types, then later set `FrameInfo.encap` for each packet during `read()`/`seek_read()`.
88 WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(CaptureInfo,encap,wth->file_encap);
89 WSLUA_ATTRIBUTE_NAMED_INTEGER_SETTER(CaptureInfo,encap,wth->file_encap,int);
91 /* WSLUA_ATTRIBUTE CaptureInfo_time_precision RW The precision of the packet timestamps in the file.
93 See `wtap_file_tsprec` for available precisions.
95 WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(CaptureInfo,time_precision,wth->file_tsprec);
96 WSLUA_ATTRIBUTE_NAMED_INTEGER_SETTER(CaptureInfo,time_precision,wth->file_tsprec,int);
98 /* WSLUA_ATTRIBUTE CaptureInfo_snapshot_length RW The maximum packet length that could be recorded.
100 Setting it to `0` means unknown.
102 WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(CaptureInfo,snapshot_length,wth->snapshot_length);
103 WSLUA_ATTRIBUTE_NAMED_INTEGER_SETTER(CaptureInfo,snapshot_length,wth->snapshot_length,unsigned);
105 /* WSLUA_ATTRIBUTE CaptureInfo_comment RW A string comment for the whole capture file,
106 or nil if there is no `comment`. */
107 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_NTH_STRING_GETTER(CaptureInfo,comment,wth->shb_hdrs,OPT_COMMENT);
108 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_NTH_STRING_SETTER(CaptureInfo,comment,wth->shb_hdrs,OPT_COMMENT);
110 /* WSLUA_ATTRIBUTE CaptureInfo_hardware RW A string containing the description of
111 the hardware used to create the capture, or nil if there is no `hardware` string. */
112 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_GETTER(CaptureInfo,hardware,wth->shb_hdrs,OPT_SHB_HARDWARE);
113 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_SETTER(CaptureInfo,hardware,wth->shb_hdrs,OPT_SHB_HARDWARE);
115 /* WSLUA_ATTRIBUTE CaptureInfo_os RW A string containing the name of
116 the operating system used to create the capture, or nil if there is no `os` string. */
117 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_GETTER(CaptureInfo,os,wth->shb_hdrs,OPT_SHB_OS);
118 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_SETTER(CaptureInfo,os,wth->shb_hdrs,OPT_SHB_OS);
120 /* WSLUA_ATTRIBUTE CaptureInfo_user_app RW A string containing the name of
121 the application used to create the capture, or nil if there is no `user_app` string. */
122 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_GETTER(CaptureInfo,user_app,wth->shb_hdrs,OPT_SHB_USERAPPL);
123 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_SETTER(CaptureInfo,user_app,wth->shb_hdrs,OPT_SHB_USERAPPL);
125 /* WSLUA_ATTRIBUTE CaptureInfo_hosts WO Sets resolved ip-to-hostname information.
127 The value set must be a Lua table of two key-ed names: `ipv4_addresses` and `ipv6_addresses`.
128 The value of each of these names are themselves array tables, of key-ed tables, such that the inner table has a key
129 `addr` set to the raw 4-byte or 16-byte IP address Lua string and a `name` set to the resolved name.
131 For example, if the capture file identifies one resolved IPv4 address of 1.2.3.4 to `foo.com`, then you must set
132 `CaptureInfo.hosts` to a table of:
134 [source,lua]
135 ----
136 { ipv4_addresses = { { addr = "\01\02\03\04", name = "foo.com" } } }
137 ----
139 Note that either the `ipv4_addresses` or the `ipv6_addresses` table, or both, may be empty or nil.
141 static int CaptureInfo_set_hosts(lua_State* L) {
142 CaptureInfo fi = checkCaptureInfo(L,1);
143 wtap *wth = fi->wth;
144 const char *addr = NULL;
145 const char *name = NULL;
146 size_t addr_len = 0;
147 size_t name_len = 0;
148 uint32_t v4_addr = 0;
149 ws_in6_addr v6_addr = { {0} };
151 if (!wth->add_new_ipv4 || !wth->add_new_ipv6) {
152 return luaL_error(L, "CaptureInfo wtap has no IPv4 or IPv6 name resolution");
155 if (!lua_istable(L,-1)) {
156 return luaL_error(L, "CaptureInfo.host must be set to a table");
159 /* get the ipv4_addresses table */
160 lua_getfield(L, -1, "ipv4_addresses");
162 if (lua_istable(L,-1)) {
163 /* now walk the table */
164 lua_pushnil(L); /* first key */
165 while (lua_next(L, -2) != 0) {
166 /* 'key' (at index -2) and 'value' (at index -1) */
167 if (!lua_istable(L,-1)) {
168 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
169 return luaL_error(L, "CaptureInfo.host ipv4_addresses table does not contain a table");
172 lua_getfield(L, -1, "addr");
173 if (!lua_isstring(L,-1)) {
174 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
175 return luaL_error(L, "CaptureInfo.host ipv4_addresses table's table does not contain an 'addr' field");
177 addr = luaL_checklstring(L,-1,&addr_len);
178 if (addr_len != 4) {
179 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
180 return luaL_error(L, "CaptureInfo.host ipv4_addresses 'addr' value is not 4 bytes long");
182 memcpy(&v4_addr, addr, 4);
184 lua_getfield(L, -1, "name");
185 if (!lua_isstring(L,-1)) {
186 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
187 return luaL_error(L, "CaptureInfo.host ipv4_addresses table's table does not contain an 'addr' field");
189 name = luaL_checklstring(L,-1,&name_len);
191 wth->add_new_ipv4(v4_addr, name, false);
193 /* removes 'value'; keeps 'key' for next iteration */
194 lua_pop(L, 1);
198 /* wasn't a table, or it was and we walked it; either way pop it */
199 lua_pop(L,1);
202 /* get the ipv6_addresses table */
203 lua_getfield(L, -1, "ip6_addresses");
205 if (lua_istable(L,-1)) {
206 /* now walk the table */
207 lua_pushnil(L); /* first key */
208 while (lua_next(L, -2) != 0) {
209 /* 'key' (at index -2) and 'value' (at index -1) */
210 if (!lua_istable(L,-1)) {
211 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
212 return luaL_error(L, "CaptureInfo.host ipv6_addresses table does not contain a table");
215 lua_getfield(L, -1, "addr");
216 if (!lua_isstring(L,-1)) {
217 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
218 return luaL_error(L, "CaptureInfo.host ipv6_addresses table's table does not contain an 'addr' field");
220 addr = luaL_checklstring(L,-1,&addr_len);
221 if (addr_len != 16) {
222 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
223 return luaL_error(L, "CaptureInfo.host ipv6_addresses 'addr' value is not 16 bytes long");
225 memcpy(&v6_addr, addr, 16);
227 lua_getfield(L, -1, "name");
228 if (!lua_isstring(L,-1)) {
229 lua_pop(L, 3); /* remove whatever it is, the key, and the ipv4_addresses table */
230 return luaL_error(L, "CaptureInfo.host ipv6_addresses table's table does not contain an 'addr' field");
232 name = luaL_checklstring(L,-1,&name_len);
234 wth->add_new_ipv6((const void *)(&v6_addr), name, false);
236 /* removes 'value'; keeps 'key' for next iteration */
237 lua_pop(L, 1);
241 /* wasn't a table, or it was and we walked it; either way pop it */
242 lua_pop(L,1);
244 return 0;
248 /* WSLUA_ATTRIBUTE CaptureInfo_private_table RW A private Lua value unique to this file.
250 The `private_table` is a field you set/get with your own Lua table.
251 This is provided so that a Lua script can save per-file reading/writing
252 state, because multiple files can be opened and read at the same time.
254 For example, if the user issued a reload-file command, or Lua called the
255 `reload()` function, then the current capture file is still open while a new one
256 is being opened, and thus Wireshark will invoke `read_open()` while the previous
257 capture file has not caused `read_close()` to be called; and if the `read_open()`
258 succeeds then `read_close()` will be called right after that for the previous
259 file, rather than the one just opened. Thus the Lua script can use this
260 `private_table` to store a table of values specific to each file, by setting
261 this `private_table` in the `read_open()` function, which it can then later get back
262 inside its `read()`, `seek_read()`, and `read_close()` functions.
264 static int CaptureInfo_get_private_table(lua_State* L) {
265 CaptureInfo fi = checkCaptureInfo(L,1);
266 return get_wth_priv_table_ref(L, fi->wth);
269 static int CaptureInfo_set_private_table(lua_State* L) {
270 CaptureInfo fi = checkCaptureInfo(L,1);
271 return set_wth_priv_table_ref(L, fi->wth);
274 WSLUA_ATTRIBUTES CaptureInfo_attributes[] = {
275 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,encap),
276 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,time_precision),
277 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,snapshot_length),
278 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,comment),
279 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,hardware),
280 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,os),
281 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,user_app),
282 WSLUA_ATTRIBUTE_WOREG(CaptureInfo,hosts),
283 WSLUA_ATTRIBUTE_RWREG(CaptureInfo,private_table),
284 { NULL, NULL, NULL }
287 WSLUA_META CaptureInfo_meta[] = {
288 WSLUA_CLASS_MTREG(CaptureInfo,tostring),
289 { NULL, NULL }
292 int CaptureInfo_register(lua_State* L) {
293 WSLUA_REGISTER_META_WITH_ATTRS(CaptureInfo);
294 return 0;
298 WSLUA_CLASS_DEFINE(CaptureInfoConst,FAIL_ON_NULL_OR_EXPIRED("CaptureInfoConst"));
300 A `CaptureInfoConst` object, passed into Lua as an argument to the `FileHandler` callback
301 function `write_open()`.
303 This object represents capture file data and meta-data (data about the
304 capture file) for the current capture in Wireshark/TShark.
306 This object's fields are read-from when used by `write_open` function callback.
307 In other words, when the Lua plugin's FileHandler `write_open` function is invoked, a
308 `CaptureInfoConst` object will be passed in as one of the arguments, and its fields
309 should be read from by your Lua code to get data about the capture that needs to be written.
312 CaptureInfoConst* push_CaptureInfoConst(lua_State* L, wtap_dumper *wdh) {
313 CaptureInfoConst f;
315 if (!wdh) {
316 luaL_error(L, "Internal error: wdh is NULL!");
317 return NULL;
320 f = (CaptureInfoConst) g_malloc0(sizeof(struct _wslua_captureinfo));
321 f->wth = NULL;
322 f->wdh = wdh;
323 f->expired = false;
324 return pushCaptureInfoConst(L,f);
327 WSLUA_METAMETHOD CaptureInfoConst__tostring(lua_State* L) {
328 /* Generates a string of debug info for the CaptureInfoConst */
329 CaptureInfoConst fi = toCaptureInfoConst(L,1);
331 if (!fi || !fi->wdh) {
332 lua_pushstring(L,"CaptureInfoConst pointer is NULL!");
333 } else {
334 wtap_dumper *wdh = fi->wdh;
335 lua_pushfstring(L, "CaptureInfoConst: file_type_subtype=%d, snaplen=%d, encap=%d, compression_type=%d",
336 wdh->file_type_subtype, wdh->snaplen, wdh->file_encap, wdh->compression_type);
339 WSLUA_RETURN(1); /* String of debug information. */
342 /* WSLUA_ATTRIBUTE CaptureInfoConst_type RO The file type. */
343 WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(CaptureInfoConst,type,wdh->file_type_subtype);
345 /* WSLUA_ATTRIBUTE CaptureInfoConst_snapshot_length RO The maximum packet length that is actually recorded (vs. the original
346 length of any given packet on-the-wire). A value of `0` means the snapshot length is unknown or there is no one
347 such length for the whole file. */
348 WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(CaptureInfoConst,snapshot_length,wdh->snaplen);
350 /* WSLUA_ATTRIBUTE CaptureInfoConst_encap RO The packet encapsulation type for the whole file.
352 See `wtap_encaps` for available types. It is set to `wtap_encaps.PER_PACKET` if packets can
353 have different types, in which case each Frame identifies its type, in `FrameInfo.packet_encap`. */
354 WSLUA_ATTRIBUTE_NAMED_INTEGER_GETTER(CaptureInfoConst,encap,wdh->file_encap);
356 /* WSLUA_ATTRIBUTE CaptureInfoConst_comment RW A comment for the whole capture file, if the
357 `wtap_presence_flags.COMMENTS` was set in the presence flags; nil if there is no comment. */
358 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_GETTER(CaptureInfoConst,comment,wth->shb_hdrs,OPT_COMMENT);
360 /* WSLUA_ATTRIBUTE CaptureInfoConst_hardware RO A string containing the description of
361 the hardware used to create the capture, or nil if there is no hardware string. */
362 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_GETTER(CaptureInfoConst,hardware,wth->shb_hdrs,OPT_SHB_HARDWARE);
364 /* WSLUA_ATTRIBUTE CaptureInfoConst_os RO A string containing the name of
365 the operating system used to create the capture, or nil if there is no os string. */
366 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_GETTER(CaptureInfoConst,os,wth->shb_hdrs,OPT_SHB_OS);
368 /* WSLUA_ATTRIBUTE CaptureInfoConst_user_app RO A string containing the name of
369 the application used to create the capture, or nil if there is no user_app string. */
370 WSLUA_ATTRIBUTE_NAMED_OPT_BLOCK_STRING_GETTER(CaptureInfoConst,user_app,wth->shb_hdrs,OPT_SHB_USERAPPL);
372 /* WSLUA_ATTRIBUTE CaptureInfoConst_hosts RO A ip-to-hostname Lua table of two key-ed names: `ipv4_addresses` and `ipv6_addresses`.
373 The value of each of these names are themselves array tables, of key-ed tables, such that the inner table has a key
374 `addr` set to the raw 4-byte or 16-byte IP address Lua string and a `name` set to the resolved name.
376 For example, if the current capture has one resolved IPv4 address of 1.2.3.4 to `foo.com`, then getting
377 `CaptureInfoConst.hosts` will get a table of:
379 [source,lua]
380 ----
381 { ipv4_addresses = { { addr = "\01\02\03\04", name = "foo.com" } }, ipv6_addresses = { } }
382 ----
384 Note that either the `ipv4_addresses` or the `ipv6_addresses` table, or both, may be empty, however they will not
385 be nil. */
386 static int CaptureInfoConst_get_hosts(lua_State* L) {
387 CaptureInfoConst fi = checkCaptureInfoConst(L,1);
388 wtap_dumper *wdh = fi->wdh;
390 /* create the main table to return */
391 lua_newtable(L);
393 /* create the ipv4_addresses table */
394 lua_newtable(L);
396 if (wdh->addrinfo_lists && wdh->addrinfo_lists->ipv4_addr_list) {
397 hashipv4_t *ipv4_hash_list_entry = (hashipv4_t *)g_list_nth_data(wdh->addrinfo_lists->ipv4_addr_list, 0);
398 int i, j;
399 for (i=1, j=1; ipv4_hash_list_entry != NULL; i++) {
400 if ((ipv4_hash_list_entry->flags & USED_AND_RESOLVED_MASK) == RESOLVED_ADDRESS_USED) {
401 lua_pushnumber(L, j); /* push numeric index key starting at 1, so it will be an array table */
402 /* create the entry table */
403 lua_newtable(L);
404 /* addr is in network order already */
405 lua_pushlstring(L, (char*)(&ipv4_hash_list_entry->ip), 4);
406 lua_setfield(L, -2, "addr");
407 lua_pushstring(L, ipv4_hash_list_entry->name);
408 lua_setfield(L, -2, "name");
409 /* now our ipv4_addresses table is at -3, key number is -2, and entry table at -2, so we're good */
410 lua_settable(L, -3);
411 j++;
413 ipv4_hash_list_entry = (hashipv4_t *)g_list_nth_data(wdh->addrinfo_lists->ipv4_addr_list, i);
417 /* set the (possibly empty) ipv4_addresses table into the main table */
418 lua_setfield(L, -2, "ipv4_addresses");
420 /* create the ipv6_addresses table */
421 lua_newtable(L);
423 if (wdh->addrinfo_lists && wdh->addrinfo_lists->ipv6_addr_list) {
424 hashipv6_t *ipv6_hash_list_entry = (hashipv6_t *)g_list_nth_data(wdh->addrinfo_lists->ipv6_addr_list, 0);
425 int i, j;
426 for (i=1, j=1; ipv6_hash_list_entry != NULL; i++) {
427 if ((ipv6_hash_list_entry->flags & USED_AND_RESOLVED_MASK) == RESOLVED_ADDRESS_USED) {
428 lua_pushnumber(L, j); /* push numeric index key starting at 1, so it will be an array table */
429 /* create the entry table */
430 lua_newtable(L);
431 /* addr is in network order already */
432 lua_pushlstring(L, (char*)(&ipv6_hash_list_entry->addr[0]), 16);
433 lua_setfield(L, -2, "addr");
434 lua_pushstring(L, ipv6_hash_list_entry->name);
435 lua_setfield(L, -2, "name");
436 /* now our ipv6_addresses table is at -3, key number is -2, and entry table at -2, so we're good */
437 lua_settable(L, -3);
438 j++;
440 ipv6_hash_list_entry = (hashipv6_t *)g_list_nth_data(wdh->addrinfo_lists->ipv6_addr_list, i);
444 /* set the (possibly empty) ipv6_addresses table into the main table */
445 lua_setfield(L, -2, "ip6_addresses");
447 /* return the main table */
448 return 1;
451 /* WSLUA_ATTRIBUTE CaptureInfoConst_private_table RW A private Lua value unique to this file.
453 The `private_table` is a field you set/get with your own Lua table.
454 This is provided so that a Lua script can save per-file reading/writing
455 state, because multiple files can be opened and read at the same time.
457 For example, if two Lua scripts issue a `Dumper:new_for_current()` call and the
458 current file happens to use your script's writer, then the Wireshark will invoke
459 `write_open()` while the previous capture file has not had `write_close()` called.
460 Thus the Lua script can use this `private_table` to store a table of values
461 specific to each file, by setting this `private_table` in the write_open()
462 function, which it can then later get back inside its `write()`, and `write_close()`
463 functions.
465 static int CaptureInfoConst_get_private_table(lua_State* L) {
466 CaptureInfoConst fi = checkCaptureInfoConst(L,1);
467 return get_wdh_priv_table_ref(L, fi->wdh);
470 static int CaptureInfoConst_set_private_table(lua_State* L) {
471 CaptureInfoConst fi = checkCaptureInfoConst(L,1);
472 return set_wdh_priv_table_ref(L, fi->wdh);
475 static int CaptureInfoConst__gc(lua_State* L) {
476 CaptureInfoConst fi = toCaptureInfoConst(L,1);
477 g_free(fi);
478 return 0;
481 WSLUA_ATTRIBUTES CaptureInfoConst_attributes[] = {
482 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,encap),
483 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,type),
484 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,snapshot_length),
485 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,comment),
486 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,hardware),
487 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,os),
488 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,user_app),
489 WSLUA_ATTRIBUTE_ROREG(CaptureInfoConst,hosts),
490 WSLUA_ATTRIBUTE_RWREG(CaptureInfoConst,private_table),
491 { NULL, NULL, NULL }
494 WSLUA_META CaptureInfoConst_meta[] = {
495 WSLUA_CLASS_MTREG(CaptureInfoConst,tostring),
496 { NULL, NULL }
499 int CaptureInfoConst_register(lua_State* L) {
500 WSLUA_REGISTER_META_WITH_ATTRS(CaptureInfoConst);
501 return 0;
506 * Editor modelines - https://www.wireshark.org/tools/modelines.html
508 * Local variables:
509 * c-basic-offset: 4
510 * tab-width: 8
511 * indent-tabs-mode: nil
512 * End:
514 * vi: set shiftwidth=4 tabstop=8 expandtab:
515 * :indentSize=4:tabSize=8:noTabs=true: