diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2006-01-26 20:20:55 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2006-01-26 20:20:55 +0000 |
commit | 094840aa97a1e4c6d02786e69f4abd1f0163230f (patch) | |
tree | 4daf6498b0541fa36ef8152e0e885bc416248eba /plugins/lua/packet-lua.h | |
parent | 65530eb91278a0c548ea2bcbcf7717f2db153093 (diff) |
* lua_tree.c
* protect proto_item_add_* calls with a TRY CATCH to avoid the Lua state getting corrupted
* new ProtoItem:add_expert_info() call
* lua_proto.c
* protect call_dissector() and dissector_try_*() calls with TRY CATCH to avoid the Lua state getting corrupted
* ValueString makes no sense, get rid of it we'll use Lua's associative arrays instead
* lua_tvb.c
* while creating a tvb from a ByteArray copy the ByteArray's data and set the tvb's free_cb
* check bounds before calling tvb_*() to avoid a longjmp breaking Lua
* do not leak the string in Tvb_tostring()
* new Tvb:get_ipv4() call
* new Tvb:get_eth() call
* packet-lua.[ch]
* export lua_tvb and lua_malformed to other modules being the current tvb and the protocol_id of malformed
* convert some Lua to C
* do not register ValueString (eliminated)
svn path=/trunk/; revision=17106
Diffstat (limited to 'plugins/lua/packet-lua.h')
-rw-r--r-- | plugins/lua/packet-lua.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/lua/packet-lua.h b/plugins/lua/packet-lua.h index e51c040229..c29c049171 100644 --- a/plugins/lua/packet-lua.h +++ b/plugins/lua/packet-lua.h @@ -48,6 +48,8 @@ #include <epan/report_err.h> #include <epan/emem.h> +#define LUA_DISSECTORS_TABLE "dissectors" + typedef struct _eth_field_t { int hfid; char* name; @@ -89,9 +91,6 @@ typedef struct _eth_proto_t { typedef struct {const gchar* str; enum ftenum id; } eth_ft_types_t; -#define VALUE_STRING "ValueString" -typedef GArray* ValueString; - #define PROTO_FIELD "ProtoField" typedef struct _eth_field_t* ProtoField; @@ -177,6 +176,8 @@ C* push##C(lua_State* L, C v) { \ extern packet_info* lua_pinfo; extern proto_tree* lua_tree; +extern tvbuff_t* lua_tvb; +extern int lua_malformed; extern dissector_handle_t lua_data_handle; #define LUA_CLASS_DECLARE(C,CN) \ @@ -187,7 +188,6 @@ extern int C##_register(lua_State* L); LUA_CLASS_DECLARE(Tap,TAP); LUA_CLASS_DECLARE(Field,FIELD); -LUA_CLASS_DECLARE(ValueString,VALUE_STRING); LUA_CLASS_DECLARE(ProtoField,PROTO_FIELD); LUA_CLASS_DECLARE(ProtoFieldArray,PROTO_FIELD_ARRAY); LUA_CLASS_DECLARE(SubTreeType,SUB_TREE_TYPE); @@ -211,4 +211,6 @@ extern void lua_tap_draw(void *tapdata); extern GString* register_all_lua_taps(void); +#define WARNSTACK(s) {int i; for (i = 1; i <= lua_gettop(L); i++) g_warning("-%s-> %i %s",s,i , lua_typename(L,lua_type(L,i))); } + #endif |