wireshark-lua-api-declarations
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Test

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

Readme

Keywords

none

Package Sidebar

Install

npm i wireshark-lua-api-declarations

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

46.3 kB

Total Files

6

Last publish

Collaborators

  • novogrammer