Remove private_data member from packet_info structure.

Dissectors should pass data directly to their subdissectors through the data parameter (of new-style dissectors). This avoids unintentional "trampling" from other dissectors trying to "share" private_data member.

Change-Id: I2efef5c8dfeef64588ba3ac6e695b469238c6468
Reviewed-on: https://code.wireshark.org/review/5487
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2014-11-24 10:10:12 -05:00
parent e77507b0ea
commit 6d207fe5f4
5 changed files with 0 additions and 10 deletions

View File

@ -4685,8 +4685,6 @@ is_dcerpc(tvbuff_t *tvb, int offset, packet_info *pinfo _U_)
/*
* DCERPC dissector for connection oriented calls.
* We use transport type to later multiplex between what kind of
* pinfo->private_data structure to expect.
*/
static gboolean
dissect_dcerpc_cn(tvbuff_t *tvb, int offset, packet_info *pinfo,

View File

@ -148,7 +148,6 @@ typedef struct _packet_info {
tvbuff_t *gssapi_decrypted_tvb;
gboolean gssapi_data_encrypted;
void *private_data; /**< pointer to data passed from one dissector to another */
GHashTable *private_table; /**< a hash table passed from one dissector to another */
wmem_list_t *layers; /**< layers of each protocol */

View File

@ -968,9 +968,6 @@ PINFO_NUMBER_SETTER(desegment_len,guint32);
PINFO_NUMBER_GETTER(desegment_offset);
PINFO_NUMBER_SETTER(desegment_offset,int);
/* WSLUA_ATTRIBUTE Pinfo_private_data RO Access to private data. */
WSLUA_ATTRIBUTE_GET(Pinfo,private_data, {lua_pushlightuserdata(L,(void *)(obj->ws_pinfo->private_data));});
/* WSLUA_ATTRIBUTE Pinfo_fragmented RO If the protocol is only a fragment. */
PINFO_NAMED_BOOLEAN_GETTER(fragmented,fragmented);
@ -1178,7 +1175,6 @@ WSLUA_ATTRIBUTES Pinfo_attributes[] = {
WSLUA_ATTRIBUTE_RWREG(Pinfo,can_desegment),
WSLUA_ATTRIBUTE_RWREG(Pinfo,desegment_len),
WSLUA_ATTRIBUTE_RWREG(Pinfo,desegment_offset),
WSLUA_ATTRIBUTE_ROREG(Pinfo,private_data),
WSLUA_ATTRIBUTE_ROREG(Pinfo,private),
WSLUA_ATTRIBUTE_ROREG(Pinfo,fragmented),
WSLUA_ATTRIBUTE_ROREG(Pinfo,in_error_pkt),

View File

@ -542,7 +542,6 @@ cba_ldev_add(packet_info *pinfo, cba_pdev_t *pdev, const char *name)
cba_ldev_t *
cba_ldev_find(packet_info *pinfo, const void *ip, e_uuid_t *ipid) {
/*dcerpc_info *info = (dcerpc_info *)pinfo->private_data;*/
dcom_interface_t *interf;
cba_ldev_t *ldev;

View File

@ -123,7 +123,6 @@ silently accept being set (though nothing happens) Blech!!
test("Pinfo.curr_proto-set-1",not pcall(setPinfo,pinfo,"curr_proto",0))
test("Pinfo.columns-set-1",not pcall(setPinfo,pinfo,"columns",0))
test("Pinfo.cols-set-1",not pcall(setPinfo,pinfo,"cols",0))
test("Pinfo.private_data-set-1",not pcall(setPinfo,pinfo,"private_data",0))
test("Pinfo.private-set-1",not pcall(setPinfo,pinfo,"private",0))
test("Pinfo.fragmented-set-1",not pcall(setPinfo,pinfo,"fragmented",0))
test("Pinfo.in_error_pkt-set-1",not pcall(setPinfo,pinfo,"in_error_pkt",0))
@ -188,7 +187,6 @@ again, these *should* pass, but Pinfo silently allows it!
test("Pinfo.columns-get-2",typeof(pinfo.columns) == "Columns")
test("Pinfo.cols-get-1",tostring(pinfo.cols) == "Columns")
test("Pinfo.cols-get-2",typeof(pinfo.cols) == "Columns")
test("Pinfo.private_data-get-1",type(pinfo.private_data) == "userdata")
test("Pinfo.private-get-1",type(pinfo.private) == "userdata")
test("Pinfo.fragmented-get-1",pinfo.fragmented == false)