aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2014-05-20 12:54:20 +0200
committerAnders Broman <a.broman58@gmail.com>2014-05-21 20:17:29 +0000
commit2cfda31ff09893bd8c59acabc8faad7227f52ede (patch)
treea0bee1c33fe7bc2eeced9c2f7fe0bbe7628cebcd /plugins
parentbb01c7ac380a2978d8e1c5ca8fa7f2dd523a8323 (diff)
Change the signature of dissector_try_heuristic() to return hdtbl_entry
which can be used to call the found heuristic dissector on the next pass. Introduce call_heur_dissector_direct() to be used to call a heuristic dissector which accepted the frame on the first pass. Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582 Reviewed-on: https://code.wireshark.org/review/1697 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ethercat/packet-ethercat-datagram.c7
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c3
-rw-r--r--plugins/profinet/packet-pn-rt.c3
3 files changed, 8 insertions, 5 deletions
diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c
index 62f8ec9ed3..2c55934a24 100644
--- a/plugins/ethercat/packet-ethercat-datagram.c
+++ b/plugins/ethercat/packet-ethercat-datagram.c
@@ -452,6 +452,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
const guint datagram_length = tvb_length_remaining(tvb, offset);
guint datagram_padding_bytes = 0;
EcParserHDR ecHdr;
+ heur_dtbl_entry_t *hdtbl_entry;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ECAT");
@@ -732,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, NULL))
+ if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree, &hdtbl_entry, 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);
@@ -815,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, NULL))
+ if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree, &hdtbl_entry, 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);
@@ -833,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, NULL))
+ if(!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, ecat_datagram_tree, &hdtbl_entry, 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);
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index de611d4c3c..945a4ca0ca 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -9415,13 +9415,14 @@ dissect_PNIO_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 *drep = &drep_data;
guint8 u8CBAVersion;
guint16 u16FrameID;
+ heur_dtbl_entry_t *hdtbl_entry;
/*
* In case the packet is a protocol encoded in the basic PNIO transport stream,
* 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, NULL))
+ if (dissector_try_heuristic(heur_pn_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL))
return TRUE;
/* the sub tvb will NOT contain the frame_id here! */
diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c
index 996bc73062..a93a4ce2ea 100644
--- a/plugins/profinet/packet-pn-rt.c
+++ b/plugins/profinet/packet-pn-rt.c
@@ -495,6 +495,7 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gchar szFieldSummary[100];
tvbuff_t *next_tvb;
gboolean bCyclic;
+ heur_dtbl_entry_t *hdtbl_entry;
/* If the link-layer dissector for the protocol above us knows whether
@@ -806,7 +807,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, NULL)) {
+ if (!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) {
/*col_set_str(pinfo->cinfo, COL_INFO, "Unknown");*/
/* Oh, well, we don't know this; dissect it as data. */