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>
/*
* 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,
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 */
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);
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),
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;
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))
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)