Pass fc_hdr "private data" into subdissectors instead of using pinfo->private_data.
svn path=/trunk/; revision=52729
This commit is contained in:
parent
77837d2c9e
commit
be62b39687
|
@ -1209,14 +1209,10 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
|
|||
if( (fchdr.fctl&FC_FCTL_REL_OFFSET) && param ){
|
||||
call_dissector (data_handle, next_tvb, pinfo, tree);
|
||||
} else {
|
||||
void *saved_private_data;
|
||||
saved_private_data = pinfo->private_data;
|
||||
pinfo->private_data = &fchdr;
|
||||
if (!dissector_try_uint (fcftype_dissector_table, ftype,
|
||||
next_tvb, pinfo, tree)) {
|
||||
if (!dissector_try_uint_new (fcftype_dissector_table, ftype,
|
||||
next_tvb, pinfo, tree, FALSE, &fchdr)) {
|
||||
call_dissector (data_handle, next_tvb, pinfo, tree);
|
||||
}
|
||||
pinfo->private_data = saved_private_data;
|
||||
}
|
||||
} else if (ftype == FC_FTYPE_BLS) {
|
||||
if ((fchdr.r_ctl & 0x0F) == FC_BLS_BAACC) {
|
||||
|
@ -1539,7 +1535,7 @@ proto_register_fc(void)
|
|||
expert_register_field_array(expert_fc, ei, array_length(ei));
|
||||
|
||||
/* subdissectors called through this table will find the fchdr structure
|
||||
* through pinfo->private_data
|
||||
* through data parameter of dissector
|
||||
*/
|
||||
fcftype_dissector_table = register_dissector_table ("fc.ftype",
|
||||
"FC Frame Type",
|
||||
|
|
|
@ -663,8 +663,8 @@ dissect_fcp_els(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
static int
|
||||
dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
||||
{
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *fcp_tree = NULL;
|
||||
|
@ -676,7 +676,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
gboolean els;
|
||||
fcp_proto_data_t *proto_data;
|
||||
|
||||
fchdr = (fc_hdr *)pinfo->private_data;
|
||||
fchdr = (fc_hdr *)data;
|
||||
|
||||
/* Make entries in Protocol column and Info column on summary display */
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCP");
|
||||
|
@ -752,7 +752,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
if (els) {
|
||||
dissect_fcp_els(tvb, pinfo, fcp_tree);
|
||||
return;
|
||||
return tvb_length(tvb);
|
||||
}
|
||||
|
||||
switch (r_ctl) {
|
||||
|
@ -776,7 +776,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
break;
|
||||
}
|
||||
/*xxx once the subdissectors return bytes consumed: proto_item_set_end(ti, tvb, offset);*/
|
||||
|
||||
return tvb_length(tvb);
|
||||
}
|
||||
|
||||
/* Register the protocol with Wireshark */
|
||||
|
@ -1030,7 +1030,7 @@ proto_reg_handoff_fcp(void)
|
|||
{
|
||||
dissector_handle_t fcp_handle;
|
||||
|
||||
fcp_handle = create_dissector_handle(dissect_fcp, proto_fcp);
|
||||
fcp_handle = new_create_dissector_handle(dissect_fcp, proto_fcp);
|
||||
dissector_add_uint("fc.ftype", FC_FTYPE_SCSI, fcp_handle);
|
||||
|
||||
data_handle = find_dissector("data");
|
||||
|
|
Loading…
Reference in New Issue