diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2011-10-18 17:46:00 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2011-10-18 17:46:00 +0000 |
commit | 82e0b650388aa4f89c4fc371eab057b278b59f92 (patch) | |
tree | 1e4c56840b5168eaee0ac033059ea671f00f79a4 /epan/wslua/wslua.h | |
parent | cc4fe5789b6f294df614afafb6c265e3171370ee (diff) |
Added a private hash table to transport string values between dissectors.
This works between C and Lua.
In C the pinfo.private_table pointer must be initialized using
g_hash_table_new (g_str_hash, g_str_equal);
In Lua the values are available using pinfo.private.<key>, and the
table is created automatically on first usage. It's possible to use
this datatypes: nil, boolean, number and string, but every value
is converted to string so numbers must be converted using tonumber()
on usage. Boolean is either nil or an empty string.
svn path=/trunk/; revision=39461
Diffstat (limited to 'epan/wslua/wslua.h')
-rw-r--r-- | epan/wslua/wslua.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h index a7a6447354..ffa2a84c37 100644 --- a/epan/wslua/wslua.h +++ b/epan/wslua/wslua.h @@ -165,6 +165,12 @@ struct _wslua_cols { gboolean expired; }; +struct _wslua_private_table { + GHashTable *table; + gboolean is_allocated; + gboolean expired; +}; + struct _wslua_treeitem { proto_item* item; proto_tree* tree; @@ -237,6 +243,7 @@ typedef tvbparse_elem_t* Node; typedef tvbparse_action_t* Shortcut; typedef struct _wslua_main* WireShark; typedef struct _wslua_dir* Dir; +typedef struct _wslua_private_table* PrivateTable; /* * toXxx(L,idx) gets a Xxx from an index (Lua Error if fails) @@ -397,6 +404,7 @@ extern Pinfo* push_Pinfo(lua_State* L, packet_info* p); extern void clear_outstanding_Pinfo(void); extern void clear_outstanding_Column(void); extern void clear_outstanding_Columns(void); +extern void clear_outstanding_PrivateTable(void); extern TreeItem* push_TreeItem(lua_State* L, TreeItem ti); extern void clear_outstanding_TreeItem(void); |