wireshark-lua-api-declarations
v1.0.0
Published
see [Lua in Wireshark](https://wiki.wireshark.org/Lua/) and [Chapter 11. Wireshark’s Lua API Reference Manual](https://www.wireshark.org/docs/wsdg_html_chunked/wsluarm_modules.html)
Downloads
3
Readme
Wireshark's Lua API TypeScript Declarations
see Lua in Wireshark and Chapter 11. Wireshark’s Lua API Reference Manual
Based on Wireshark 3.6.2
Limitation
typeof(obj)
typeof(obj)
is broken because of TypeScript's reserved word.
However, You can make equivalent function in TypeScript.
init.lua in wireshark
function typeof(obj)
local mt = getmetatable(obj)
return mt and mt.__typeof or obj.__typeof or type(obj)
end
your.ts
function typeof_ts(this:void,obj:any):string{
const mt = getmetatable(obj) as any;
if(mt!=null && mt.__typeof){
return mt.__typeof;
}
if(obj.__typeof){
return obj.__typeof;
}
return type(obj);
}
Regex Library
GRegex Binding is not supported in future version.
https://www.wireshark.org/docs/wsdg_html_chunked/lua_module_PCRE2.html
Example
https://github.com/novogrammer/wireshark-socketio-post-dissector