diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-03-10 01:54:51 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-03-14 07:29:15 +0000 |
commit | 04c39bb0972bac1f95eb9394b5ca1086f19c0d93 (patch) | |
tree | 62171e4584b86bb746d6a73181eb7627a15b9e44 /epan/wslua/wslua.h | |
parent | a59ac1bd10d29d05ca5cd657b7c64ab13a08670d (diff) |
Add Lua heuristic dissector support
This adds the ability for Lua scripts to register heuristic dissectors
for any protocol that has registered a heuristic dissector list, such
as UDP, TCP, and ~50 others. The Lua function can also establish a
conversation tied to its Proto dissector, to avoid having to check the
heuristics for the same flow. The example dissector in the testsuite
has also been enhanced to include a heuristic dissector, to verify
the functionality and provide an example implementation.
Change-Id: Ie232602779f43d3418fe8db09c61d5fc0b59597a
Reviewed-on: https://code.wireshark.org/review/576
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua/wslua.h')
-rw-r--r-- | epan/wslua/wslua.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h index 9a41a714f0..840c61a28c 100644 --- a/epan/wslua/wslua.h +++ b/epan/wslua/wslua.h @@ -552,6 +552,7 @@ extern tvbuff_t* lua_tvb; extern dissector_handle_t lua_data_handle; extern gboolean lua_initialized; extern int lua_dissectors_table_ref; +extern int lua_heur_dissectors_table_ref; WSLUA_DECLARE_CLASSES() WSLUA_DECLARE_FUNCTIONS() @@ -565,8 +566,11 @@ extern const gchar* lua_shiftstring(lua_State* L,int idx); extern void wslua_setfuncs(lua_State *L, const luaL_Reg *l, int nup); extern const gchar* wslua_typeof_unknown; extern const gchar* wslua_typeof(lua_State *L, int idx); +extern gboolean wslua_get_table(lua_State *L, int idx, const gchar *name); +extern gboolean wslua_get_field(lua_State *L, int idx, const gchar *name); extern void wslua_assert_table_field_new(lua_State *L, int idx, const gchar *name); extern int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data); +extern int heur_dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data); extern void wslua_prefs_changed(void); extern void proto_register_lua(void); extern GString* lua_register_all_taps(void); |