Add data parameter to dissector_try_heuristic

svn path=/trunk/; revision=44871
This commit is contained in:
Jakub Zawadzki 2012-09-11 08:26:48 +00:00
parent 7e9411fee3
commit dee4443809
44 changed files with 77 additions and 76 deletions

View File

@ -49,7 +49,7 @@ TSRequest
if(token_tvb != NULL)
dissector_try_heuristic(credssp_heur_subdissector_list,
token_tvb, actx->pinfo, proto_tree_get_root(tree));
token_tvb, actx->pinfo, proto_tree_get_root(tree), NULL);
#.END

View File

@ -554,7 +554,7 @@ static heur_dissector_list_t heur_subdissector_list;
static void
dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree)) {
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, NULL)) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG");
col_clear(pinfo->cinfo, COL_INFO);
if (tree)

View File

@ -100,7 +100,7 @@ ConnectMCSPDU
%(DEFAULT_BODY)s
if(next_tvb)
dissector_try_heuristic(t125_heur_subdissector_list, next_tvb,
actx->pinfo, top_tree);
actx->pinfo, top_tree, NULL);
#.END
#.FN_BODY Connect-Response/_untag/userData VAL_PTR = &next_tvb
@ -109,7 +109,7 @@ ConnectMCSPDU
%(DEFAULT_BODY)s
if(next_tvb)
dissector_try_heuristic(t125_heur_subdissector_list, next_tvb,
actx->pinfo, top_tree);
actx->pinfo, top_tree, NULL);
#.END

View File

@ -5461,7 +5461,7 @@ dissect_cip_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, packet_info
if (service_index >= 0)
{
/* See if object dissector wants to override generic service handling */
if(!dissector_try_heuristic(heur_subdissector_service, tvb, pinfo, item_tree))
if(!dissector_try_heuristic(heur_subdissector_service, tvb, pinfo, item_tree, NULL))
{
dissect_cip_generic_service_rsp(tvb, pinfo, cip_tree);
}
@ -5537,7 +5537,7 @@ dissect_cip_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, packet_info
if (service_index >= 0)
{
/* See if object dissector wants to override generic service handling */
if(!dissector_try_heuristic(heur_subdissector_service, tvb, pinfo, item_tree))
if(!dissector_try_heuristic(heur_subdissector_service, tvb, pinfo, item_tree, NULL))
{
dissect_cip_generic_service_req(tvb, pinfo, cip_tree, &path_info);
}

View File

@ -501,7 +501,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
if (dissector_try_heuristic(clnp_heur_subdissector_list, next_tvb,
pinfo, tree)) {
pinfo, tree, NULL)) {
pinfo->fragmented = save_fragmented;
return; /* yes, it appears to be one of the protocols in the heuristic list */
}

View File

@ -120,7 +120,7 @@ dissect_credssp_T_negoToken(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
if(token_tvb != NULL)
dissector_try_heuristic(credssp_heur_subdissector_list,
token_tvb, actx->pinfo, proto_tree_get_root(tree));
token_tvb, actx->pinfo, proto_tree_get_root(tree), NULL);

View File

@ -212,7 +212,7 @@ decode_dccp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo,
tree)) {
tree, NULL)) {
return;
}
}
@ -256,7 +256,7 @@ decode_dccp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (!try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
if (dissector_try_heuristic(heur_subdissector_list, next_tvb,
pinfo, tree)) {
pinfo, tree, NULL)) {
return;
}
}

View File

@ -958,7 +958,7 @@ dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo,
}
else {
/* try heuristic subdissectors */
dissected = dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, top_tree);
dissected = dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, top_tree, NULL);
}
if (dissected)
break;

View File

@ -693,7 +693,7 @@ dissect_epl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
* give that protocol a chance to make a heuristic dissection, before we continue
* to dissect it as a normal EPL packet.
*/
if (dissector_try_heuristic(heur_epl_subdissector_list, tvb, pinfo, tree))
if (dissector_try_heuristic(heur_epl_subdissector_list, tvb, pinfo, tree, NULL))
return TRUE;
/* Get message type */

View File

@ -246,7 +246,7 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
* a first look before we assume that it's actually an
* Ethernet packet.
*/
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, parent_tree))
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, parent_tree, NULL))
return;
if (ehdr->type <= IEEE_802_3_MAX_LEN) {
@ -589,7 +589,7 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree,
we actually have a trailer. */
if (tvb_reported_length(real_trailer_tvb) != 0) {
if (dissector_try_heuristic(eth_trailer_subdissector_list,
real_trailer_tvb, pinfo, tree) ) {
real_trailer_tvb, pinfo, tree, NULL) ) {
/* If we're not sure that there is a FCS, all trailer data
has been given to the ethernet-trailer dissector, so
stop dissecting here */

View File

@ -1305,7 +1305,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
* dissect the payload - try the heuristic subdissectors.
*/
dissected = dissector_try_heuristic(heur_subdissector_list,
next_tvb, pinfo, tree);
next_tvb, pinfo, tree, NULL);
}
if (dissected) {

View File

@ -1090,7 +1090,7 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
/* Beacon and Data packets contain a payload. */
if ((fcs_ok || !ieee802154_fcs_ok) && (tvb_reported_length(payload_tvb)>0)) {
/* Attempt heuristic subdissection. */
if (!dissector_try_heuristic(ieee802154_heur_subdissector_list, payload_tvb, pinfo, tree)) {
if (!dissector_try_heuristic(ieee802154_heur_subdissector_list, payload_tvb, pinfo, tree, NULL)) {
/* Could not subdissect, call the data dissector instead. */
call_dissector(data_handle, payload_tvb, pinfo, tree);
}

View File

@ -2598,7 +2598,7 @@ static void parse_PAYLOAD(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *
/* Try any heuristic dissectors that requested a chance to try and dissect IB payloads */
if (!dissector_found) {
dissector_found = dissector_try_heuristic(heur_dissectors_payload, next_tvb, pinfo, parentTree);
dissector_found = dissector_try_heuristic(heur_dissectors_payload, next_tvb, pinfo, parentTree, NULL);
}
if (!dissector_found) {
@ -3114,7 +3114,7 @@ static void parse_COM_MGT(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *
/* give a chance for subdissectors to analyze the private data */
next_tvb = tvb_new_subset(tvb, local_offset, 92, -1);
if (! dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, parentTree) )
if (! dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, parentTree, NULL) )
/* if none reported success, add this as raw "data" */
proto_tree_add_item(CM_header_tree, hf_cm_req_private_data, tvb, local_offset, 92, ENC_NA);
@ -3203,7 +3203,7 @@ static void parse_COM_MGT(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *
/* give a chance for subdissectors to get the private data */
next_tvb = tvb_new_subset(tvb, local_offset, 196, -1);
if (! dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, parentTree) )
if (! dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, parentTree, NULL) )
/* if none reported success, add this as raw "data" */
proto_tree_add_item(CM_header_tree, hf_cm_rep_privatedata, tvb, local_offset, 196, ENC_NA);

View File

@ -49,7 +49,7 @@ dissect_media(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree)
proto_item *ti;
proto_tree *media_tree = 0;
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree)) {
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, NULL)) {
return;
}

View File

@ -73,7 +73,7 @@ dissect_mime_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
comp_tvb = tvb_new_child_real_data(tvb, whole_file->str, (guint) whole_file->len, (gint) whole_file->len);
add_new_data_source(pinfo, comp_tvb, "Whole file");
if (!dissector_try_heuristic(heur_subdissector_list, comp_tvb, pinfo, tree)) {
if (!dissector_try_heuristic(heur_subdissector_list, comp_tvb, pinfo, tree, NULL)) {
proto_item_append_text(item, " (Unhandled)");
call_dissector(data_handle, comp_tvb, pinfo, tree);
}

View File

@ -995,7 +995,7 @@ static heur_dissector_list_t heur_subdissector_list;
static void
dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree)) {
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, NULL)) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG");
col_clear(pinfo->cinfo, COL_INFO);
if (tree)

View File

@ -2273,7 +2273,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pd_save = pinfo->private_data;
pinfo->private_data = &mqinfo;
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (!dissector_try_heuristic(mq_heur_subdissector_list, next_tvb, pinfo, tree))
if (!dissector_try_heuristic(mq_heur_subdissector_list, next_tvb, pinfo, tree, NULL))
call_dissector(data_handle, next_tvb, pinfo, tree);
pinfo->private_data = pd_save;
}

View File

@ -1080,7 +1080,7 @@ dissect_netbios_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* accept the packet, dissect it as data.
*/
if (!dissector_try_heuristic(netbios_heur_subdissector_list,
tvb, pinfo, tree))
tvb, pinfo, tree, NULL))
call_dissector(data_handle,tvb, pinfo, tree);
}

View File

@ -972,7 +972,7 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
if (uses_inactive_subset) {
if (dissector_try_heuristic(cotp_is_heur_subdissector_list, next_tvb,
pinfo, tree)) {
pinfo, tree, NULL)) {
*subdissector_found = TRUE;
} else {
/* Fill in other Dissectors using inactive subset here */
@ -988,7 +988,7 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
if ( (!cotp_reassemble) ||
((cotp_reassemble) && (!fragment))) {
if (dissector_try_heuristic(cotp_heur_subdissector_list, next_tvb,
pinfo, tree)) {
pinfo, tree, NULL)) {
*subdissector_found = TRUE;
} else {
call_dissector(data_handle,next_tvb, pinfo, tree);
@ -1243,7 +1243,7 @@ static int ositp_decode_CC(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (!uses_inactive_subset){
if (dissector_try_heuristic(cotp_heur_subdissector_list, next_tvb,
pinfo, tree)) {
pinfo, tree, NULL)) {
*subdissector_found = TRUE;
} else {
call_dissector(data_handle,next_tvb, pinfo, tree);
@ -1592,7 +1592,7 @@ static int ositp_decode_UD(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (dissector_try_heuristic(cltp_heur_subdissector_list, next_tvb,
pinfo, tree)) {
pinfo, tree, NULL)) {
*subdissector_found = TRUE;
} else {
call_dissector(data_handle,next_tvb, pinfo, tree);

View File

@ -795,7 +795,7 @@ decode_pgm_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
return;
/* do lookup with the heuristic subdissector table */
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree))
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL))
return;
/* Oh, well, we don't know this; dissect it as data. */

View File

@ -2504,7 +2504,7 @@ dissect_q931_user_user_ie(tvbuff_t *tvb, packet_info *pinfo, int offset, int len
case Q931_PROTOCOL_DISCRIMINATOR_USER:
next_tvb = tvb_new_subset(tvb, offset, len, len);
proto_tree_add_text(tree, tvb, offset, len, "User information: %d octets", len);
if (!dissector_try_heuristic(q931_user_heur_subdissector_list, next_tvb, pinfo, tree)) {
if (!dissector_try_heuristic(q931_user_heur_subdissector_list, next_tvb, pinfo, tree, NULL)) {
call_dissector_only(data_handle, next_tvb, pinfo, tree);
}
break;

View File

@ -2335,7 +2335,7 @@ dissect_sccp_data_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* try heuristic subdissector list to see if there are any takers */
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree)) {
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, NULL)) {
return;
}

View File

@ -2018,7 +2018,7 @@ dissect_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, gui
if (enable_ulp_dissection) {
if (try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
if (dissector_try_heuristic(sctp_heur_subdissector_list, payload_tvb, pinfo, tree))
if (dissector_try_heuristic(sctp_heur_subdissector_list, payload_tvb, pinfo, tree, NULL))
return TRUE;
}
@ -2057,7 +2057,7 @@ dissect_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, gui
if (!try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
if (dissector_try_heuristic(sctp_heur_subdissector_list, payload_tvb, pinfo, tree))
if (dissector_try_heuristic(sctp_heur_subdissector_list, payload_tvb, pinfo, tree, NULL))
return TRUE;
}
}

View File

@ -1191,7 +1191,7 @@ dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* give that protocol a chance to make a heuristic dissection, before we continue
* to dissect it as a normal SercosIII packet.
*/
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree))
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, NULL))
return;
/* check what we got on our hand */

View File

@ -3099,7 +3099,7 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
if ( found_match != TRUE )
{
if (!(dissector_try_heuristic(heur_subdissector_list,
next_tvb, pinfo, message_body_tree))) {
next_tvb, pinfo, message_body_tree, NULL))) {
int tmp_offset = 0;
while (tvb_offset_exists(next_tvb, tmp_offset)) {
tvb_find_line_end(next_tvb, tmp_offset, -1, &next_offset, FALSE);

View File

@ -3308,7 +3308,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
and bail out
*/
if(!pinfo->can_desegment){
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree);
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree, NULL);
goto clean_up_and_exit;
}
@ -3361,7 +3361,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
* Try the heuristic dissectors and see if we
* find someone that recognizes this payload.
*/
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree);
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree, NULL);
/* no this didnt look like something we know */
if(!result){
@ -3414,7 +3414,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
tree, pinfo, d_tvb, &frag_tree_item);
/* dissect the full PDU */
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree);
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree, NULL);
}
goto clean_up_and_exit;
}
@ -3434,12 +3434,12 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
/* we didnt find it, try any of the heuristic dissectors
and bail out
*/
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree);
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree, NULL);
goto clean_up_and_exit;
}
if(!(fd_head->flags&FD_DEFRAGMENTED)){
/* we dont have a fully reassembled frame */
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree);
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree, NULL);
goto clean_up_and_exit;
}
@ -3464,7 +3464,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
tree, pinfo, d_tvb, &frag_tree_item);
/* dissect the full PDU */
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree);
result = dissector_try_heuristic(smb_transact_heur_subdissector_list, d_tvb, pinfo, parent_tree, NULL);

View File

@ -3829,7 +3829,7 @@ dissect_file_data_dcerpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_
dcerpc_tvb = tvb_new_subset(tvb, offset, MIN((int)datalen, tvb_length_remaining(tvb, offset)), datalen);
/* dissect the full PDU */
dissector_try_heuristic(smb2_heur_subdissector_list, dcerpc_tvb, pinfo, top_tree);
dissector_try_heuristic(smb2_heur_subdissector_list, dcerpc_tvb, pinfo, top_tree, NULL);
offset += datalen;

View File

@ -1312,7 +1312,7 @@ process_ssl_payload(tvbuff_t *tvb, volatile int offset, packet_info *pinfo,
ssl_debug_printf("dissect_ssl3_record found association %p\n", (void *)association);
if (dissector_try_heuristic(ssl_heur_subdissector_list, next_tvb,
pinfo, proto_tree_get_root(tree))) {
pinfo, proto_tree_get_root(tree), NULL)) {
} else {
call_dissector(association->handle, next_tvb, pinfo, proto_tree_get_root(tree));
}

View File

@ -369,7 +369,7 @@ dissect_stun_message_channel_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree
next_tvb = tvb_new_subset_remaining(tvb, CHANNEL_DATA_HDR_LEN);
if (!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)) {
if (!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL)) {
call_dissector_only(data_handle, next_tvb, pinfo, tree);
}
@ -930,7 +930,7 @@ case EVEN_PORT:
next_tvb = tvb_new_subset(tvb, offset, att_length, att_length);
if (!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, att_tree)) {
if (!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, att_tree, NULL)) {
call_dissector_only(data_handle, next_tvb, pinfo, att_tree);
}

View File

@ -2224,7 +2224,7 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t
!dissector_try_uint(sccp_ssn_dissector_table, source_ssn, data_tvb, pinfo, tree)))
{
/* try heuristic subdissector list to see if there are any takers */
if (dissector_try_heuristic(heur_subdissector_list, data_tvb, pinfo, tree)) {
if (dissector_try_heuristic(heur_subdissector_list, data_tvb, pinfo, tree, NULL)) {
return;
}
/* No sub-dissection occured, treat it as raw data */

View File

@ -188,7 +188,7 @@ dissect_t125_T_userData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
if(next_tvb)
dissector_try_heuristic(t125_heur_subdissector_list, next_tvb,
actx->pinfo, top_tree);
actx->pinfo, top_tree, NULL);
return offset;
@ -265,7 +265,7 @@ dissect_t125_T_userData_01(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
if(next_tvb)
dissector_try_heuristic(t125_heur_subdissector_list, next_tvb,
actx->pinfo, top_tree);
actx->pinfo, top_tree, NULL);
return offset;

View File

@ -3844,7 +3844,7 @@ decode_tcp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* do lookup with the heuristic subdissector table */
save_desegment_offset = pinfo->desegment_offset;
save_desegment_len = pinfo->desegment_len;
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)){
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL)){
pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return TRUE;
}
@ -3911,7 +3911,7 @@ decode_tcp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* do lookup with the heuristic subdissector table */
save_desegment_offset = pinfo->desegment_offset;
save_desegment_len = pinfo->desegment_len;
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)){
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL)){
pinfo->want_pdu_tracking -= !!(pinfo->want_pdu_tracking);
return TRUE;
}

View File

@ -1558,7 +1558,7 @@ call_tipc_v2_data_subdissectors(tvbuff_t *data_tvb, packet_info *pinfo, guint32
/* check for heuristic dissectors if specified in the
* preferences to try them first */
if (try_heuristic_first) {
if (dissector_try_heuristic(tipc_heur_subdissector_list, data_tvb, pinfo, top_tree))
if (dissector_try_heuristic(tipc_heur_subdissector_list, data_tvb, pinfo, top_tree, NULL))
return;
}
/* This triggers if a dissectors if
@ -1602,7 +1602,7 @@ call_tipc_v2_data_subdissectors(tvbuff_t *data_tvb, packet_info *pinfo, guint32
/* check for heuristic dissectors if specified in the
* preferences not to try them first */
if (!try_heuristic_first) {
if (dissector_try_heuristic(tipc_heur_subdissector_list, data_tvb, pinfo, top_tree))
if (dissector_try_heuristic(tipc_heur_subdissector_list, data_tvb, pinfo, top_tree, NULL))
return;
}
}

View File

@ -114,7 +114,7 @@ dissect_turnchannel_message(tvbuff_t *tvb, packet_info *pinfo,
if (!dissector_try_heuristic(heur_subdissector_list,
next_tvb, pinfo, tree)) {
next_tvb, pinfo, tree, NULL)) {
call_dissector(data_handle,next_tvb, pinfo, tree);
}
}

View File

@ -242,7 +242,7 @@ decode_udp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree))
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL))
return;
}
@ -278,7 +278,7 @@ decode_udp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (!try_heuristic_first) {
/* do lookup with the heuristic subdissector table */
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree))
if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL))
return;
}

View File

@ -2114,7 +2114,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
pinfo->usb_conv_info = usb_conv_info;
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (try_heuristics && dissector_try_heuristic(heur_bulk_subdissector_list, next_tvb, pinfo, parent)) {
if (try_heuristics && dissector_try_heuristic(heur_bulk_subdissector_list, next_tvb, pinfo, parent, NULL)) {
return;
}
else if(dissector_try_uint(usb_bulk_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)){
@ -2145,7 +2145,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
pinfo->usb_conv_info = usb_conv_info;
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (try_heuristics && dissector_try_heuristic(heur_interrupt_subdissector_list, next_tvb, pinfo, parent)) {
if (try_heuristics && dissector_try_heuristic(heur_interrupt_subdissector_list, next_tvb, pinfo, parent, NULL)) {
return;
}
else if(dissector_try_uint(usb_interrupt_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)){
@ -2253,7 +2253,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
/* Try to find a class specific dissector */
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, setup_tree)) {
if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, setup_tree, NULL)) {
return;
}
if(dissector_try_uint(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, setup_tree)){
@ -2296,7 +2296,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
tvbuff_t *next_tvb;
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, parent)) {
if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, parent, NULL)) {
return;
}
if(dissector_try_uint(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)){
@ -2352,7 +2352,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
if(usb_trans_info){
/* Try to find a class specific dissector */
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, parent)) {
if (try_heuristics && dissector_try_heuristic(heur_control_subdissector_list, next_tvb, pinfo, parent, NULL)) {
return;
}
if(dissector_try_uint(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)){

View File

@ -790,7 +790,7 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (viph.vipc_pkttype != PKTTYPE_DATA ||
!dissector_try_heuristic(vines_ipc_heur_subdissector_list,
next_tvb, pinfo, tree))
next_tvb, pinfo, tree, NULL))
call_dissector(data_handle, next_tvb, pinfo, tree);
}
@ -917,7 +917,7 @@ dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (viph.vspp_pkttype != PKTTYPE_DATA ||
!dissector_try_heuristic(vines_spp_heur_subdissector_list,
next_tvb, pinfo, tree))
next_tvb, pinfo, tree, NULL))
call_dissector(data_handle, next_tvb, pinfo, tree);
}

View File

@ -5176,7 +5176,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (! found_match) {
if (! dissector_try_heuristic(heur_subdissector_list,
tmp_tvb, pinfo, tree)) {
tmp_tvb, pinfo, tree, NULL)) {
guint8* save_private_data = pinfo->private_data;
pinfo->match_string = contentTypeStr;
@ -5271,7 +5271,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (! found_match) {
if (! dissector_try_heuristic(heur_subdissector_list,
tmp_tvb, pinfo, tree)) {
tmp_tvb, pinfo, tree, NULL)) {
guint8* save_private_data = pinfo->private_data;
pinfo->match_string = contentTypeStr;
@ -5355,7 +5355,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (! found_match) {
if (! dissector_try_heuristic(heur_subdissector_list,
tmp_tvb, pinfo, tree)) {
tmp_tvb, pinfo, tree, NULL)) {
guint8* save_private_data = pinfo->private_data;
pinfo->match_string = contentTypeStr;
@ -5956,7 +5956,7 @@ add_multipart_data (proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo)
}
if (! found_match) {
if (! dissector_try_heuristic(heur_subdissector_list,
tmp_tvb, pinfo, mpart_tree)) {
tmp_tvb, pinfo, mpart_tree, NULL)) {
guint8* save_private_data = pinfo->private_data;
pinfo->match_string = contentTypeStr;

View File

@ -2537,7 +2537,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Try the heuristic dissectors. */
if (dissector_try_heuristic(x25_heur_subdissector_list, next_tvb, pinfo,
tree)) {
tree, NULL)) {
pinfo->private_data = saved_private_data;
return;
}

View File

@ -1705,8 +1705,8 @@ heur_dissector_set_enabled(const char *name, heur_dissector_t dissector, const i
}
gboolean
dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissector_try_heuristic(heur_dissector_list_t sub_dissectors, tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, void *data)
{
gboolean status;
const char *saved_proto;
@ -1764,7 +1764,7 @@ dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
}
EP_CHECK_CANARY(("before calling heuristic dissector for protocol: %s",
proto_get_protocol_filter_name(proto_get_id(hdtbl_entry->protocol))));
if ((*hdtbl_entry->dissector)(tvb, pinfo, tree, NULL)) {
if ((*hdtbl_entry->dissector)(tvb, pinfo, tree, data)) {
EP_CHECK_CANARY(("after heuristic dissector for protocol: %s has accepted and dissected packet",
proto_get_protocol_filter_name(proto_get_id(hdtbl_entry->protocol))));
status = TRUE;

View File

@ -296,10 +296,11 @@ extern void dissector_all_heur_tables_foreach_table (DATFunc_heur_table func,
* @param tvb the tv_buff with the (remaining) packet data
* @param pinfo the packet info of this packet (additional info)
* @param tree the protocol tree to be build or NULL
* @param data parameter to pass to subdissector
* @return TRUE if the packet was recognized by the sub-dissector (stop dissection here)
*/
extern gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors,
tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data);
/** Add a sub-dissector to a heuristic dissector list.
* Call this in the proto_handoff function of the sub-dissector.

View File

@ -733,7 +733,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
init_dc_measure(pDC, tvb, suboffset);
/* Allow sub dissectors to have a chance with this data */
if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree))
if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree, NULL))
{
/* No sub dissector did recognize this data, dissect it as data only */
aitem = proto_tree_add_item(ecat_datagram_tree, hf_ecat_data, tvb, suboffset, ecHdr.len & 0x07ff, ENC_NA);
@ -816,7 +816,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if ( dataLength > 0 )
{
/* Allow sub dissectors to have a chance with this data */
if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree))
if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree, NULL))
{
/* No sub dissector did recognize this data, dissect it as data only */
proto_tree_add_item(ecat_datagram_tree, hf_ecat_data, tvb, startOfData, dataLength, ENC_NA);
@ -834,7 +834,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if( tree )
{
/* Allow sub dissectors to have a chance with this data */
if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree))
if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree, NULL))
{
/* No sub dissector did recognize this data, dissect it as data only */
proto_tree_add_item(ecat_datagram_tree, hf_ecat_data, tvb, suboffset, ecHdr.len & 0x07ff, ENC_NA);

View File

@ -8867,7 +8867,7 @@ dissect_PNIO_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* give that protocol a chance to make a heuristic dissection, before we continue
* to dissect it as a normal PNIO packet.
*/
if (dissector_try_heuristic(heur_pn_subdissector_list, tvb, pinfo, tree))
if (dissector_try_heuristic(heur_pn_subdissector_list, tvb, pinfo, tree, NULL))
return FALSE;
/* the sub tvb will NOT contain the frame_id here! */

View File

@ -665,7 +665,7 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset(tvb, 2, data_len, data_len);
/* ask heuristics, if some sub-dissector is interested in this packet payload */
if(!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree)) {
if(!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, NULL)) {
/*col_set_str(pinfo->cinfo, COL_INFO, "Unknown");*/
/* Oh, well, we don't know this; dissect it as data. */