aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ositp.c
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 /epan/dissectors/packet-ositp.c
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 'epan/dissectors/packet-ositp.c')
-rw-r--r--epan/dissectors/packet-ositp.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c
index c8ab64d58b..b286bf26e6 100644
--- a/epan/dissectors/packet-ositp.c
+++ b/epan/dissectors/packet-ositp.c
@@ -937,19 +937,20 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
gboolean uses_inactive_subset,
gboolean *subdissector_found)
{
- proto_tree *cotp_tree = NULL;
- proto_item *ti;
- gboolean is_extended;
- gboolean is_class_234;
- guint32 dst_ref;
- guint32 *prev_dst_ref;
- guint tpdu_nr;
- gboolean fragment = FALSE;
- guint32 fragment_length = 0;
- tvbuff_t *next_tvb;
- fragment_head *fd_head;
- conversation_t *conv;
- guint tpdu_len;
+ proto_tree *cotp_tree = NULL;
+ proto_item *ti;
+ gboolean is_extended;
+ gboolean is_class_234;
+ guint32 dst_ref;
+ guint32 *prev_dst_ref;
+ guint tpdu_nr;
+ gboolean fragment = FALSE;
+ guint32 fragment_length = 0;
+ tvbuff_t *next_tvb;
+ fragment_head *fd_head;
+ conversation_t *conv;
+ guint tpdu_len;
+ heur_dtbl_entry_t *hdtbl_entry;
/* DT TPDUs have user data, so they run to the end of the containing PDU */
tpdu_len = tvb_reported_length_remaining(tvb, offset);
@@ -1229,7 +1230,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, NULL)) {
+ pinfo, tree, &hdtbl_entry, NULL)) {
*subdissector_found = TRUE;
} else {
/* Fill in other Dissectors using inactive subset here */
@@ -1244,7 +1245,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, NULL)) {
+ tree, &hdtbl_entry, NULL)) {
*subdissector_found = TRUE;
} else {
call_dissector(data_handle,next_tvb, pinfo, tree);
@@ -1560,6 +1561,7 @@ static int ositp_decode_CC(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
guint8 class_option;
tvbuff_t *next_tvb;
guint tpdu_len;
+ heur_dtbl_entry_t *hdtbl_entry;
src_ref = tvb_get_ntohs(tvb, offset + P_SRC_REF);
@@ -1655,7 +1657,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, NULL)) {
+ tree, &hdtbl_entry, NULL)) {
*subdissector_found = TRUE;
} else {
call_dissector(data_handle,next_tvb, pinfo, tree);
@@ -2109,6 +2111,7 @@ static int ositp_decode_UD(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
proto_tree *cltp_tree = NULL;
tvbuff_t *next_tvb;
guint tpdu_len;
+ heur_dtbl_entry_t *hdtbl_entry;
/* UD TPDUs have user data, so they run to the end of the containing PDU */
tpdu_len = tvb_reported_length_remaining(tvb, offset);
@@ -2135,7 +2138,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, NULL)) {
+ pinfo, tree, &hdtbl_entry, NULL)) {
*subdissector_found = TRUE;
} else {
call_dissector(data_handle,next_tvb, pinfo, tree);