aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-07-12 20:40:31 -0400
committerMichael Mann <mmann78@netscape.net>2015-07-17 17:12:22 +0000
commit21e5a950ade6a20260b63b5f5c055c52ac07b599 (patch)
tree417e76e5a3082c2431ce0f5c6d88cbf7701e0489
parent5bd6c4aff21dbc8a7ebf31c5d1510fcedf66d875 (diff)
Remove all preferences related to enabling/disabling heuristic dissectors.
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector. Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled. Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22 Reviewed-on: https://code.wireshark.org/review/9610 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--asn1/atn-cm/packet-atn-cm-template.c2
-rw-r--r--asn1/atn-cpdlc/packet-atn-cpdlc-template.c2
-rw-r--r--asn1/atn-ulcs/packet-atn-ulcs-template.c2
-rw-r--r--asn1/credssp/packet-credssp-template.c2
-rw-r--r--asn1/mms/packet-mms-template.c4
-rw-r--r--asn1/mpeg-audio/packet-mpeg-audio-template.c2
-rw-r--r--asn1/mpeg-pes/packet-mpeg-pes-template.c2
-rw-r--r--asn1/ranap/packet-ranap-template.c9
-rw-r--r--asn1/rnsap/packet-rnsap-template.c7
-rw-r--r--asn1/t124/packet-t124-template.c2
-rw-r--r--asn1/t125/packet-t125-template.c4
-rw-r--r--epan/disabled_protos.c3
-rw-r--r--epan/dissectors/file-btsnoop.c2
-rw-r--r--epan/dissectors/file-elf.c2
-rw-r--r--epan/dissectors/file-gif.c4
-rw-r--r--epan/dissectors/file-jpeg.c4
-rw-r--r--epan/dissectors/file-png.c4
-rw-r--r--epan/dissectors/packet-3com-njack.c4
-rw-r--r--epan/dissectors/packet-6lowpan.c2
-rw-r--r--epan/dissectors/packet-acn.c11
-rw-r--r--epan/dissectors/packet-adwin-config.c4
-rw-r--r--epan/dissectors/packet-aeron.c2
-rw-r--r--epan/dissectors/packet-applemidi.c2
-rw-r--r--epan/dissectors/packet-ar_drone.c2
-rw-r--r--epan/dissectors/packet-artnet.c2
-rw-r--r--epan/dissectors/packet-at.c4
-rw-r--r--epan/dissectors/packet-atn-cm.c2
-rw-r--r--epan/dissectors/packet-atn-cpdlc.c2
-rw-r--r--epan/dissectors/packet-atn-ulcs.c2
-rw-r--r--epan/dissectors/packet-bfcp.c17
-rw-r--r--epan/dissectors/packet-bitcoin.c2
-rw-r--r--epan/dissectors/packet-bittorrent.c2
-rw-r--r--epan/dissectors/packet-bssap.c4
-rw-r--r--epan/dissectors/packet-bt-dht.c10
-rw-r--r--epan/dissectors/packet-bt-utp.c11
-rw-r--r--epan/dissectors/packet-carp.c2
-rw-r--r--epan/dissectors/packet-cattp.c13
-rw-r--r--epan/dissectors/packet-ceph.c2
-rw-r--r--epan/dissectors/packet-cigi.c2
-rw-r--r--epan/dissectors/packet-cimd.c2
-rw-r--r--epan/dissectors/packet-cip.c2
-rw-r--r--epan/dissectors/packet-cipsafety.c2
-rw-r--r--epan/dissectors/packet-classicstun.c4
-rw-r--r--epan/dissectors/packet-clique-rm.c2
-rw-r--r--epan/dissectors/packet-credssp.c2
-rw-r--r--epan/dissectors/packet-ctdb.c2
-rw-r--r--epan/dissectors/packet-dcc.c2
-rw-r--r--epan/dissectors/packet-dcerpc.c12
-rw-r--r--epan/dissectors/packet-dcm.c19
-rw-r--r--epan/dissectors/packet-dcp-etsi.c2
-rw-r--r--epan/dissectors/packet-dnp.c50
-rw-r--r--epan/dissectors/packet-dplay.c4
-rw-r--r--epan/dissectors/packet-drda.c2
-rw-r--r--epan/dissectors/packet-dtls.c2
-rw-r--r--epan/dissectors/packet-dvb-s2-bb.c8
-rw-r--r--epan/dissectors/packet-e100.c2
-rw-r--r--epan/dissectors/packet-etch.c2
-rw-r--r--epan/dissectors/packet-fcip.c2
-rw-r--r--epan/dissectors/packet-fcoib.c2
-rw-r--r--epan/dissectors/packet-fix.c2
-rw-r--r--epan/dissectors/packet-fmtp.c2
-rw-r--r--epan/dissectors/packet-giop.c4
-rw-r--r--epan/dissectors/packet-gmhdr.c4
-rw-r--r--epan/dissectors/packet-gvsp.c10
-rw-r--r--epan/dissectors/packet-h1.c6
-rw-r--r--epan/dissectors/packet-hdcp2.c10
-rw-r--r--epan/dissectors/packet-hislip.c13
-rw-r--r--epan/dissectors/packet-http.c2
-rw-r--r--epan/dissectors/packet-http2.c17
-rw-r--r--epan/dissectors/packet-icep.c4
-rw-r--r--epan/dissectors/packet-ifcp.c2
-rw-r--r--epan/dissectors/packet-infiniband_sdp.c4
-rw-r--r--epan/dissectors/packet-interlink.c2
-rw-r--r--epan/dissectors/packet-ip.c2
-rw-r--r--epan/dissectors/packet-ipsec-tcp.c2
-rw-r--r--epan/dissectors/packet-iscsi.c2
-rw-r--r--epan/dissectors/packet-iser.c4
-rw-r--r--epan/dissectors/packet-iwarp-mpa.c2
-rw-r--r--epan/dissectors/packet-ixiatrailer.c2
-rw-r--r--epan/dissectors/packet-json.c4
-rw-r--r--epan/dissectors/packet-jxta.c62
-rw-r--r--epan/dissectors/packet-knxnetip.c4
-rw-r--r--epan/dissectors/packet-lanforge.c4
-rw-r--r--epan/dissectors/packet-lapd.c2
-rw-r--r--epan/dissectors/packet-lbmpdmtcp.c2
-rw-r--r--epan/dissectors/packet-lbmr.c2
-rw-r--r--epan/dissectors/packet-lbtrm.c2
-rw-r--r--epan/dissectors/packet-lbtru.c2
-rw-r--r--epan/dissectors/packet-lbttcp.c2
-rw-r--r--epan/dissectors/packet-lwm.c2
-rw-r--r--epan/dissectors/packet-mac-lte.c20
-rw-r--r--epan/dissectors/packet-mbim.c9
-rw-r--r--epan/dissectors/packet-mim.c18
-rw-r--r--epan/dissectors/packet-miop.c2
-rw-r--r--epan/dissectors/packet-mms.c4
-rw-r--r--epan/dissectors/packet-mmse.c2
-rw-r--r--epan/dissectors/packet-mndp.c6
-rw-r--r--epan/dissectors/packet-mojito.c2
-rw-r--r--epan/dissectors/packet-mp2t.c4
-rw-r--r--epan/dissectors/packet-mpeg-audio.c2
-rw-r--r--epan/dissectors/packet-mpeg-pes.c2
-rw-r--r--epan/dissectors/packet-mq-pcf.c2
-rw-r--r--epan/dissectors/packet-mq.c6
-rw-r--r--epan/dissectors/packet-msrp.c2
-rw-r--r--epan/dissectors/packet-nbd.c2
-rw-r--r--epan/dissectors/packet-ndmp.c2
-rw-r--r--epan/dissectors/packet-ntlmssp.c2
-rw-r--r--epan/dissectors/packet-openflow.c14
-rw-r--r--epan/dissectors/packet-opensafety.c8
-rw-r--r--epan/dissectors/packet-openwire.c2
-rw-r--r--epan/dissectors/packet-osc.c2
-rw-r--r--epan/dissectors/packet-ouch.c2
-rw-r--r--epan/dissectors/packet-paltalk.c2
-rw-r--r--epan/dissectors/packet-pana.c2
-rw-r--r--epan/dissectors/packet-pathport.c2
-rw-r--r--epan/dissectors/packet-pdcp-lte.c20
-rw-r--r--epan/dissectors/packet-peekremote.c2
-rw-r--r--epan/dissectors/packet-pktgen.c2
-rw-r--r--epan/dissectors/packet-ppp.c2
-rw-r--r--epan/dissectors/packet-pvfs2.c2
-rw-r--r--epan/dissectors/packet-q931.c2
-rw-r--r--epan/dissectors/packet-ranap.c9
-rw-r--r--epan/dissectors/packet-redbackli.c2
-rw-r--r--epan/dissectors/packet-reload-framing.c6
-rw-r--r--epan/dissectors/packet-reload.c4
-rw-r--r--epan/dissectors/packet-rlc-lte.c20
-rw-r--r--epan/dissectors/packet-rlc.c20
-rw-r--r--epan/dissectors/packet-rlm.c2
-rw-r--r--epan/dissectors/packet-rmt-norm.c11
-rw-r--r--epan/dissectors/packet-rnsap.c9
-rw-r--r--epan/dissectors/packet-rpc.c4
-rw-r--r--epan/dissectors/packet-rpcap.c4
-rw-r--r--epan/dissectors/packet-rpcrdma.c4
-rw-r--r--epan/dissectors/packet-rtcp.c23
-rw-r--r--epan/dissectors/packet-rtmpt.c6
-rw-r--r--epan/dissectors/packet-rtp.c21
-rw-r--r--epan/dissectors/packet-rtps.c4
-rw-r--r--epan/dissectors/packet-s7comm.c2
-rw-r--r--epan/dissectors/packet-ses.c6
-rw-r--r--epan/dissectors/packet-sip.c8
-rw-r--r--epan/dissectors/packet-skype.c8
-rw-r--r--epan/dissectors/packet-smb-direct.c4
-rw-r--r--epan/dissectors/packet-smb.c8
-rw-r--r--epan/dissectors/packet-smb2.c4
-rw-r--r--epan/dissectors/packet-smcr.c4
-rw-r--r--epan/dissectors/packet-smpp.c4
-rw-r--r--epan/dissectors/packet-spdy.c7
-rw-r--r--epan/dissectors/packet-spice.c2
-rw-r--r--epan/dissectors/packet-sprt.c2
-rw-r--r--epan/dissectors/packet-starteam.c2
-rw-r--r--epan/dissectors/packet-stt.c2
-rw-r--r--epan/dissectors/packet-stun.c2
-rw-r--r--epan/dissectors/packet-t124.c2
-rw-r--r--epan/dissectors/packet-t125.c4
-rw-r--r--epan/dissectors/packet-tali.c2
-rw-r--r--epan/dissectors/packet-tapa.c2
-rw-r--r--epan/dissectors/packet-tds.c2
-rw-r--r--epan/dissectors/packet-teredo.c14
-rw-r--r--epan/dissectors/packet-tfp.c2
-rw-r--r--epan/dissectors/packet-tftp.c2
-rw-r--r--epan/dissectors/packet-thrift.c2
-rw-r--r--epan/dissectors/packet-tte.c2
-rw-r--r--epan/dissectors/packet-turnchannel.c2
-rw-r--r--epan/dissectors/packet-tuxedo.c2
-rw-r--r--epan/dissectors/packet-ucp.c2
-rw-r--r--epan/dissectors/packet-udt.c2
-rw-r--r--epan/dissectors/packet-umts_fp.c12
-rw-r--r--epan/dissectors/packet-usb-masstorage.c2
-rw-r--r--epan/dissectors/packet-vnc.c2
-rw-r--r--epan/dissectors/packet-vssmonitoring.c14
-rw-r--r--epan/dissectors/packet-wassp.c7
-rw-r--r--epan/dissectors/packet-waveagent.c2
-rw-r--r--epan/dissectors/packet-wol.c2
-rw-r--r--epan/dissectors/packet-xcsl.c2
-rw-r--r--epan/dissectors/packet-xmcp.c2
-rw-r--r--epan/dissectors/packet-xml.c61
-rw-r--r--epan/dissectors/packet-yhoo.c2
-rw-r--r--epan/dissectors/packet-ymsg.c2
-rw-r--r--epan/dissectors/packet-zbee-nwk-gp.c2
-rw-r--r--epan/dissectors/packet-zbee-nwk.c6
-rw-r--r--epan/dissectors/packet-ziop.c2
-rw-r--r--epan/packet.c26
-rw-r--r--epan/packet.h8
-rw-r--r--epan/prefs.c74
-rw-r--r--epan/wslua/wslua_proto.c2
-rw-r--r--plugins/ethercat/packet-esl.c8
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c2
-rw-r--r--plugins/profinet/packet-dcom-cba-acco.c2
-rw-r--r--plugins/profinet/packet-pn-dcp.c2
-rw-r--r--plugins/profinet/packet-pn-mrrt.c2
-rw-r--r--plugins/profinet/packet-pn-ptcp.c2
-rw-r--r--plugins/profinet/packet-pn-rt.c4
192 files changed, 441 insertions, 688 deletions
diff --git a/asn1/atn-cm/packet-atn-cm-template.c b/asn1/atn-cm/packet-atn-cm-template.c
index eec0d0ec97..46373fd277 100644
--- a/asn1/atn-cm/packet-atn-cm-template.c
+++ b/asn1/atn-cm/packet-atn-cm-template.c
@@ -233,7 +233,7 @@ void proto_reg_handoff_atn_cm(void)
dissect_atn_cm_heur,
"ATN-CM over ATN-ULCS",
"atn-cm-ulcs",
- proto_atn_cm);
+ proto_atn_cm, HEURISTIC_ENABLE);
}
/*
diff --git a/asn1/atn-cpdlc/packet-atn-cpdlc-template.c b/asn1/atn-cpdlc/packet-atn-cpdlc-template.c
index e260860d5f..5db061e3d3 100644
--- a/asn1/atn-cpdlc/packet-atn-cpdlc-template.c
+++ b/asn1/atn-cpdlc/packet-atn-cpdlc-template.c
@@ -342,7 +342,7 @@ void proto_reg_handoff_atn_cpdlc(void)
dissect_atn_cpdlc_heur,
"ATN-CPDLC over ATN-ULCS",
"atn-cpdlc-ulcs",
- proto_atn_cpdlc);
+ proto_atn_cpdlc, HEURISTIC_ENABLE);
}
diff --git a/asn1/atn-ulcs/packet-atn-ulcs-template.c b/asn1/atn-ulcs/packet-atn-ulcs-template.c
index 8634d5c15a..e5a9f3022d 100644
--- a/asn1/atn-ulcs/packet-atn-ulcs-template.c
+++ b/asn1/atn-ulcs/packet-atn-ulcs-template.c
@@ -891,7 +891,7 @@ void proto_reg_handoff_atn_ulcs(void)
dissect_atn_ulcs_heur,
"ATN-ULCS over COTP",
"atn-ucls_cotp",
- proto_atn_ulcs);
+ proto_atn_ulcs, HEURISTIC_ENABLE);
}
/*
diff --git a/asn1/credssp/packet-credssp-template.c b/asn1/credssp/packet-credssp-template.c
index 40ba87f0fa..111bd87a6d 100644
--- a/asn1/credssp/packet-credssp-template.c
+++ b/asn1/credssp/packet-credssp-template.c
@@ -176,7 +176,7 @@ void proto_register_credssp(void) {
/*--- proto_reg_handoff_credssp --- */
void proto_reg_handoff_credssp(void) {
- heur_dissector_add("ssl", dissect_credssp_heur, "CredSSP over SSL", "credssp_ssl", proto_credssp);
+ heur_dissector_add("ssl", dissect_credssp_heur, "CredSSP over SSL", "credssp_ssl", proto_credssp, HEURISTIC_ENABLE);
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
}
diff --git a/asn1/mms/packet-mms-template.c b/asn1/mms/packet-mms-template.c
index 417a4e9187..53350f50e0 100644
--- a/asn1/mms/packet-mms-template.c
+++ b/asn1/mms/packet-mms-template.c
@@ -172,7 +172,7 @@ dissect_mms_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
void proto_reg_handoff_mms(void) {
register_ber_oid_dissector("1.0.9506.2.3", dissect_mms, proto_mms,"MMS");
register_ber_oid_dissector("1.0.9506.2.1", dissect_mms, proto_mms,"mms-abstract-syntax-version1(1)");
- heur_dissector_add("cotp", dissect_mms_heur, "MMS over COTP", "mms_cotp", proto_mms);
- heur_dissector_add("cotp_is", dissect_mms_heur, "MMS over COTP (inactive subset)", "mms_cotp_is", proto_mms);
+ heur_dissector_add("cotp", dissect_mms_heur, "MMS over COTP", "mms_cotp", proto_mms, HEURISTIC_ENABLE);
+ heur_dissector_add("cotp_is", dissect_mms_heur, "MMS over COTP (inactive subset)", "mms_cotp_is", proto_mms, HEURISTIC_ENABLE);
}
diff --git a/asn1/mpeg-audio/packet-mpeg-audio-template.c b/asn1/mpeg-audio/packet-mpeg-audio-template.c
index c05a6731f4..8ae19bd9e4 100644
--- a/asn1/mpeg-audio/packet-mpeg-audio-template.c
+++ b/asn1/mpeg-audio/packet-mpeg-audio-template.c
@@ -176,5 +176,5 @@ proto_register_mpeg_audio(void)
void
proto_reg_handoff_mpeg_audio(void)
{
- heur_dissector_add("mpeg", dissect_mpeg_audio, "MPEG Audio", "mpeg_audio", proto_mpeg_audio);
+ heur_dissector_add("mpeg", dissect_mpeg_audio, "MPEG Audio", "mpeg_audio", proto_mpeg_audio, HEURISTIC_ENABLE);
}
diff --git a/asn1/mpeg-pes/packet-mpeg-pes-template.c b/asn1/mpeg-pes/packet-mpeg-pes-template.c
index d473967d26..01e4f43ffc 100644
--- a/asn1/mpeg-pes/packet-mpeg-pes-template.c
+++ b/asn1/mpeg-pes/packet-mpeg-pes-template.c
@@ -674,5 +674,5 @@ proto_reg_handoff_mpeg_pes(void)
dissector_handle_t mpeg_handle = find_dissector("mpeg");
dissector_add_uint("wtap_encap", WTAP_ENCAP_MPEG, mpeg_handle);
- heur_dissector_add("mpeg", dissect_mpeg_pes, "MPEG PES", "mpeg_pes", proto_mpeg_pes);
+ heur_dissector_add("mpeg", dissect_mpeg_pes, "MPEG PES", "mpeg_pes", proto_mpeg_pes, HEURISTIC_ENABLE);
}
diff --git a/asn1/ranap/packet-ranap-template.c b/asn1/ranap/packet-ranap-template.c
index 98c5efb3f2..57bd20a9a7 100644
--- a/asn1/ranap/packet-ranap-template.c
+++ b/asn1/ranap/packet-ranap-template.c
@@ -387,12 +387,9 @@ proto_reg_handoff_ranap(void)
dissector_add_uint("sccp.ssn", global_ranap_sccp_ssn, ranap_handle);
local_ranap_sccp_ssn = global_ranap_sccp_ssn;
- /* Add heuristic dissector
- * Perhaps we want a preference whether the heuristic dissector
- * is or isn't enabled
- */
- heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap);
- heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap);
+
+ heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap, HEURISTIC_ENABLE);
+ heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap, HEURISTIC_ENABLE);
}
diff --git a/asn1/rnsap/packet-rnsap-template.c b/asn1/rnsap/packet-rnsap-template.c
index 4ac6e743d9..80fe3536a9 100644
--- a/asn1/rnsap/packet-rnsap-template.c
+++ b/asn1/rnsap/packet-rnsap-template.c
@@ -180,11 +180,8 @@ proto_reg_handoff_rnsap(void)
rrc_dl_dcch_handle = find_dissector("rrc.dl.dcch");
dissector_add_uint("sccp.ssn", SCCP_SSN_RNSAP, rnsap_handle);
- /* Add heuristic dissector
- * Perhaps we want a preference whether the heuristic dissector
- * is or isn't enabled
- */
- /*heur_dissector_add("sccp", dissect_sccp_rnsap_heur, "RNSAP over SCCP", "ranap_sccp", proto_rnsap); */
+ /* Add heuristic dissector */
+ /*heur_dissector_add("sccp", dissect_sccp_rnsap_heur, "RNSAP over SCCP", "ranap_sccp", proto_rnsap, HEURISTIC_DISABLE); */
#include "packet-rnsap-dis-tab.c"
}
diff --git a/asn1/t124/packet-t124-template.c b/asn1/t124/packet-t124-template.c
index 12bdd40419..87752ab2a3 100644
--- a/asn1/t124/packet-t124-template.c
+++ b/asn1/t124/packet-t124-template.c
@@ -225,6 +225,6 @@ proto_reg_handoff_t124(void) {
register_ber_oid_dissector("0.0.20.124.0.1", dissect_t124, proto_t124, "Generic Conference Control");
- heur_dissector_add("t125", dissect_t124_heur, "T.124 over T.125", "t124_t125", proto_t124);
+ heur_dissector_add("t125", dissect_t124_heur, "T.124 over T.125", "t124_t125", proto_t124, HEURISTIC_ENABLE);
}
diff --git a/asn1/t125/packet-t125-template.c b/asn1/t125/packet-t125-template.c
index cce1d890a4..70ae4b6fb5 100644
--- a/asn1/t125/packet-t125-template.c
+++ b/asn1/t125/packet-t125-template.c
@@ -146,6 +146,6 @@ void proto_register_t125(void) {
/*--- proto_reg_handoff_t125 ---------------------------------------*/
void proto_reg_handoff_t125(void) {
- heur_dissector_add("cotp", dissect_t125_heur, "T.125 over COTP", "t125_cotp", proto_t125);
- heur_dissector_add("cotp_is", dissect_t125_heur, "T.125 over COTP (inactive subset)", "t125_cotp_is", proto_t125);
+ heur_dissector_add("cotp", dissect_t125_heur, "T.125 over COTP", "t125_cotp", proto_t125, HEURISTIC_ENABLE);
+ heur_dissector_add("cotp_is", dissect_t125_heur, "T.125 over COTP (inactive subset)", "t125_cotp_is", proto_t125, HEURISTIC_ENABLE);
}
diff --git a/epan/disabled_protos.c b/epan/disabled_protos.c
index 602f48d57d..2a86f0c281 100644
--- a/epan/disabled_protos.c
+++ b/epan/disabled_protos.c
@@ -477,9 +477,6 @@ set_disabled_heur_dissector_list(void)
heur_protocol_def *heur;
heur_dtbl_entry_t* h;
- /*
- * assume all heuristics are enabled by default
- */
if (disabled_heuristics == NULL)
goto skip;
diff --git a/epan/dissectors/file-btsnoop.c b/epan/dissectors/file-btsnoop.c
index 99a16c49a4..a0d80fd019 100644
--- a/epan/dissectors/file-btsnoop.c
+++ b/epan/dissectors/file-btsnoop.c
@@ -325,7 +325,7 @@ proto_reg_handoff_btsnoop(void)
hci_h4_handle = find_dissector("hci_h4");
hci_mon_handle = find_dissector("hci_mon");
- heur_dissector_add("wtap_file", dissect_btsnoop_heur, "BTSNOOP file", "btsnoop_wtap", proto_btsnoop);
+ heur_dissector_add("wtap_file", dissect_btsnoop_heur, "BTSNOOP file", "btsnoop_wtap", proto_btsnoop, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/file-elf.c b/epan/dissectors/file-elf.c
index c662eb7643..9ada20d6b4 100644
--- a/epan/dissectors/file-elf.c
+++ b/epan/dissectors/file-elf.c
@@ -2489,7 +2489,7 @@ proto_reg_handoff_elf(void)
/* XXX - TEMPORARY HACK */
dissector_add_uint("ftap_encap", 1234, elf_handle);
- heur_dissector_add("wtap_file", dissect_elf_heur, "ELF file", "elf_wtap", proto_elf);
+ heur_dissector_add("wtap_file", dissect_elf_heur, "ELF file", "elf_wtap", proto_elf, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/file-gif.c b/epan/dissectors/file-gif.c
index 3d771ad40f..5fc0ddb07c 100644
--- a/epan/dissectors/file-gif.c
+++ b/epan/dissectors/file-gif.c
@@ -702,8 +702,8 @@ proto_reg_handoff_gif(void)
{
/* Register the GIF media type */
dissector_add_string("media_type", "image/gif", gif_handle);
- heur_dissector_add("http", dissect_gif_heur, "GIF file in HTTP", "gif_http", hfi_gif->id);
- heur_dissector_add("wtap_file", dissect_gif_heur, "GIF file", "gif_wtap", hfi_gif->id);
+ heur_dissector_add("http", dissect_gif_heur, "GIF file in HTTP", "gif_http", hfi_gif->id, HEURISTIC_ENABLE);
+ heur_dissector_add("wtap_file", dissect_gif_heur, "GIF file", "gif_wtap", hfi_gif->id, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/file-jpeg.c b/epan/dissectors/file-jpeg.c
index 6cd0637684..d4a2799977 100644
--- a/epan/dissectors/file-jpeg.c
+++ b/epan/dissectors/file-jpeg.c
@@ -1347,8 +1347,8 @@ proto_reg_handoff_jfif(void)
dissector_add_uint("wtap_encap", WTAP_ENCAP_JPEG_JFIF, jfif_handle);
- heur_dissector_add("http", dissect_jfif_heur, "JPEG file in HTTP", "jfif_http", proto_jfif);
- heur_dissector_add("wtap_file", dissect_jfif_heur, "JPEG file", "jfif_wtap", proto_jfif);
+ heur_dissector_add("http", dissect_jfif_heur, "JPEG file in HTTP", "jfif_http", proto_jfif, HEURISTIC_ENABLE);
+ heur_dissector_add("wtap_file", dissect_jfif_heur, "JPEG file", "jfif_wtap", proto_jfif, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c
index 32a6da7711..77b77023d9 100644
--- a/epan/dissectors/file-png.c
+++ b/epan/dissectors/file-png.c
@@ -614,8 +614,8 @@ void
proto_reg_handoff_png(void)
{
dissector_add_string("media_type", "image/png", png_handle);
- heur_dissector_add("http", dissect_png_heur, "PNG file in HTTP", "png_http", hfi_png->id);
- heur_dissector_add("wtap_file", dissect_png_heur, "PNG file in HTTP", "png_wtap", hfi_png->id);
+ heur_dissector_add("http", dissect_png_heur, "PNG file in HTTP", "png_http", hfi_png->id, HEURISTIC_ENABLE);
+ heur_dissector_add("wtap_file", dissect_png_heur, "PNG file in HTTP", "png_wtap", hfi_png->id, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-3com-njack.c b/epan/dissectors/packet-3com-njack.c
index da8cf3bfed..0b8f8a3608 100644
--- a/epan/dissectors/packet-3com-njack.c
+++ b/epan/dissectors/packet-3com-njack.c
@@ -789,8 +789,8 @@ proto_reg_handoff_njack(void)
dissector_add_uint("udp.port", PORT_NJACK_SWITCH, njack_handle);
/* dissector_add_uint("tcp.port", PORT_NJACK_SWITCH, njack_handle); */
- heur_dissector_add("udp", dissect_njack_heur, "NJACK over UDP", "njack_udp", proto_njack);
- /* heur_dissector_add("tcp", dissect_njack_heur, "NJACK over TCP", "njack_tcp", proto_njack); */
+ heur_dissector_add("udp", dissect_njack_heur, "NJACK over UDP", "njack_udp", proto_njack, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_njack_heur, "NJACK over TCP", "njack_tcp", proto_njack, HEURISTIC_DISABLE);
}
/*
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c
index 4f1b3f84a8..8988d4ddd7 100644
--- a/epan/dissectors/packet-6lowpan.c
+++ b/epan/dissectors/packet-6lowpan.c
@@ -2916,7 +2916,7 @@ proto_reg_handoff_6lowpan(void)
/* Register the 6LoWPAN dissector with IEEE 802.15.4 */
dissector_add_for_decode_as(IEEE802154_PROTOABBREV_WPAN_PANID, handle_6lowpan);
- heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_6lowpan_heur, "6LoWPAN over IEEE 802.15.4", "6lowpan_wlan", proto_6lowpan);
+ heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_6lowpan_heur, "6LoWPAN over IEEE 802.15.4", "6lowpan_wlan", proto_6lowpan, HEURISTIC_ENABLE);
dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_LE_IPSP, handle_6lowpan);
} /* proto_reg_handoff_6lowpan */
diff --git a/epan/dissectors/packet-acn.c b/epan/dissectors/packet-acn.c
index 35d9a4f2c0..bfceda8d70 100644
--- a/epan/dissectors/packet-acn.c
+++ b/epan/dissectors/packet-acn.c
@@ -301,7 +301,6 @@ static int hf_acn_dmx_data = -1;
/* static int hf_acn_dmx_dmp_vector = -1; */
/* Try heuristic ACN decode */
-static gboolean global_acn_heur = FALSE;
static gboolean global_acn_dmx_enable = FALSE;
static gint global_acn_dmx_display_view = 0;
static gint global_acn_dmx_display_line_format = 0;
@@ -480,9 +479,6 @@ dissect_acn_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
* a heuristic dissector called before us!
*/
- /* abort if not enabled! */
- if (!global_acn_heur) return FALSE;
-
/* abort if it is NOT an ACN packet */
if (!is_acn(tvb)) return FALSE;
@@ -3222,10 +3218,7 @@ proto_register_acn(void)
proto_register_subtree_array(ett, array_length(ett));
acn_module = prefs_register_protocol(proto_acn, NULL);
- prefs_register_bool_preference(acn_module, "heuristic_acn",
- "Decode ACN",
- "Enable Architecture for Control Networks dissector (ANSI BSR E1.17)",
- &global_acn_heur);
+ prefs_register_obsolete_preference(acn_module, "heuristic_acn");
prefs_register_bool_preference(acn_module, "dmx_enable",
"Streaming DMX",
@@ -3266,7 +3259,7 @@ proto_reg_handoff_acn(void)
/* dissector_handle_t acn_handle; */
/* acn_handle = new_create_dissector_handle(dissect_acn, proto_acn); */
/* dissector_add_for_decode_as("udp.port", acn_handle); */
- heur_dissector_add("udp", dissect_acn_heur, "ACN over UDP", "acn_udp", proto_acn);
+ heur_dissector_add("udp", dissect_acn_heur, "ACN over UDP", "acn_udp", proto_acn, HEURISTIC_DISABLE);
}
/*
diff --git a/epan/dissectors/packet-adwin-config.c b/epan/dissectors/packet-adwin-config.c
index 608301761c..9a6477876d 100644
--- a/epan/dissectors/packet-adwin-config.c
+++ b/epan/dissectors/packet-adwin-config.c
@@ -777,8 +777,8 @@ proto_register_adwin_config(void)
void
proto_reg_handoff_adwin_config(void)
{
- heur_dissector_add("udp", dissect_adwin_config_udp, "ADwin-Config over UDP", "adwin_config_udp", proto_adwin_config);
- heur_dissector_add("tcp", dissect_adwin_config_tcp, "ADwin-Config over TCP", "adwin_config_tcp", proto_adwin_config);
+ heur_dissector_add("udp", dissect_adwin_config_udp, "ADwin-Config over UDP", "adwin_config_udp", proto_adwin_config, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_adwin_config_tcp, "ADwin-Config over TCP", "adwin_config_tcp", proto_adwin_config, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-aeron.c b/epan/dissectors/packet-aeron.c
index 1ff0ce388e..2c7acc4fb6 100644
--- a/epan/dissectors/packet-aeron.c
+++ b/epan/dissectors/packet-aeron.c
@@ -3135,7 +3135,7 @@ void proto_reg_handoff_aeron(void)
{
aeron_dissector_handle = new_create_dissector_handle(dissect_aeron, proto_aeron);
dissector_add_for_decode_as("udp.port", aeron_dissector_handle);
- heur_dissector_add("udp", test_aeron_packet, "Aeron over UDP", "aeron_udp", proto_aeron);
+ heur_dissector_add("udp", test_aeron_packet, "Aeron over UDP", "aeron_udp", proto_aeron, HEURISTIC_DISABLE);
aeron_data_dissector_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-applemidi.c b/epan/dissectors/packet-applemidi.c
index 3719eb5db3..3086318a98 100644
--- a/epan/dissectors/packet-applemidi.c
+++ b/epan/dissectors/packet-applemidi.c
@@ -524,7 +524,7 @@ proto_reg_handoff_applemidi( void ) {
* packets, it will be most likely RTP-MIDI...
*/
rtp_handle = find_dissector( "rtp" );
- heur_dissector_add( "udp", dissect_applemidi_heur, "Apple MIDI over UDP", "applemidi_udp", proto_applemidi );
+ heur_dissector_add( "udp", dissect_applemidi_heur, "Apple MIDI over UDP", "applemidi_udp", proto_applemidi, HEURISTIC_ENABLE );
}
/*
diff --git a/epan/dissectors/packet-ar_drone.c b/epan/dissectors/packet-ar_drone.c
index 70fd1ba014..53dc0c571c 100644
--- a/epan/dissectors/packet-ar_drone.c
+++ b/epan/dissectors/packet-ar_drone.c
@@ -796,7 +796,7 @@ proto_reg_handoff_ar_drone(void)
{
ar_drone_handle = new_create_dissector_handle(dissect_ar_drone, proto_ar_drone);
- heur_dissector_add("udp", dissect_ar_drone, "AR Drone over UDP", "ar_drone_udp", proto_ar_drone);
+ heur_dissector_add("udp", dissect_ar_drone, "AR Drone over UDP", "ar_drone_udp", proto_ar_drone, HEURISTIC_ENABLE);
initialized = TRUE;
}
diff --git a/epan/dissectors/packet-artnet.c b/epan/dissectors/packet-artnet.c
index f5401aa57f..beaa3b4999 100644
--- a/epan/dissectors/packet-artnet.c
+++ b/epan/dissectors/packet-artnet.c
@@ -5265,7 +5265,7 @@ proto_reg_handoff_artnet(void) {
rdm_handle = find_dissector("rdm");
dmx_chan_handle = find_dissector("dmx-chan");
- heur_dissector_add("udp", dissect_artnet_heur, "ARTNET over UDP", "artnet_udp", proto_artnet);
+ heur_dissector_add("udp", dissect_artnet_heur, "ARTNET over UDP", "artnet_udp", proto_artnet, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-at.c b/epan/dissectors/packet-at.c
index b9c672fa8d..a7b4b1f97e 100644
--- a/epan/dissectors/packet-at.c
+++ b/epan/dissectors/packet-at.c
@@ -116,8 +116,8 @@ proto_register_at_command(void)
void
proto_reg_handoff_at_command(void)
{
- heur_dissector_add("usb.bulk", heur_dissect_at, "AT Command USB bulk endpoint", "at_usb_bulk", proto_at);
- heur_dissector_add("usb.control", heur_dissect_at, "AT Command USB control endpoint", "at_usb_control", proto_at);
+ heur_dissector_add("usb.bulk", heur_dissect_at, "AT Command USB bulk endpoint", "at_usb_bulk", proto_at, HEURISTIC_ENABLE);
+ heur_dissector_add("usb.control", heur_dissect_at, "AT Command USB control endpoint", "at_usb_control", proto_at, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-atn-cm.c b/epan/dissectors/packet-atn-cm.c
index a6787fa2eb..9a6f714479 100644
--- a/epan/dissectors/packet-atn-cm.c
+++ b/epan/dissectors/packet-atn-cm.c
@@ -991,7 +991,7 @@ void proto_reg_handoff_atn_cm(void)
dissect_atn_cm_heur,
"ATN-CM over ATN-ULCS",
"atn-cm-ulcs",
- proto_atn_cm);
+ proto_atn_cm, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-atn-cpdlc.c b/epan/dissectors/packet-atn-cpdlc.c
index d065f320d6..a66aa3c55c 100644
--- a/epan/dissectors/packet-atn-cpdlc.c
+++ b/epan/dissectors/packet-atn-cpdlc.c
@@ -8107,7 +8107,7 @@ void proto_reg_handoff_atn_cpdlc(void)
dissect_atn_cpdlc_heur,
"ATN-CPDLC over ATN-ULCS",
"atn-cpdlc-ulcs",
- proto_atn_cpdlc);
+ proto_atn_cpdlc, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-atn-ulcs.c b/epan/dissectors/packet-atn-ulcs.c
index 9a2ad27611..201cebb585 100644
--- a/epan/dissectors/packet-atn-ulcs.c
+++ b/epan/dissectors/packet-atn-ulcs.c
@@ -2617,7 +2617,7 @@ void proto_reg_handoff_atn_ulcs(void)
dissect_atn_ulcs_heur,
"ATN-ULCS over COTP",
"atn-ucls_cotp",
- proto_atn_ulcs);
+ proto_atn_ulcs, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-bfcp.c b/epan/dissectors/packet-bfcp.c
index 5e896f1bde..0747af43e0 100644
--- a/epan/dissectors/packet-bfcp.c
+++ b/epan/dissectors/packet-bfcp.c
@@ -36,8 +36,6 @@ void proto_reg_handoff_bfcp(void);
/* Initialize protocol and registered fields */
static int proto_bfcp = -1;
-static gboolean bfcp_enable_heuristic_dissection = FALSE;
-
static int hf_bfcp_version = -1;
static int hf_bfcp_hdr_r_bit = -1;
@@ -686,10 +684,7 @@ void proto_register_bfcp(void)
bfcp_module = prefs_register_protocol(proto_bfcp,
proto_reg_handoff_bfcp);
- prefs_register_bool_preference(bfcp_module, "enable",
- "Enable BFCP heuristic dissection",
- "Enable BFCP heuristic dissection (default is disabled)",
- &bfcp_enable_heuristic_dissection);
+ prefs_register_obsolete_preference(bfcp_module, "enable");
/* Register field and subtree array */
proto_register_field_array(proto_bfcp, hf, array_length(hf));
@@ -709,18 +704,12 @@ void proto_reg_handoff_bfcp(void)
*/
if (!prefs_initialized)
{
- heur_dissector_add("tcp", dissect_bfcp_heur, "BFCP over TCP", "bfcp_tcp", proto_bfcp);
- heur_dissector_add("udp", dissect_bfcp_heur, "BFCP over UDP", "bfcp_udp", proto_bfcp);
+ heur_dissector_add("tcp", dissect_bfcp_heur, "BFCP over TCP", "bfcp_tcp", proto_bfcp, HEURISTIC_DISABLE);
+ heur_dissector_add("udp", dissect_bfcp_heur, "BFCP over UDP", "bfcp_udp", proto_bfcp, HEURISTIC_DISABLE);
dissector_add_for_decode_as("tcp.port", bfcp_handle);
dissector_add_for_decode_as("udp.port", bfcp_handle);
prefs_initialized = TRUE;
}
-
- heur_dissector_set_enabled("tcp", dissect_bfcp_heur, proto_bfcp,
- bfcp_enable_heuristic_dissection);
-
- heur_dissector_set_enabled("udp", dissect_bfcp_heur, proto_bfcp,
- bfcp_enable_heuristic_dissection);
}
/*
diff --git a/epan/dissectors/packet-bitcoin.c b/epan/dissectors/packet-bitcoin.c
index 45decc8e8a..f8d442d167 100644
--- a/epan/dissectors/packet-bitcoin.c
+++ b/epan/dissectors/packet-bitcoin.c
@@ -1923,7 +1923,7 @@ proto_reg_handoff_bitcoin(void)
{
dissector_add_for_decode_as("tcp.port", bitcoin_handle);
- heur_dissector_add( "tcp", dissect_bitcoin_heur, "Bitcoin over TCP", "bitcoin_tcp", hfi_bitcoin->id);
+ heur_dissector_add( "tcp", dissect_bitcoin_heur, "Bitcoin over TCP", "bitcoin_tcp", hfi_bitcoin->id, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c
index 617c3a11e8..ef739fccd1 100644
--- a/epan/dissectors/packet-bittorrent.c
+++ b/epan/dissectors/packet-bittorrent.c
@@ -708,7 +708,7 @@ proto_reg_handoff_bittorrent(void)
dissector_add_uint("tcp.port", 6888, dissector_handle);
dissector_add_uint("tcp.port", 6889, dissector_handle);
#endif
- heur_dissector_add("tcp", test_bittorrent_packet, "BitTorrent over TCP", "bittorrent_tcp", proto_bittorrent);
+ heur_dissector_add("tcp", test_bittorrent_packet, "BitTorrent over TCP", "bittorrent_tcp", proto_bittorrent, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c
index 544c1be713..b275a6ca8e 100644
--- a/epan/dissectors/packet-bssap.c
+++ b/epan/dissectors/packet-bssap.c
@@ -2557,8 +2557,8 @@ proto_reg_handoff_bssap(void)
static guint old_bssap_ssn;
if (!initialized) {
- heur_dissector_add("sccp", dissect_bssap_heur, "BSSAP over SCCP", "bssap_sccp", proto_bssap);
- heur_dissector_add("sua", dissect_bssap_heur, "BSSAP over SUA", "bssap_sua", proto_bssap);
+ heur_dissector_add("sccp", dissect_bssap_heur, "BSSAP over SCCP", "bssap_sccp", proto_bssap, HEURISTIC_ENABLE);
+ heur_dissector_add("sua", dissect_bssap_heur, "BSSAP over SUA", "bssap_sua", proto_bssap, HEURISTIC_ENABLE);
/* BSSAP+ */
bssap_plus_handle = new_create_dissector_handle(dissect_bssap_plus, proto_bssap);
diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c
index 5fdc5129e8..f7d3baac9e 100644
--- a/epan/dissectors/packet-bt-dht.c
+++ b/epan/dissectors/packet-bt-dht.c
@@ -43,8 +43,6 @@ void proto_reg_handoff_bt_dht(void);
static int proto_bt_dht = -1;
static dissector_handle_t bt_dht_handle;
-static gboolean bt_dht_enable_heuristic_dissection = FALSE; /* disabled by default since heuristic is weak */
-
/* fields */
static int hf_bencoded_int = -1;
static int hf_bencoded_string = -1;
@@ -576,9 +574,7 @@ proto_register_bt_dht(void)
);
bt_dht_module = prefs_register_protocol(proto_bt_dht, proto_reg_handoff_bt_dht);
- prefs_register_bool_preference(bt_dht_module, "enable", "Enable BT-DHT heuristic dissection",
- "Enable BT-DHT heuristic dissection (default is disabled)",
- &bt_dht_enable_heuristic_dissection);
+ prefs_register_obsolete_preference(bt_dht_module, "enable");
proto_register_field_array(proto_bt_dht, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -594,15 +590,13 @@ proto_reg_handoff_bt_dht(void)
* XXX - Still too weak?
*/
if (!prefs_initialized) {
- heur_dissector_add("udp", dissect_bt_dht_heur, "BitTorrent DHT over UDP", "bittorrent_dht_udp", proto_bt_dht);
+ heur_dissector_add("udp", dissect_bt_dht_heur, "BitTorrent DHT over UDP", "bittorrent_dht_udp", proto_bt_dht, HEURISTIC_DISABLE);
bt_dht_handle = new_create_dissector_handle(dissect_bt_dht, proto_bt_dht);
dissector_add_for_decode_as("udp.port", bt_dht_handle);
prefs_initialized = TRUE;
}
-
- heur_dissector_set_enabled("udp", dissect_bt_dht_heur, proto_bt_dht, bt_dht_enable_heuristic_dissection);
}
/*
diff --git a/epan/dissectors/packet-bt-utp.c b/epan/dissectors/packet-bt-utp.c
index 5020b87447..cec1b600a7 100644
--- a/epan/dissectors/packet-bt-utp.c
+++ b/epan/dissectors/packet-bt-utp.c
@@ -65,8 +65,6 @@ static const value_string bt_utp_extension_type_vals[] = {
static int proto_bt_utp = -1;
-static gboolean bt_utp_enable_heuristic_dissection = FALSE; /* disabled by default since heuristic is weak */
-
/* --- "Original" uTP Header ("version 0" ?) --------------
See utp.cpp source code @ https://github.com/bittorrent/libutp
@@ -475,9 +473,7 @@ proto_register_bt_utp(void)
);
bt_utp_module = prefs_register_protocol(proto_bt_utp, proto_reg_handoff_bt_utp);
- prefs_register_bool_preference(bt_utp_module, "enable", "Enable BT-uTP heuristic dissection",
- "Enable BT-uTP heuristic dissection (default is disabled)",
- &bt_utp_enable_heuristic_dissection);
+ prefs_register_obsolete_preference(bt_utp_module, "enable");
proto_register_field_array(proto_bt_utp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -489,15 +485,14 @@ proto_reg_handoff_bt_utp(void)
static gboolean prefs_initialized = FALSE;
if (!prefs_initialized) {
- heur_dissector_add("udp", dissect_bt_utp, "BitTorrent UTP over UDP", "bt_utp_udp", proto_bt_utp);
+ /* disabled by default since heuristic is weak */
+ heur_dissector_add("udp", dissect_bt_utp, "BitTorrent UTP over UDP", "bt_utp_udp", proto_bt_utp, HEURISTIC_DISABLE);
bt_utp_handle = new_create_dissector_handle(dissect_bt_utp, proto_bt_utp);
dissector_add_for_decode_as("udp.port", bt_utp_handle);
prefs_initialized = TRUE;
}
-
- heur_dissector_set_enabled("udp", dissect_bt_utp, proto_bt_utp, bt_utp_enable_heuristic_dissection);
}
/*
diff --git a/epan/dissectors/packet-carp.c b/epan/dissectors/packet-carp.c
index 326a042a75..3862549189 100644
--- a/epan/dissectors/packet-carp.c
+++ b/epan/dissectors/packet-carp.c
@@ -248,7 +248,7 @@ proto_reg_handoff_carp(void)
carp_handle = new_create_dissector_handle(dissect_carp, proto_carp);
dissector_add_uint("ip.proto", IP_PROTO_VRRP, carp_handle);
- heur_dissector_add( "ip", dissect_carp_heur, "CARP over IP", "carp_ip", proto_carp);
+ heur_dissector_add( "ip", dissect_carp_heur, "CARP over IP", "carp_ip", proto_carp, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-cattp.c b/epan/dissectors/packet-cattp.c
index d369f6cdc0..3c85874cb1 100644
--- a/epan/dissectors/packet-cattp.c
+++ b/epan/dissectors/packet-cattp.c
@@ -101,9 +101,6 @@ static dissector_handle_t data_handle;
/* Preference to control whether to check the CATTP checksum */
static gboolean cattp_check_checksum = TRUE;
-/* Preference to control whether to heuristically detect CATTP packets */
-static gboolean cattp_enable_heuristic_dissection = TRUE;
-
/* Reason code mapping */
static const value_string cattp_reset_reason[] = {
{ 0, "Normal Ending" },
@@ -564,10 +561,7 @@ proto_register_cattp(void)
"Whether the checksum of all messages should be validated or not",
&cattp_check_checksum);
- prefs_register_bool_preference(cattp_module, "enable",
- "Enable " CATTP_SHORTNAME " heuristic dissection",
- "Enable " CATTP_SHORTNAME " heuristic dissection (default is enabled)",
- &cattp_enable_heuristic_dissection);
+ prefs_register_obsolete_preference(cattp_module, "enable");
}
/* Handoff */
@@ -585,13 +579,10 @@ proto_reg_handoff_cattp(void)
/* find data handle */
data_handle = find_dissector("data");
- heur_dissector_add("udp", dissect_cattp_heur, "CAT-TP over UDP", "cattp_udp", proto_cattp);
+ heur_dissector_add("udp", dissect_cattp_heur, "CAT-TP over UDP", "cattp_udp", proto_cattp, HEURISTIC_ENABLE);
dissector_add_for_decode_as("udp.port", cattp_handle);
initialized = TRUE;
}
-
- heur_dissector_set_enabled("udp", dissect_cattp_heur, proto_cattp,
- cattp_enable_heuristic_dissection);
}
/*
diff --git a/epan/dissectors/packet-ceph.c b/epan/dissectors/packet-ceph.c
index cf05a173e5..79d23e6260 100644
--- a/epan/dissectors/packet-ceph.c
+++ b/epan/dissectors/packet-ceph.c
@@ -10515,7 +10515,7 @@ proto_reg_handoff_ceph(void)
{
ceph_handle = create_dissector_handle(dissect_ceph_old, proto_ceph);
- heur_dissector_add("tcp", dissect_ceph_heur, "Ceph over TCP", "ceph_tcp", proto_ceph);
+ heur_dissector_add("tcp", dissect_ceph_heur, "Ceph over TCP", "ceph_tcp", proto_ceph, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-cigi.c b/epan/dissectors/packet-cigi.c
index f96cfbf72e..a111ff5b2d 100644
--- a/epan/dissectors/packet-cigi.c
+++ b/epan/dissectors/packet-cigi.c
@@ -12040,7 +12040,7 @@ proto_reg_handoff_cigi(void)
cigi_handle = new_create_dissector_handle(dissect_cigi, proto_cigi);
dissector_add_for_decode_as("udp.port", cigi_handle);
dissector_add_for_decode_as("tcp.port", cigi_handle);
- heur_dissector_add("udp", dissect_cigi_heur, "CIGI over UDP", "cigi_udp", proto_cigi);
+ heur_dissector_add("udp", dissect_cigi_heur, "CIGI over UDP", "cigi_udp", proto_cigi, HEURISTIC_ENABLE);
inited = TRUE;
}
diff --git a/epan/dissectors/packet-cimd.c b/epan/dissectors/packet-cimd.c
index f4e61a6407..da3dbc25e6 100644
--- a/epan/dissectors/packet-cimd.c
+++ b/epan/dissectors/packet-cimd.c
@@ -1161,7 +1161,7 @@ proto_reg_handoff_cimd(void)
* CIMD can be spoken on any port so, when not on a specific port, try this
* one whenever TCP is spoken.
*/
- heur_dissector_add("tcp", dissect_cimd_heur, "CIMD over TCP", "cimd_tcp", proto_cimd);
+ heur_dissector_add("tcp", dissect_cimd_heur, "CIMD over TCP", "cimd_tcp", proto_cimd, HEURISTIC_ENABLE);
/**
* Also register as one that can be selected by a TCP port number.
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index 2cc76b2b91..8cac8f0299 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -6951,7 +6951,7 @@ proto_reg_handoff_cip(void)
/* Create and register dissector handle for Connection Configuration Object */
cip_class_cco_handle = new_create_dissector_handle( dissect_cip_class_cco, proto_cip_class_cco );
dissector_add_uint( "cip.class.iface", CI_CLS_CCO, cip_class_cco_handle );
- heur_dissector_add("cip.sc", dissect_class_cco_heur, "CIP Connection Configuration Object", "cco_cip", proto_cip_class_cco);
+ heur_dissector_add("cip.sc", dissect_class_cco_heur, "CIP Connection Configuration Object", "cco_cip", proto_cip_class_cco, HEURISTIC_ENABLE);
proto_enip = proto_get_id_by_filter_name( "enip" );
proto_modbus = proto_get_id_by_filter_name( "modbus" );
diff --git a/epan/dissectors/packet-cipsafety.c b/epan/dissectors/packet-cipsafety.c
index cbb85b70e1..a3580279fb 100644
--- a/epan/dissectors/packet-cipsafety.c
+++ b/epan/dissectors/packet-cipsafety.c
@@ -2619,7 +2619,7 @@ proto_reg_handoff_cipsafety(void)
/* Create and register dissector handle for Safety Validator */
cip_class_s_validator_handle = new_create_dissector_handle( dissect_cip_class_s_validator, proto_cip_class_s_validator );
dissector_add_uint( "cip.class.iface", CI_CLS_SAFETY_VALIDATOR, cip_class_s_validator_handle );
- heur_dissector_add("cip.sc", dissect_class_svalidator_heur, "CIP Safety Validator", "s_validator_cip", proto_cip_class_s_validator);
+ heur_dissector_add("cip.sc", dissect_class_svalidator_heur, "CIP Safety Validator", "s_validator_cip", proto_cip_class_s_validator, HEURISTIC_ENABLE);
/* Create and register dissector for I/O data handling */
cipsafety_handle = create_dissector_handle( dissect_cipsafety, proto_cipsafety );
diff --git a/epan/dissectors/packet-classicstun.c b/epan/dissectors/packet-classicstun.c
index ce2b0363b4..debfc1d4c6 100644
--- a/epan/dissectors/packet-classicstun.c
+++ b/epan/dissectors/packet-classicstun.c
@@ -709,8 +709,8 @@ proto_reg_handoff_classicstun(void)
dissector_add_uint("tcp.port", TCP_PORT_STUN, classicstun_handle);
dissector_add_uint("udp.port", UDP_PORT_STUN, classicstun_handle);
#endif
- heur_dissector_add("udp", dissect_classicstun_heur, "Classic STUN over UDP", "classicstun_udp", proto_classicstun);
- heur_dissector_add("tcp", dissect_classicstun_heur, "Classic STUN over TCP", "classicstun_tcp", proto_classicstun);
+ heur_dissector_add("udp", dissect_classicstun_heur, "Classic STUN over UDP", "classicstun_udp", proto_classicstun, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_classicstun_heur, "Classic STUN over TCP", "classicstun_tcp", proto_classicstun, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-clique-rm.c b/epan/dissectors/packet-clique-rm.c
index e4d2b8c00a..77c9d05306 100644
--- a/epan/dissectors/packet-clique-rm.c
+++ b/epan/dissectors/packet-clique-rm.c
@@ -474,7 +474,7 @@ proto_register_clique_rm(void)
void
proto_reg_handoff_clique_rm(void)
{
- heur_dissector_add("udp", dissect_clique_rm, "Clique RM over UDP", "clique_rm_udp", proto_clique_rm);
+ heur_dissector_add("udp", dissect_clique_rm, "Clique RM over UDP", "clique_rm_udp", proto_clique_rm, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-credssp.c b/epan/dissectors/packet-credssp.c
index 16a5fa9327..9eae441edf 100644
--- a/epan/dissectors/packet-credssp.c
+++ b/epan/dissectors/packet-credssp.c
@@ -552,7 +552,7 @@ void proto_register_credssp(void) {
/*--- proto_reg_handoff_credssp --- */
void proto_reg_handoff_credssp(void) {
- heur_dissector_add("ssl", dissect_credssp_heur, "CredSSP over SSL", "credssp_ssl", proto_credssp);
+ heur_dissector_add("ssl", dissect_credssp_heur, "CredSSP over SSL", "credssp_ssl", proto_credssp, HEURISTIC_ENABLE);
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
}
diff --git a/epan/dissectors/packet-ctdb.c b/epan/dissectors/packet-ctdb.c
index cb5c92c633..bb21ea50c2 100644
--- a/epan/dissectors/packet-ctdb.c
+++ b/epan/dissectors/packet-ctdb.c
@@ -1243,7 +1243,7 @@ proto_reg_handoff_ctdb(void)
ctdb_handle = new_create_dissector_handle(dissect_ctdb, proto_ctdb);
dissector_add_for_decode_as("tcp.port", ctdb_handle);
- heur_dissector_add("tcp", dissect_ctdb, "Cluster TDB over TCP", "ctdb_tcp", proto_ctdb);
+ heur_dissector_add("tcp", dissect_ctdb, "Cluster TDB over TCP", "ctdb_tcp", proto_ctdb, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-dcc.c b/epan/dissectors/packet-dcc.c
index 7fc29664ab..a61b514aea 100644
--- a/epan/dissectors/packet-dcc.c
+++ b/epan/dissectors/packet-dcc.c
@@ -585,7 +585,7 @@ proto_register_dcc(void)
void
proto_reg_handoff_dcc(void)
{
- heur_dissector_add("udp", dissect_dcc, "Distributed Checksum Clearinghouse over UDP", "dcc_udp", proto_dcc);
+ heur_dissector_add("udp", dissect_dcc, "Distributed Checksum Clearinghouse over UDP", "dcc_udp", proto_dcc, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index ae71797484..1791dd120b 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -6541,12 +6541,12 @@ proto_register_dcerpc(void)
void
proto_reg_handoff_dcerpc(void)
{
- heur_dissector_add("tcp", dissect_dcerpc_tcp, "DCE/RPC over TCP", "dcerpc_tcp", proto_dcerpc);
- heur_dissector_add("netbios", dissect_dcerpc_cn_pk, "DCE/RPC over NetBios", "dcerpc_netbios", proto_dcerpc);
- heur_dissector_add("udp", dissect_dcerpc_dg, "DCE/RPC over UDP", "dcerpc_udp", proto_dcerpc);
- heur_dissector_add("smb_transact", dissect_dcerpc_cn_smbpipe, "DCE/RPC over SMB", "dcerpc_smb_transact", proto_dcerpc);
- heur_dissector_add("smb2_heur_subdissectors", dissect_dcerpc_cn_smb2, "DCE/RPC over SMB2", "dcerpc_smb2", proto_dcerpc);
- heur_dissector_add("http", dissect_dcerpc_cn_bs, "DCE/RPC over HTTP", "dcerpc_http", proto_dcerpc);
+ heur_dissector_add("tcp", dissect_dcerpc_tcp, "DCE/RPC over TCP", "dcerpc_tcp", proto_dcerpc, HEURISTIC_ENABLE);
+ heur_dissector_add("netbios", dissect_dcerpc_cn_pk, "DCE/RPC over NetBios", "dcerpc_netbios", proto_dcerpc, HEURISTIC_ENABLE);
+ heur_dissector_add("udp", dissect_dcerpc_dg, "DCE/RPC over UDP", "dcerpc_udp", proto_dcerpc, HEURISTIC_ENABLE);
+ heur_dissector_add("smb_transact", dissect_dcerpc_cn_smbpipe, "DCE/RPC over SMB", "dcerpc_smb_transact", proto_dcerpc, HEURISTIC_ENABLE);
+ heur_dissector_add("smb2_heur_subdissectors", dissect_dcerpc_cn_smb2, "DCE/RPC over SMB2", "dcerpc_smb2", proto_dcerpc, HEURISTIC_ENABLE);
+ heur_dissector_add("http", dissect_dcerpc_cn_bs, "DCE/RPC over HTTP", "dcerpc_http", proto_dcerpc, HEURISTIC_ENABLE);
dcerpc_smb_init(proto_dcerpc);
guids_add_uuid(&uuid_data_repr_proto, "32bit NDR");
diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c
index 46aa3d0ef6..decb196061 100644
--- a/epan/dissectors/packet-dcm.c
+++ b/epan/dissectors/packet-dcm.c
@@ -242,7 +242,6 @@ void proto_reg_handoff_dcm(void);
static range_t *global_dcm_tcp_range = NULL;
static range_t *global_dcm_tcp_range_backup = NULL; /* needed to deregister */
-static gboolean global_dcm_heuristic = FALSE;
static gboolean global_dcm_export_header = TRUE;
static guint global_dcm_export_minsize = 4096; /* Filter small objects in export */
@@ -7062,8 +7061,6 @@ static void dcm_apply_settings(void) {
dissector_delete_uint_range("tcp.port", global_dcm_tcp_range_backup, dcm_handle);
g_free(global_dcm_tcp_range_backup);
- heur_dissector_delete("tcp", dissect_dcm_heuristic, proto_dcm);
-
/* Register 'static' tcp port range specified in properties
Statically defined ports take precedence over a heuristic one,
I.e., if an foreign protocol claims a port, where dicom is running on
@@ -7074,12 +7071,6 @@ static void dcm_apply_settings(void) {
/* remember settings for next time */
global_dcm_tcp_range_backup = range_copy(global_dcm_tcp_range);
-
- /* Add heuristic search, if user selected it */
-
- if (global_dcm_heuristic)
- heur_dissector_add("tcp", dissect_dcm_heuristic, "DICOM over TCP", "dicom_tcp", proto_dcm);
-
}
/* Register the protocol with Wireshark */
@@ -7294,12 +7285,7 @@ proto_register_dcm(void)
prefs_register_range_preference(dcm_module, "tcp.port",
"DICOM Ports", "DICOM Ports range", &global_dcm_tcp_range, 65535);
- prefs_register_bool_preference(dcm_module, "heuristic",
- "Search on any TCP Port (heuristic mode)",
- "When enabled, the DICOM dissector will parse all TCP packets "
- "not handled by any other dissector and look for an association request. "
- "Disabled by default, to preserve resources for the non DICOM community.",
- &global_dcm_heuristic);
+ prefs_register_obsolete_preference(dcm_module, "heuristic");
prefs_register_bool_preference(dcm_module, "export_header",
"Create Meta Header on Export",
@@ -7352,8 +7338,9 @@ proto_reg_handoff_dcm(void)
dcm_handle = new_create_dissector_handle(dissect_dcm_static, proto_dcm);
- dcm_apply_settings(); /* Register static and heuristic ports */
+ dcm_apply_settings(); /* Register static ports */
+ heur_dissector_add("tcp", dissect_dcm_heuristic, "DICOM over TCP", "dicom_tcp", proto_dcm, HEURISTIC_DISABLE);
}
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c
index bf1cbd0fe6..7df06f51e7 100644
--- a/epan/dissectors/packet-dcp-etsi.c
+++ b/epan/dissectors/packet-dcp-etsi.c
@@ -656,7 +656,7 @@ proto_reg_handoff_dcp_etsi (void)
af_handle = create_dissector_handle(dissect_af, proto_af);
pft_handle = create_dissector_handle(dissect_pft, proto_pft);
tpl_handle = create_dissector_handle(dissect_tpl, proto_tpl);
- heur_dissector_add("udp", dissect_dcp_etsi, "DCP (ETSI) over UDP", "dcp_etsi_udp", proto_dcp_etsi);
+ heur_dissector_add("udp", dissect_dcp_etsi, "DCP (ETSI) over UDP", "dcp_etsi_udp", proto_dcp_etsi, HEURISTIC_ENABLE);
dissector_add_string("dcp-etsi.sync", "AF", af_handle);
dissector_add_string("dcp-etsi.sync", "PF", pft_handle);
/* if there are ever other payload types ...*/
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c
index dd754250de..e6cd06029c 100644
--- a/epan/dissectors/packet-dnp.c
+++ b/epan/dissectors/packet-dnp.c
@@ -1377,8 +1377,6 @@ typedef struct {
/* The conversation sequence number */
static guint seq_number = 0;
-/* Heuristically detect DNP3 over TCP/UDP */
-static gboolean dnp3_heuristics = FALSE;
/* desegmentation of DNP3 over TCP */
static gboolean dnp3_desegment = TRUE;
@@ -3437,7 +3435,7 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
static gboolean
-check_dnp3_header(tvbuff_t *tvb)
+check_dnp3_header(tvbuff_t *tvb, gboolean dnp3_heuristics)
{
/* Assume the CRC will be bad */
gboolean goodCRC = FALSE;
@@ -3494,10 +3492,23 @@ get_dnp3_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
return message_len;
}
-static gboolean
+static int
dissect_dnp3_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (!check_dnp3_header(tvb)) {
+ if (!check_dnp3_header(tvb, FALSE)) {
+ return 0;
+ }
+
+ tcp_dissect_pdus(tvb, pinfo, tree, TRUE, DNP_HDR_LEN,
+ get_dnp3_message_len, dissect_dnp3_message, data);
+
+ return tvb_captured_length(tvb);
+}
+
+static gboolean
+dissect_dnp3_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
+{
+ if (!check_dnp3_header(tvb, TRUE)) {
return FALSE;
}
@@ -3507,10 +3518,21 @@ dissect_dnp3_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return TRUE;
}
-static gboolean
+static int
dissect_dnp3_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (!check_dnp3_header(tvb)) {
+ if (!check_dnp3_header(tvb, FALSE)) {
+ return 0;
+ }
+
+ dissect_dnp3_message(tvb, pinfo, tree, data);
+ return tvb_captured_length(tvb);
+}
+
+static gboolean
+dissect_dnp3_udp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
+{
+ if (!check_dnp3_header(tvb, TRUE)) {
return FALSE;
}
@@ -4544,10 +4566,7 @@ proto_register_dnp3(void)
expert_register_field_array(expert_dnp3, ei, array_length(ei));
dnp3_module = prefs_register_protocol(proto_dnp3, NULL);
- prefs_register_bool_preference(dnp3_module, "heuristics",
- "Try to detect DNP 3 heuristically",
- "Whether the DNP3 dissector should try to find DNP 3 packets heuristically.",
- &dnp3_heuristics);
+ prefs_register_obsolete_preference(dnp3_module, "heuristics");
prefs_register_bool_preference(dnp3_module, "desegment",
"Reassemble DNP3 messages spanning multiple TCP segments",
"Whether the DNP3 dissector should reassemble messages spanning multiple TCP segments."
@@ -4563,13 +4582,8 @@ proto_reg_handoff_dnp3(void)
dissector_handle_t dnp3_udp_handle;
/* register as heuristic dissector for both TCP and UDP */
- if (dnp3_heuristics) {
- heur_dissector_add("tcp", dissect_dnp3_tcp, "DNP 3.0 over TCP", "dnp3_tcp", proto_dnp3);
- heur_dissector_add("udp", dissect_dnp3_udp, "DNP 3.0 over UDP", "dnp3_udp", proto_dnp3);
- } else {
- heur_dissector_delete("tcp", dissect_dnp3_tcp, proto_dnp3);
- heur_dissector_delete("udp", dissect_dnp3_udp, proto_dnp3);
- }
+ heur_dissector_add("tcp", dissect_dnp3_tcp_heur, "DNP 3.0 over TCP", "dnp3_tcp", proto_dnp3, HEURISTIC_DISABLE);
+ heur_dissector_add("udp", dissect_dnp3_udp_heur, "DNP 3.0 over UDP", "dnp3_udp", proto_dnp3, HEURISTIC_DISABLE);
dnp3_tcp_handle = new_create_dissector_handle(dissect_dnp3_tcp, proto_dnp3);
dnp3_udp_handle = new_create_dissector_handle(dissect_dnp3_udp, proto_dnp3);
diff --git a/epan/dissectors/packet-dplay.c b/epan/dissectors/packet-dplay.c
index e8a484aa99..9fb023dcbf 100644
--- a/epan/dissectors/packet-dplay.c
+++ b/epan/dissectors/packet-dplay.c
@@ -1712,8 +1712,8 @@ void proto_register_dplay(void)
void proto_reg_handoff_dplay(void)
{
- heur_dissector_add("udp", heur_dissect_dplay, "DirectPlay over UDP", "dplay_udp", proto_dplay);
- heur_dissector_add("tcp", heur_dissect_dplay, "DirectPlay over TCP", "dplay_tcp", proto_dplay);
+ heur_dissector_add("udp", heur_dissect_dplay, "DirectPlay over UDP", "dplay_udp", proto_dplay, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", heur_dissect_dplay, "DirectPlay over TCP", "dplay_tcp", proto_dplay, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c
index 84bf94abd2..131a543af0 100644
--- a/epan/dissectors/packet-drda.c
+++ b/epan/dissectors/packet-drda.c
@@ -942,7 +942,7 @@ proto_register_drda(void)
void
proto_reg_handoff_drda(void)
{
- heur_dissector_add("tcp", dissect_drda_heur, "DRDA over TCP", "drda_tcp", proto_drda);
+ heur_dissector_add("tcp", dissect_drda_heur, "DRDA over TCP", "drda_tcp", proto_drda, HEURISTIC_ENABLE);
drda_tcp_handle = new_create_dissector_handle(dissect_drda_tcp, proto_drda);
}
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index b432a80493..d2ce36a0d8 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -1969,7 +1969,7 @@ proto_reg_handoff_dtls(void)
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
if (initialized == FALSE) {
- heur_dissector_add("udp", dissect_dtls_heur, "DTLS over UDP", "dtls_udp", proto_dtls);
+ heur_dissector_add("udp", dissect_dtls_heur, "DTLS over UDP", "dtls_udp", proto_dtls, HEURISTIC_ENABLE);
dissector_add_uint("sctp.ppi", DIAMETER_DTLS_PROTOCOL_ID, find_dissector("dtls"));
}
diff --git a/epan/dissectors/packet-dvb-s2-bb.c b/epan/dissectors/packet-dvb-s2-bb.c
index 6b3c1efe44..f7fdd1fa47 100644
--- a/epan/dissectors/packet-dvb-s2-bb.c
+++ b/epan/dissectors/packet-dvb-s2-bb.c
@@ -69,7 +69,6 @@ void proto_register_dvb_s2_modeadapt(void);
void proto_reg_handoff_dvb_s2_modeadapt(void);
/* preferences */
-static gboolean dvb_s2_enable = FALSE;
static gboolean dvb_s2_full_dissection = FALSE;
/* Initialize the protocol and registered fields */
@@ -1090,8 +1089,7 @@ void proto_register_dvb_s2_modeadapt(void)
dvb_s2_modeadapt_module = prefs_register_protocol(proto_dvb_s2_modeadapt, proto_reg_handoff_dvb_s2_modeadapt);
- prefs_register_bool_preference(dvb_s2_modeadapt_module, "enable", "Enable dissector",
- "Enable DVB-S2 dissector", &dvb_s2_enable);
+ prefs_register_obsolete_preference(dvb_s2_modeadapt_module, "enable");
prefs_register_bool_preference(dvb_s2_modeadapt_module, "full_decode",
"Enable dissection of GSE data",
@@ -1104,13 +1102,11 @@ void proto_reg_handoff_dvb_s2_modeadapt(void)
static gboolean prefs_initialized = FALSE;
if (!prefs_initialized) {
- heur_dissector_add("udp", dissect_dvb_s2_modeadapt, "DVB-S2 over UDP", "dvb_s2_udp", proto_dvb_s2_modeadapt);
+ heur_dissector_add("udp", dissect_dvb_s2_modeadapt, "DVB-S2 over UDP", "dvb_s2_udp", proto_dvb_s2_modeadapt, HEURISTIC_DISABLE);
ip_handle = find_dissector("ip");
ipv6_handle = find_dissector("ipv6");
prefs_initialized = TRUE;
}
-
- proto_set_decoding(proto_dvb_s2_modeadapt, dvb_s2_enable);
}
/*
diff --git a/epan/dissectors/packet-e100.c b/epan/dissectors/packet-e100.c
index 4819528d78..6568ddcdc5 100644
--- a/epan/dissectors/packet-e100.c
+++ b/epan/dissectors/packet-e100.c
@@ -209,7 +209,7 @@ void
proto_reg_handoff_e100(void)
{
/* Check all UDP traffic, as the specific UDP port is configurable */
- heur_dissector_add("udp", dissect_e100, "E100 over UDP", "e100_udp", proto_e100);
+ heur_dissector_add("udp", dissect_e100, "E100 over UDP", "e100_udp", proto_e100, HEURISTIC_ENABLE);
/* e100 traffic encapsulates traffic from the ethernet frame on */
eth_handle = find_dissector("eth");
}
diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c
index 6b5976def0..8a38f7c435 100644
--- a/epan/dissectors/packet-etch.c
+++ b/epan/dissectors/packet-etch.c
@@ -975,7 +975,7 @@ void proto_reg_handoff_etch(void)
/* create dissector handle only once */
if(!etch_prefs_initialized) {
/* add heuristic dissector for tcp */
- heur_dissector_add("tcp", dissect_etch, "Etch over TCP", "etch_tcp", proto_etch);
+ heur_dissector_add("tcp", dissect_etch, "Etch over TCP", "etch_tcp", proto_etch, HEURISTIC_ENABLE);
etch_prefs_initialized = TRUE;
}
diff --git a/epan/dissectors/packet-fcip.c b/epan/dissectors/packet-fcip.c
index c4d31d20c5..3a440b1144 100644
--- a/epan/dissectors/packet-fcip.c
+++ b/epan/dissectors/packet-fcip.c
@@ -648,7 +648,7 @@ proto_reg_handoff_fcip (void)
{
dissector_handle_t fcip_handle;
- heur_dissector_add("tcp", dissect_fcip_heur, "FCIP over TCP", "fcip_tcp", proto_fcip);
+ heur_dissector_add("tcp", dissect_fcip_heur, "FCIP over TCP", "fcip_tcp", proto_fcip, HEURISTIC_ENABLE);
fcip_handle = create_dissector_handle(dissect_fcip_handle, proto_fcip);
dissector_add_for_decode_as("tcp.port", fcip_handle);
diff --git a/epan/dissectors/packet-fcoib.c b/epan/dissectors/packet-fcoib.c
index ef8583c32c..27b0054f20 100644
--- a/epan/dissectors/packet-fcoib.c
+++ b/epan/dissectors/packet-fcoib.c
@@ -415,7 +415,7 @@ proto_reg_handoff_fcoib(void)
static gboolean initialized = FALSE;
if (!initialized) {
- heur_dissector_add("infiniband.payload", dissect_fcoib, "Fibre Channel over Infiniband", "fc_infiniband", proto_fcoib);
+ heur_dissector_add("infiniband.payload", dissect_fcoib, "Fibre Channel over Infiniband", "fc_infiniband", proto_fcoib, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
fc_handle = find_dissector("fc");
diff --git a/epan/dissectors/packet-fix.c b/epan/dissectors/packet-fix.c
index d258d3f31d..f5fededb87 100644
--- a/epan/dissectors/packet-fix.c
+++ b/epan/dissectors/packet-fix.c
@@ -527,7 +527,7 @@ void
proto_reg_handoff_fix(void)
{
/* Let the tcp dissector know that we're interested in traffic */
- heur_dissector_add("tcp", dissect_fix_heur, "FIX over TCP", "fix_tcp", proto_fix);
+ heur_dissector_add("tcp", dissect_fix_heur, "FIX over TCP", "fix_tcp", proto_fix, HEURISTIC_ENABLE);
/* Register a fix handle to "tcp.port" to be able to do 'decode-as' */
dissector_add_for_decode_as("tcp.port", fix_handle);
}
diff --git a/epan/dissectors/packet-fmtp.c b/epan/dissectors/packet-fmtp.c
index 010518092c..b1bbef29ea 100644
--- a/epan/dissectors/packet-fmtp.c
+++ b/epan/dissectors/packet-fmtp.c
@@ -203,7 +203,7 @@ void
proto_reg_handoff_fmtp(void)
{
/* Register as heuristic dissector for TCP */
- heur_dissector_add("tcp", dissect_fmtp, "FMTP over TCP", "fmtp_tcp", proto_fmtp);
+ heur_dissector_add("tcp", dissect_fmtp, "FMTP over TCP", "fmtp_tcp", proto_fmtp, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 10e3609de6..db10250129 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -5558,9 +5558,9 @@ proto_register_giop (void)
void proto_reg_handoff_giop (void) {
data_handle = find_dissector("data");
- heur_dissector_add("tcp", dissect_giop_heur, "GIOP over TCP", "giop_tcp", proto_giop);
+ heur_dissector_add("tcp", dissect_giop_heur, "GIOP over TCP", "giop_tcp", proto_giop, HEURISTIC_ENABLE);
/* Support DIOP (GIOP/UDP) */
- heur_dissector_add("udp", dissect_giop_heur, "DIOP (GIOP/UDP)", "giop_udp", proto_giop);
+ heur_dissector_add("udp", dissect_giop_heur, "DIOP (GIOP/UDP)", "giop_udp", proto_giop, HEURISTIC_ENABLE);
dissector_add_for_decode_as("tcp.port", giop_tcp_handle);
}
diff --git a/epan/dissectors/packet-gmhdr.c b/epan/dissectors/packet-gmhdr.c
index 622705fd1f..cd2bdf4c21 100644
--- a/epan/dissectors/packet-gmhdr.c
+++ b/epan/dissectors/packet-gmhdr.c
@@ -522,9 +522,9 @@ proto_reg_handoff_gmhdr(void)
gmhdr_handle = create_dissector_handle(dissect_gmhdr, proto_gmhdr);
dissector_add_uint("ethertype", ETHERTYPE_GIGAMON, gmhdr_handle);
- heur_dissector_add("eth.trailer", dissect_gmtrailer, "Gigamon Ethernet header", "gmhdr_eth", proto_gmhdr);
+ heur_dissector_add("eth.trailer", dissect_gmtrailer, "Gigamon Ethernet header", "gmhdr_eth", proto_gmhdr, HEURISTIC_ENABLE);
- heur_dissector_add("eth.trailer", dissect_gmtimestamp_trailer, "Gigamon Ethernet trailer", "gmtrailer_eth", proto_gmtrailer);
+ heur_dissector_add("eth.trailer", dissect_gmtimestamp_trailer, "Gigamon Ethernet trailer", "gmtrailer_eth", proto_gmtrailer, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-gvsp.c b/epan/dissectors/packet-gvsp.c
index 261d7cc095..8d08010cf9 100644
--- a/epan/dissectors/packet-gvsp.c
+++ b/epan/dissectors/packet-gvsp.c
@@ -33,8 +33,6 @@
void proto_register_gvsp(void);
void proto_reg_handoff_gvsp(void);
-static gboolean gvsp_enable_heuristic_dissection = TRUE;
-
#define GVSP_MIN_PACKET_SIZE 8
#define GVSP_V2_MIN_PACKET_SIZE 20
@@ -1980,10 +1978,7 @@ void proto_register_gvsp(void)
proto_register_subtree_array(ett, array_length(ett));
gvsp_module = prefs_register_protocol(proto_gvsp, proto_reg_handoff_gvsp);
- prefs_register_bool_preference(gvsp_module, "enable_heuristic",
- "Enable GVSP heuristic dissection",
- "Enable GVSP heuristic dissection (default is enabled)",
- &gvsp_enable_heuristic_dissection);
+ prefs_register_obsolete_preference(gvsp_module, "enable_heuristic");
}
void proto_reg_handoff_gvsp(void)
@@ -1993,10 +1988,9 @@ void proto_reg_handoff_gvsp(void)
if (!initialized) {
gvsp_handle = new_create_dissector_handle((new_dissector_t)dissect_gvsp, proto_gvsp);
dissector_add_for_decode_as("udp.port", gvsp_handle);
- heur_dissector_add("udp", dissect_gvsp_heur, "GigE Vision over UDP", "gvsp_udp", proto_gvsp);
+ heur_dissector_add("udp", dissect_gvsp_heur, "GigE Vision over UDP", "gvsp_udp", proto_gvsp, HEURISTIC_ENABLE);
initialized = TRUE;
}
- heur_dissector_set_enabled("udp", dissect_gvsp_heur, proto_gvsp, gvsp_enable_heuristic_dissection);
}
/*
diff --git a/epan/dissectors/packet-h1.c b/epan/dissectors/packet-h1.c
index 84b3e016f9..fdb9b05dd8 100644
--- a/epan/dissectors/packet-h1.c
+++ b/epan/dissectors/packet-h1.c
@@ -303,9 +303,9 @@ proto_register_h1 (void)
void
proto_reg_handoff_h1(void)
{
- heur_dissector_add("cotp", dissect_h1, "Sinec H1 over COTP", "hi_cotp", proto_h1);
- heur_dissector_add("cotp_is", dissect_h1, "Sinec H1 over COTP (inactive subset)", "hi_cotp_is", proto_h1);
- heur_dissector_add("tcp", dissect_h1, "Sinec H1 over TCP", "hi_tcp", proto_h1);
+ heur_dissector_add("cotp", dissect_h1, "Sinec H1 over COTP", "hi_cotp", proto_h1, HEURISTIC_ENABLE);
+ heur_dissector_add("cotp_is", dissect_h1, "Sinec H1 over COTP (inactive subset)", "hi_cotp_is", proto_h1, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_h1, "Sinec H1 over TCP", "hi_tcp", proto_h1, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-hdcp2.c b/epan/dissectors/packet-hdcp2.c
index 72b04d8ba7..771780e69c 100644
--- a/epan/dissectors/packet-hdcp2.c
+++ b/epan/dissectors/packet-hdcp2.c
@@ -41,8 +41,6 @@ void proto_reg_handoff_hdcp2(void);
static int proto_hdcp2 = -1;
-static gboolean hdcp2_enable_dissector = FALSE;
-
static gint ett_hdcp2 = -1;
static gint ett_hdcp2_cert = -1;
@@ -300,9 +298,7 @@ proto_register_hdcp2(void)
"HDCP2", "hdcp2");
hdcp2_module = prefs_register_protocol(proto_hdcp2, proto_reg_handoff_hdcp2);
- prefs_register_bool_preference(hdcp2_module, "enable", "Enable dissector",
- "Enable heuristic HDCP2 dissector (default is false)",
- &hdcp2_enable_dissector);
+ prefs_register_obsolete_preference(hdcp2_module, "enable");
proto_register_field_array(proto_hdcp2, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -318,12 +314,10 @@ proto_reg_handoff_hdcp2(void)
static gboolean prefs_initialized = FALSE;
if (!prefs_initialized) {
- heur_dissector_add ("tcp", dissect_hdcp2, "HDCP2 over TCP", "hdcp2_tcp", proto_hdcp2);
+ heur_dissector_add ("tcp", dissect_hdcp2, "HDCP2 over TCP", "hdcp2_tcp", proto_hdcp2, HEURISTIC_DISABLE);
prefs_initialized = TRUE;
}
-
- proto_set_decoding(proto_hdcp2, hdcp2_enable_dissector);
}
/*
diff --git a/epan/dissectors/packet-hislip.c b/epan/dissectors/packet-hislip.c
index 72d71be911..bd7721d6e3 100644
--- a/epan/dissectors/packet-hislip.c
+++ b/epan/dissectors/packet-hislip.c
@@ -72,8 +72,6 @@ static gint proto_hislip = -1;
static dissector_handle_t hislip_handle;
-static gboolean hislip_enable_heuristic_dissection = FALSE; /* disabled by default since heuristic is weak */
-
/* Request/Response tracking*/
typedef struct _hislip_transaction_t
@@ -1022,11 +1020,7 @@ proto_register_hislip(void)
"Set the TCP port for HiSLIP traffic if other than the default",
10,
&global_hislip_port);
- prefs_register_bool_preference(hislip_module,
- "enable_heuristic",
- "Enable HiSLIP heuristic dissection",
- "Enable HiSLIP heuristic dissection (default is disabled)",
- &hislip_enable_heuristic_dissection);
+ prefs_register_obsolete_preference(hislip_module, "enable_heuristic");
}
@@ -1039,7 +1033,8 @@ proto_reg_handoff_hislip(void)
if (!initialized)
{
hislip_handle = new_create_dissector_handle(dissect_hislip, proto_hislip);
- heur_dissector_add("tcp", dissect_hislip_heur, "HiSLIP over TCP", "hislip_tcp", proto_hislip);
+ /* disabled by default since heuristic is weak */
+ heur_dissector_add("tcp", dissect_hislip_heur, "HiSLIP over TCP", "hislip_tcp", proto_hislip, HEURISTIC_DISABLE);
initialized = TRUE;
}
else
@@ -1050,8 +1045,6 @@ proto_reg_handoff_hislip(void)
currentPort = global_hislip_port;
dissector_add_uint("tcp.port", currentPort, hislip_handle);
-
- heur_dissector_set_enabled("tcp", dissect_hislip_heur, proto_hislip, hislip_enable_heuristic_dissection);
}
/*
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 48d106dfbc..5ba60c8e02 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -3525,7 +3525,7 @@ proto_reg_handoff_message_http(void)
dissector_add_string("media_type", "message/http", message_http_handle);
- heur_dissector_add("tcp", dissect_http_heur_tcp, "HTTP over TCP", "http_tcp", proto_http);
+ heur_dissector_add("tcp", dissect_http_heur_tcp, "HTTP over TCP", "http_tcp", proto_http, HEURISTIC_ENABLE);
proto_http2 = proto_get_id_by_filter_name("http2");
diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c
index 9b7790af2b..9d38a8167b 100644
--- a/epan/dissectors/packet-http2.c
+++ b/epan/dissectors/packet-http2.c
@@ -151,10 +151,6 @@ static const guint8* st_str_http2_type = "Type";
static int st_node_http2 = -1;
static int st_node_http2_type = -1;
-/* Heuristic dissection */
-static gboolean global_http2_heur = FALSE;
-
-
/* Packet Header */
static int proto_http2 = -1;
static int hf_http2 = -1;
@@ -1438,8 +1434,7 @@ dissect_http2_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
/* we couldn't find the Magic Hello (PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n)
see if there's a valid frame type (0-11 are defined at the moment).
This is weak heuristics, so it is disabled by default. */
- if (!global_http2_heur ||
- tvb_captured_length(tvb)<4 || tvb_get_guint8(tvb, 3)>HTTP2_BLOCKED)
+ if (tvb_captured_length(tvb)<4 || tvb_get_guint8(tvb, 3)>HTTP2_BLOCKED)
return FALSE;
}
@@ -1861,11 +1856,7 @@ proto_register_http2(void)
http2_module = prefs_register_protocol(proto_http2, NULL);
- prefs_register_bool_preference(http2_module, "heuristic_http2",
- "Enable weak HTTP2 detection heuristic",
- "The weak HTTP2 heuristic has some false positives and is disabled by "
- "default. The stronger HTTP2 Magic Hello heuristic is always enabled.",
- &global_http2_heur);
+ prefs_register_obsolete_preference(http2_module, "heuristic_http2");
new_register_dissector("http2", dissect_http2, proto_http2);
@@ -1897,8 +1888,8 @@ proto_reg_handoff_http2(void)
http2_handle = new_create_dissector_handle(dissect_http2, proto_http2);
dissector_add_for_decode_as("tcp.port", http2_handle);
- heur_dissector_add("ssl", dissect_http2_heur, "HTTP2 over SSL", "http2_ssl", proto_http2);
- heur_dissector_add("http", dissect_http2_heur, "HTTP2 over TCP", "http2_tcp", proto_http2);
+ heur_dissector_add("ssl", dissect_http2_heur, "HTTP2 over SSL", "http2_ssl", proto_http2, HEURISTIC_ENABLE);
+ heur_dissector_add("http", dissect_http2_heur, "HTTP2 over TCP", "http2_tcp", proto_http2, HEURISTIC_ENABLE);
stats_tree_register("http2", "http2", "HTTP2", 0, http2_stats_tree_packet, http2_stats_tree_init, NULL);
}
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index 9887a029ca..e89353bdc2 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -1340,8 +1340,8 @@ void proto_reg_handoff_icep(void)
icep_tcp_handle = new_create_dissector_handle(dissect_icep_tcp, proto_icep);
icep_udp_handle = new_create_dissector_handle(dissect_icep_udp, proto_icep);
- heur_dissector_add("tcp", dissect_icep_tcp, "ICEP over TCP", "icep_tcp", proto_icep);
- heur_dissector_add("udp", dissect_icep_udp, "ICEP over UDP", "icep_udp", proto_icep);
+ heur_dissector_add("tcp", dissect_icep_tcp, "ICEP over TCP", "icep_tcp", proto_icep, HEURISTIC_ENABLE);
+ heur_dissector_add("udp", dissect_icep_udp, "ICEP over UDP", "icep_udp", proto_icep, HEURISTIC_ENABLE);
icep_prefs_initialized = TRUE;
}
diff --git a/epan/dissectors/packet-ifcp.c b/epan/dissectors/packet-ifcp.c
index 0a589be99a..902ca39cec 100644
--- a/epan/dissectors/packet-ifcp.c
+++ b/epan/dissectors/packet-ifcp.c
@@ -608,7 +608,7 @@ proto_register_ifcp (void)
void
proto_reg_handoff_ifcp (void)
{
- heur_dissector_add("tcp", dissect_ifcp_heur, "iFCP over TCP", "ifcp_tcp", proto_ifcp);
+ heur_dissector_add("tcp", dissect_ifcp_heur, "iFCP over TCP", "ifcp_tcp", proto_ifcp, HEURISTIC_ENABLE);
ifcp_handle = new_create_dissector_handle(dissect_ifcp_handle, proto_ifcp);
dissector_add_for_decode_as("tcp.port", ifcp_handle);
diff --git a/epan/dissectors/packet-infiniband_sdp.c b/epan/dissectors/packet-infiniband_sdp.c
index 0c9eef9dd7..bca16aefd4 100644
--- a/epan/dissectors/packet-infiniband_sdp.c
+++ b/epan/dissectors/packet-infiniband_sdp.c
@@ -513,8 +513,8 @@ proto_reg_handoff_ib_sdp(void)
static gboolean initialized = FALSE;
if (!initialized) {
- heur_dissector_add("infiniband.payload", dissect_ib_sdp, "Infiniband SDP", "sdp_infiniband", proto_ib_sdp);
- heur_dissector_add("infiniband.mad.cm.private", dissect_ib_sdp, "Infiniband SDP in PrivateData of CM packets", "sdp_ib_private", proto_ib_sdp);
+ heur_dissector_add("infiniband.payload", dissect_ib_sdp, "Infiniband SDP", "sdp_infiniband", proto_ib_sdp, HEURISTIC_ENABLE);
+ heur_dissector_add("infiniband.mad.cm.private", dissect_ib_sdp, "Infiniband SDP in PrivateData of CM packets", "sdp_ib_private", proto_ib_sdp, HEURISTIC_ENABLE);
/* allocate enough space in the addresses to store the largest address (a GID) */
manual_addr_data[0] = wmem_alloc(wmem_epan_scope(), GID_SIZE);
diff --git a/epan/dissectors/packet-interlink.c b/epan/dissectors/packet-interlink.c
index 07dc3522e1..0ec989f42c 100644
--- a/epan/dissectors/packet-interlink.c
+++ b/epan/dissectors/packet-interlink.c
@@ -231,7 +231,7 @@ proto_reg_handoff_interlink(void)
dissector_add_for_decode_as("udp.port", interlink_handle);
/* Add our heuristic packet finder. */
- heur_dissector_add("udp", dissect_interlink_heur, "Interlink over UDP", "interlink_udp", proto_interlink);
+ heur_dissector_add("udp", dissect_interlink_heur, "Interlink over UDP", "interlink_udp", proto_interlink, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index ea0c9f15e5..bb8eb2443f 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -3149,7 +3149,7 @@ proto_reg_handoff_ip(void)
dissector_add_for_decode_as("udp.port", ip_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP4, ip_handle);
- heur_dissector_add("tipc", dissect_ip_heur, "IP over TIPC", "ip_tipc", proto_ip);
+ heur_dissector_add("tipc", dissect_ip_heur, "IP over TIPC", "ip_tipc", proto_ip, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-ipsec-tcp.c b/epan/dissectors/packet-ipsec-tcp.c
index cd670e2143..83458e29c7 100644
--- a/epan/dissectors/packet-ipsec-tcp.c
+++ b/epan/dissectors/packet-ipsec-tcp.c
@@ -248,7 +248,7 @@ proto_reg_handoff_tcpencap(void)
esp_handle = find_dissector("esp");
udp_handle = find_dissector("udp");
- heur_dissector_add("tcp", dissect_tcpencap_heur, "TCP Encapsulation of IPsec Packets", "ipsec_tcp", proto_tcpencap);
+ heur_dissector_add("tcp", dissect_tcpencap_heur, "TCP Encapsulation of IPsec Packets", "ipsec_tcp", proto_tcpencap, HEURISTIC_ENABLE);
initialized = TRUE;
}
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c
index 9cb54c8e1d..96398f0142 100644
--- a/epan/dissectors/packet-iscsi.c
+++ b/epan/dissectors/packet-iscsi.c
@@ -3167,7 +3167,7 @@ proto_register_iscsi(void)
void
proto_reg_handoff_iscsi(void)
{
- heur_dissector_add("tcp", dissect_iscsi_heur, "iSCSI over TCP", "iscsi_tcp", proto_iscsi);
+ heur_dissector_add("tcp", dissect_iscsi_heur, "iSCSI over TCP", "iscsi_tcp", proto_iscsi, HEURISTIC_ENABLE);
iscsi_handle = new_create_dissector_handle(dissect_iscsi_handle, proto_iscsi);
dissector_add_for_decode_as("tcp.port", iscsi_handle);
diff --git a/epan/dissectors/packet-iser.c b/epan/dissectors/packet-iser.c
index c78a1298d8..cb37af4d7d 100644
--- a/epan/dissectors/packet-iser.c
+++ b/epan/dissectors/packet-iser.c
@@ -397,8 +397,8 @@ proto_reg_handoff_iser(void)
if (!initialized) {
new_create_dissector_handle(dissect_iser, proto_iser);
- heur_dissector_add("infiniband.payload", dissect_iser, "iSER Infiniband", "iser_infiniband", proto_iser);
- heur_dissector_add("infiniband.mad.cm.private", dissect_iser, "iSER in PrivateData of CM packets", "iser_ib_private", proto_iser);
+ heur_dissector_add("infiniband.payload", dissect_iser, "iSER Infiniband", "iser_infiniband", proto_iser, HEURISTIC_ENABLE);
+ heur_dissector_add("infiniband.mad.cm.private", dissect_iser, "iSER in PrivateData of CM packets", "iser_ib_private", proto_iser, HEURISTIC_ENABLE);
/* allocate enough space in the addresses to store the largest address (a GID) */
manual_addr_data[0] = wmem_alloc(wmem_epan_scope(), GID_SIZE);
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c
index 5182ee9187..23f3e38f2e 100644
--- a/epan/dissectors/packet-iwarp-mpa.c
+++ b/epan/dissectors/packet-iwarp-mpa.c
@@ -979,7 +979,7 @@ proto_reg_handoff_mpa(void)
* MPA does not use any specific TCP port so, when not on a specific
* port, try this dissector whenever there is TCP traffic.
*/
- heur_dissector_add("tcp", dissect_iwarp_mpa, "IWARP_MPA over TCP", "iwarp_mpa_tcp", proto_iwarp_mpa);
+ heur_dissector_add("tcp", dissect_iwarp_mpa, "IWARP_MPA over TCP", "iwarp_mpa_tcp", proto_iwarp_mpa, HEURISTIC_ENABLE);
ddp_rdmap_handle = find_dissector("iwarp_ddp_rdmap");
}
diff --git a/epan/dissectors/packet-ixiatrailer.c b/epan/dissectors/packet-ixiatrailer.c
index 592a3f8ae5..9b0da982b3 100644
--- a/epan/dissectors/packet-ixiatrailer.c
+++ b/epan/dissectors/packet-ixiatrailer.c
@@ -200,7 +200,7 @@ void
proto_reg_handoff_ixiatrailer(void)
{
/* Check for Ixia format in the ethernet trailer */
- heur_dissector_add("eth.trailer", dissect_ixiatrailer, "Ixia Trailer", "ixiatrailer_eth", proto_ixiatrailer);
+ heur_dissector_add("eth.trailer", dissect_ixiatrailer, "Ixia Trailer", "ixiatrailer_eth", proto_ixiatrailer, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-json.c b/epan/dissectors/packet-json.c
index 0e2b087119..53440e9800 100644
--- a/epan/dissectors/packet-json.c
+++ b/epan/dissectors/packet-json.c
@@ -646,8 +646,8 @@ proto_reg_handoff_json(void)
{
dissector_handle_t json_file_handle = new_create_dissector_handle(dissect_json_file, proto_json);
- heur_dissector_add("hpfeeds", dissect_json_heur, "JSON over HPFEEDS", "json_hpfeeds", proto_json);
- heur_dissector_add("db-lsp", dissect_json_heur, "JSON over DB-LSP", "json_db_lsp", proto_json);
+ heur_dissector_add("hpfeeds", dissect_json_heur, "JSON over HPFEEDS", "json_hpfeeds", proto_json, HEURISTIC_ENABLE);
+ heur_dissector_add("db-lsp", dissect_json_heur, "JSON over DB-LSP", "json_db_lsp", proto_json, HEURISTIC_ENABLE);
dissector_add_uint("wtap_encap", WTAP_ENCAP_JSON, json_file_handle);
dissector_add_string("media_type", "application/json", json_handle); /* RFC 4627 */
diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c
index e4b29b9a12..c5f0e794e5 100644
--- a/epan/dissectors/packet-jxta.c
+++ b/epan/dissectors/packet-jxta.c
@@ -168,9 +168,6 @@ static int uri_address_type = -1;
* global preferences
**/
static gboolean gDESEGMENT = TRUE;
-static gboolean gUDP_HEUR = TRUE;
-static gboolean gTCP_HEUR = TRUE;
-static gboolean gSCTP_HEUR = TRUE;
static gboolean gMSG_MEDIA = TRUE;
/**
@@ -2384,14 +2381,9 @@ void proto_register_jxta(void)
" and enable \"Reassemble fragmented IP datagrams\" in the IP protocol settings.",
&gDESEGMENT);
- prefs_register_bool_preference(jxta_module, "udp.heuristic", "Try to discover JXTA in UDP datagrams",
- "Enable to inspect UDP datagrams for JXTA messages.", &gUDP_HEUR);
-
- prefs_register_bool_preference(jxta_module, "tcp.heuristic", "Try to discover JXTA in TCP connections",
- "Enable to inspect TCP connections for JXTA conversations.", &gTCP_HEUR);
-
- prefs_register_bool_preference(jxta_module, "sctp.heuristic", "Try to discover JXTA in SCTP connections",
- "Enable to inspect SCTP connections for JXTA conversations.", &gSCTP_HEUR);
+ prefs_register_obsolete_preference(jxta_module, "udp.heuristic");
+ prefs_register_obsolete_preference(jxta_module, "tcp.heuristic");
+ prefs_register_obsolete_preference(jxta_module, "sctp.heuristic");
register_conversation_table(proto_jxta, TRUE, jxta_conversation_packet, jxta_hostlist_packet);
}
@@ -2406,9 +2398,6 @@ void proto_reg_handoff_jxta(void)
static dissector_handle_t message_jxta_handle;
static gboolean msg_media_register_done = FALSE;
- static gboolean udp_register_done = FALSE;
- static gboolean tcp_register_done = FALSE;
- static gboolean sctp_register_done = FALSE;
if(!init_done) {
message_jxta_handle = new_create_dissector_handle(dissect_jxta_message, proto_message_jxta);
@@ -2436,47 +2425,14 @@ void proto_reg_handoff_jxta(void)
}
}
- if( gUDP_HEUR ) {
- if( !udp_register_done ) {
- /* g_message( "Registering UDP Heuristic dissector" ); */
- heur_dissector_add("udp", dissect_jxta_UDP_heur, "JXTA over UDP", "jxta_udp", proto_jxta);
- udp_register_done = TRUE;
- }
- } else {
- if( udp_register_done ) {
- /* g_message( "Deregistering UDP Heuristic dissector" ); */
- heur_dissector_delete("udp", dissect_jxta_UDP_heur, proto_jxta);
- udp_register_done = FALSE;
- }
- }
+ /* g_message( "Registering UDP Heuristic dissector" ); */
+ heur_dissector_add("udp", dissect_jxta_UDP_heur, "JXTA over UDP", "jxta_udp", proto_jxta, HEURISTIC_ENABLE);
- if( gTCP_HEUR ) {
- if( !tcp_register_done ) {
- /* g_message( "Registering TCP Heuristic dissector" ); */
- heur_dissector_add("tcp", dissect_jxta_TCP_heur, "JXTA over TCP", "jxta_tcp", proto_jxta);
- tcp_register_done = TRUE;
- }
- } else {
- if( tcp_register_done ) {
- /* g_message( "Deregistering TCP Heuristic dissector" ); */
- heur_dissector_delete("tcp", dissect_jxta_TCP_heur, proto_jxta);
- tcp_register_done = FALSE;
- }
- }
+ /* g_message( "Registering TCP Heuristic dissector" ); */
+ heur_dissector_add("tcp", dissect_jxta_TCP_heur, "JXTA over TCP", "jxta_tcp", proto_jxta, HEURISTIC_ENABLE);
- if( gSCTP_HEUR ) {
- if( !sctp_register_done ) {
- /* g_message( "Registering SCTP Heuristic dissector" ); */
- heur_dissector_add("sctp", dissect_jxta_SCTP_heur, "JXTA over SCTP", "jxta_sctp", proto_jxta);
- sctp_register_done = TRUE;
- }
- } else {
- if( sctp_register_done ) {
- /* g_message( "Deregistering SCTP Heuristic dissector" ); */
- heur_dissector_delete("sctp", dissect_jxta_SCTP_heur, proto_jxta);
- sctp_register_done = FALSE;
- }
- }
+ /* g_message( "Registering SCTP Heuristic dissector" ); */
+ heur_dissector_add("sctp", dissect_jxta_SCTP_heur, "JXTA over SCTP", "jxta_sctp", proto_jxta, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-knxnetip.c b/epan/dissectors/packet-knxnetip.c
index b9a69efdbb..4f6b366644 100644
--- a/epan/dissectors/packet-knxnetip.c
+++ b/epan/dissectors/packet-knxnetip.c
@@ -1865,8 +1865,8 @@ void proto_register_knxnetip (void) {
void proto_reg_handoff_knxnetip(void) {
/* register as heuristic dissector for both TCP and UDP */
- heur_dissector_add("tcp", dissect_knxnetip_heur, "KNXnet/IP over TCP", "knxnetip_tcp", proto_knxnetip);
- heur_dissector_add("udp", dissect_knxnetip_heur, "KNXnet/IP over UDP", "knxnetip_udp", proto_knxnetip);
+ heur_dissector_add("tcp", dissect_knxnetip_heur, "KNXnet/IP over TCP", "knxnetip_tcp", proto_knxnetip, HEURISTIC_ENABLE);
+ heur_dissector_add("udp", dissect_knxnetip_heur, "KNXnet/IP over UDP", "knxnetip_udp", proto_knxnetip, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-lanforge.c b/epan/dissectors/packet-lanforge.c
index 13316f03b3..7641376d13 100644
--- a/epan/dissectors/packet-lanforge.c
+++ b/epan/dissectors/packet-lanforge.c
@@ -280,8 +280,8 @@ void proto_register_lanforge(void)
void proto_reg_handoff_lanforge(void)
{
/* Register as a heuristic UDP dissector */
- heur_dissector_add("udp", dissect_lanforge, "LANforge over UDP", "lanforge_udp", proto_lanforge);
- heur_dissector_add("tcp", dissect_lanforge, "LANforge over TCP", "lanforge_tcp", proto_lanforge);
+ heur_dissector_add("udp", dissect_lanforge, "LANforge over UDP", "lanforge_udp", proto_lanforge, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_lanforge, "LANforge over TCP", "lanforge_tcp", proto_lanforge, HEURISTIC_ENABLE);
/* Find data dissector handle */
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index fdc81315b2..2a5efc5c6d 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -763,7 +763,7 @@ proto_reg_handoff_lapd(void)
dissector_add_uint("wtap_encap", WTAP_ENCAP_LINUX_LAPD, lapd_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_LAPD, lapd_handle);
dissector_add_uint("l2tp.pw_type", L2TPv3_PROTOCOL_LAPD, lapd_handle);
- heur_dissector_add("udp", dissect_udp_lapd, "LAPD over UDP", "lapd_udp", proto_lapd);
+ heur_dissector_add("udp", dissect_udp_lapd, "LAPD over UDP", "lapd_udp", proto_lapd, HEURISTIC_ENABLE);
register_dissector("lapd-bitstream", dissect_lapd_bitstream, proto_lapd);
lapd_bitstream_handle = find_dissector("lapd-bitstream");
diff --git a/epan/dissectors/packet-lbmpdmtcp.c b/epan/dissectors/packet-lbmpdmtcp.c
index be3bd64bd0..1a8ae35e33 100644
--- a/epan/dissectors/packet-lbmpdmtcp.c
+++ b/epan/dissectors/packet-lbmpdmtcp.c
@@ -440,7 +440,7 @@ void proto_reg_handoff_lbmpdm_tcp(void)
{
lbmpdm_tcp_dissector_handle = create_dissector_handle(dissect_lbmpdm_tcp, lbmpdm_tcp_protocol_handle);
dissector_add_for_decode_as("tcp.port", lbmpdm_tcp_dissector_handle);
- heur_dissector_add("tcp", test_lbmpdm_tcp_packet, "LBMPDM over TCP", "lbmpdm_tcp", lbmpdm_tcp_protocol_handle);
+ heur_dissector_add("tcp", test_lbmpdm_tcp_packet, "LBMPDM over TCP", "lbmpdm_tcp", lbmpdm_tcp_protocol_handle, HEURISTIC_ENABLE);
}
/* Make sure the port low is <= the port high. If not, don't change them. */
diff --git a/epan/dissectors/packet-lbmr.c b/epan/dissectors/packet-lbmr.c
index 21617e3b7d..d064c425c4 100644
--- a/epan/dissectors/packet-lbmr.c
+++ b/epan/dissectors/packet-lbmr.c
@@ -6693,7 +6693,7 @@ void proto_reg_handoff_lbmr(void)
{
lbmr_dissector_handle = new_create_dissector_handle(dissect_lbmr, proto_lbmr);
dissector_add_for_decode_as("udp.port", lbmr_dissector_handle);
- heur_dissector_add("udp", test_lbmr_packet, "LBM Topic Resolution over UDP", "lbmr_udp", proto_lbmr);
+ heur_dissector_add("udp", test_lbmr_packet, "LBM Topic Resolution over UDP", "lbmr_udp", proto_lbmr, HEURISTIC_ENABLE);
}
lbmr_mc_incoming_udp_port = global_lbmr_mc_incoming_udp_port;
diff --git a/epan/dissectors/packet-lbtrm.c b/epan/dissectors/packet-lbtrm.c
index 343c9b5842..d8cdf50c3d 100644
--- a/epan/dissectors/packet-lbtrm.c
+++ b/epan/dissectors/packet-lbtrm.c
@@ -1874,7 +1874,7 @@ void proto_reg_handoff_lbtrm(void)
{
lbtrm_dissector_handle = new_create_dissector_handle(dissect_lbtrm, proto_lbtrm);
dissector_add_for_decode_as("udp.port", lbtrm_dissector_handle);
- heur_dissector_add("udp", test_lbtrm_packet, "LBT Reliable Multicast over UDP", "lbtrm_udp", proto_lbtrm);
+ heur_dissector_add("udp", test_lbtrm_packet, "LBT Reliable Multicast over UDP", "lbtrm_udp", proto_lbtrm, HEURISTIC_ENABLE);
lbtrm_tap_handle = register_tap("lbm_lbtrm");
}
diff --git a/epan/dissectors/packet-lbtru.c b/epan/dissectors/packet-lbtru.c
index d99399c5f9..f3988140c0 100644
--- a/epan/dissectors/packet-lbtru.c
+++ b/epan/dissectors/packet-lbtru.c
@@ -2005,7 +2005,7 @@ void proto_reg_handoff_lbtru(void)
{
lbtru_dissector_handle = new_create_dissector_handle(dissect_lbtru, proto_lbtru);
dissector_add_for_decode_as("udp.port", lbtru_dissector_handle);
- heur_dissector_add("udp", test_lbtru_packet, "LBT Reliable Unicast over UDP", "lbtru_udp", proto_lbtru);
+ heur_dissector_add("udp", test_lbtru_packet, "LBT Reliable Unicast over UDP", "lbtru_udp", proto_lbtru, HEURISTIC_ENABLE);
lbtru_tap_handle = register_tap("lbm_lbtru");
}
diff --git a/epan/dissectors/packet-lbttcp.c b/epan/dissectors/packet-lbttcp.c
index 8f5c4ba9ce..ec75c7d06a 100644
--- a/epan/dissectors/packet-lbttcp.c
+++ b/epan/dissectors/packet-lbttcp.c
@@ -803,7 +803,7 @@ void proto_reg_handoff_lbttcp(void)
{
lbttcp_dissector_handle = new_create_dissector_handle(dissect_lbttcp, proto_lbttcp);
dissector_add_for_decode_as("tcp.port", lbttcp_dissector_handle);
- heur_dissector_add("tcp", test_lbttcp_packet, "LBT over TCP", "lbttcp_tcp", proto_lbttcp);
+ heur_dissector_add("tcp", test_lbttcp_packet, "LBT over TCP", "lbttcp_tcp", proto_lbttcp, HEURISTIC_ENABLE);
}
/* Make sure the source port low is <= the source port high. If not, don't change them. */
diff --git a/epan/dissectors/packet-lwm.c b/epan/dissectors/packet-lwm.c
index 24163c2b21..bb66aca422 100644
--- a/epan/dissectors/packet-lwm.c
+++ b/epan/dissectors/packet-lwm.c
@@ -811,7 +811,7 @@ void proto_reg_handoff_lwm(void)
/* Register our dissector with IEEE 802.15.4 */
dissector_add_for_decode_as(IEEE802154_PROTOABBREV_WPAN_PANID, find_dissector("lwm"));
- heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_lwm_heur, "Lightweight Mesh over IEEE 802.15.4", "lwm_wlan", proto_lwm);
+ heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_lwm_heur, "Lightweight Mesh over IEEE 802.15.4", "lwm_wlan", proto_lwm, HEURISTIC_ENABLE);
} /* proto_reg_handoff_lwm */
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 26531dcb37..83600bcf21 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -2015,9 +2015,6 @@ static guint8 get_mac_lte_channel_priority(guint16 ueid _U_, guint8 lcid,
guint8 direction);
-/* Heuristic dissection */
-static gboolean global_mac_lte_heur = FALSE;
-
static void call_with_catch_all(dissector_handle_t handle, tvbuff_t* tvb, packet_info *pinfo, proto_tree *tree)
{
/* Call it (catch exceptions so that stats will be updated) */
@@ -2219,15 +2216,6 @@ static gboolean dissect_mac_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
tvbuff_t *mac_tvb;
gboolean infoAlreadySet = FALSE;
- /* This is a heuristic dissector, which means we get all the UDP
- * traffic not sent to a known dissector and not claimed by
- * a heuristic dissector called before us!
- */
-
- if (!global_mac_lte_heur) {
- return FALSE;
- }
-
/* Do this again on re-dissection to re-discover offset of actual PDU */
/* Needs to be at least as long as:
@@ -7527,11 +7515,7 @@ void proto_register_mac_lte(void)
"Attempt to dissect frames that have failed CRC check",
&global_mac_lte_dissect_crc_failures);
- prefs_register_bool_preference(mac_lte_module, "heuristic_mac_lte_over_udp",
- "Try Heuristic LTE-MAC over UDP framing",
- "When enabled, use heuristic dissector to find MAC-LTE frames sent with "
- "UDP framing",
- &global_mac_lte_heur);
+ prefs_register_obsolete_preference(mac_lte_module, "heuristic_mac_lte_over_udp");
prefs_register_bool_preference(mac_lte_module, "attempt_to_dissect_srb_sdus",
"Attempt to dissect LCID 1&2 as srb1&2",
@@ -7611,7 +7595,7 @@ void proto_register_mac_lte(void)
void proto_reg_handoff_mac_lte(void)
{
/* Add as a heuristic UDP dissector */
- heur_dissector_add("udp", dissect_mac_lte_heur, "MAC-LTE over UDP", "mac_lte_udp", proto_mac_lte);
+ heur_dissector_add("udp", dissect_mac_lte_heur, "MAC-LTE over UDP", "mac_lte_udp", proto_mac_lte, HEURISTIC_DISABLE);
/* Look up RLC dissector handle once and for all */
rlc_lte_handle = find_dissector("rlc-lte");
diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c
index 3e062fe7fa..3a217ddada 100644
--- a/epan/dissectors/packet-mbim.c
+++ b/epan/dissectors/packet-mbim.c
@@ -642,7 +642,6 @@ static dissector_handle_t eth_fcs_handle;
static dissector_handle_t ip_handle;
static dissector_handle_t data_handle;
-static gboolean mbim_bulk_heuristic = TRUE;
static gboolean mbim_control_decode_unknown_itf = FALSE;
enum {
@@ -8004,10 +8003,7 @@ proto_register_mbim(void)
"MBIM DSS Session Id", FT_UINT8, BASE_DEC);
mbim_module = prefs_register_protocol(proto_mbim, proto_reg_handoff_mbim);
- prefs_register_bool_preference(mbim_module, "bulk_heuristic",
- "Try to identify data traffic with heuristic",
- "Try to identify MBIM data packets on \"usb.bulk\" using heuristic",
- &mbim_bulk_heuristic);
+ prefs_register_obsolete_preference(mbim_module, "bulk_heuristic");
prefs_register_bool_preference(mbim_module, "control_decode_unknown_itf",
"Force decoding of unknown USB control data as MBIM",
"Decode control data received on \"usb.control\" with an "
@@ -8034,13 +8030,12 @@ proto_reg_handoff_mbim(void)
eth_fcs_handle = find_dissector("eth_withfcs");
ip_handle = find_dissector("ip");
data_handle = find_dissector("data");
- heur_dissector_add("usb.bulk", dissect_mbim_bulk_heur, "MBIM USB bulk endpoint", "mbim_usb_bulk", proto_mbim);
+ heur_dissector_add("usb.bulk", dissect_mbim_bulk_heur, "MBIM USB bulk endpoint", "mbim_usb_bulk", proto_mbim, HEURISTIC_ENABLE);
dissector_add_for_decode_as("usb.device", mbim_decode_as_handle);
dissector_add_for_decode_as("usb.product", mbim_decode_as_handle);
dissector_add_for_decode_as("usb.protocol", mbim_decode_as_handle);
initialized = TRUE;
}
- heur_dissector_set_enabled("usb.bulk", dissect_mbim_bulk_heur, proto_mbim, mbim_bulk_heuristic);
if (mbim_control_decode_unknown_itf != mbim_control_decode_unknown_itf_prev) {
dissector_handle_t mbim_control_handle = find_dissector("mbim.control");
if (mbim_control_decode_unknown_itf) {
diff --git a/epan/dissectors/packet-mim.c b/epan/dissectors/packet-mim.c
index 684f2b1cc1..7c68cdd1e3 100644
--- a/epan/dissectors/packet-mim.c
+++ b/epan/dissectors/packet-mim.c
@@ -57,16 +57,6 @@ static int hf_ul = -1;
static int hf_ig = -1;
static int hf_ooodl = -1;
-/* Ethernet heuristic dissectors (such as this one) get called for
- * every Ethernet frame Wireshark handles. In order to not impose that
- * performance penalty on everyone this dissector disables itself by
- * default.
- *
- * This is done separately from the disabled protocols list mainly so
- * we can disable it by default. XXX Maybe there's a better way.
- */
-static gboolean mim_enable_dissector = FALSE;
-
static const true_false_string ig_tfs = {
"Group address (multicast/broadcast)",
"Individual address (unicast)"
@@ -366,9 +356,7 @@ proto_register_mim(void)
mim_module = prefs_register_protocol (proto_fp, proto_reg_handoff_fabricpath);
- prefs_register_bool_preference (mim_module, "enable", "Enable dissector",
- "Enable this dissector (default is false)",
- &mim_enable_dissector);
+ prefs_register_obsolete_preference (mim_module, "enable");
proto_register_field_array(proto_fp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -391,12 +379,10 @@ proto_reg_handoff_fabricpath(void)
* get outer source and destination MAC
* before the standard ethernet dissector
*/
- heur_dissector_add ("eth", dissect_fp_heur, "Cisco FabricPath over Ethernet", "fp_eth", proto_fp);
+ heur_dissector_add ("eth", dissect_fp_heur, "Cisco FabricPath over Ethernet", "fp_eth", proto_fp, HEURISTIC_DISABLE);
eth_dissector = find_dissector( "eth" );
prefs_initialized = TRUE;
}
-
- proto_set_decoding(proto_fp, mim_enable_dissector);
}
/*
diff --git a/epan/dissectors/packet-miop.c b/epan/dissectors/packet-miop.c
index cb340b58ac..e5c8e9d949 100644
--- a/epan/dissectors/packet-miop.c
+++ b/epan/dissectors/packet-miop.c
@@ -314,7 +314,7 @@ void proto_reg_handoff_miop (void) {
miop_handle = find_dissector("miop");
dissector_add_for_decode_as("udp.port", miop_handle);
- heur_dissector_add("udp", dissect_miop_heur, "MIOP over UDP", "miop_udp", proto_miop);
+ heur_dissector_add("udp", dissect_miop_heur, "MIOP over UDP", "miop_udp", proto_miop, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-mms.c b/epan/dissectors/packet-mms.c
index b49080f46c..7dce5636ef 100644
--- a/epan/dissectors/packet-mms.c
+++ b/epan/dissectors/packet-mms.c
@@ -10049,7 +10049,7 @@ dissect_mms_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
void proto_reg_handoff_mms(void) {
register_ber_oid_dissector("1.0.9506.2.3", dissect_mms, proto_mms,"MMS");
register_ber_oid_dissector("1.0.9506.2.1", dissect_mms, proto_mms,"mms-abstract-syntax-version1(1)");
- heur_dissector_add("cotp", dissect_mms_heur, "MMS over COTP", "mms_cotp", proto_mms);
- heur_dissector_add("cotp_is", dissect_mms_heur, "MMS over COTP (inactive subset)", "mms_cotp_is", proto_mms);
+ heur_dissector_add("cotp", dissect_mms_heur, "MMS over COTP", "mms_cotp", proto_mms, HEURISTIC_ENABLE);
+ heur_dissector_add("cotp_is", dissect_mms_heur, "MMS over COTP (inactive subset)", "mms_cotp_is", proto_mms, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c
index a638bb7816..adc933fa3a 100644
--- a/epan/dissectors/packet-mmse.c
+++ b/epan/dissectors/packet-mmse.c
@@ -1664,7 +1664,7 @@ proto_reg_handoff_mmse(void)
dissector_handle_t mmse_standalone_handle;
dissector_handle_t mmse_encapsulated_handle;
- heur_dissector_add("wsp", dissect_mmse_heur, "MMS Message Encapsulation over WSP", "mmse_wsp", proto_mmse);
+ heur_dissector_add("wsp", dissect_mmse_heur, "MMS Message Encapsulation over WSP", "mmse_wsp", proto_mmse, HEURISTIC_ENABLE);
mmse_standalone_handle = create_dissector_handle(
dissect_mmse_standalone, proto_mmse);
mmse_encapsulated_handle = create_dissector_handle(
diff --git a/epan/dissectors/packet-mndp.c b/epan/dissectors/packet-mndp.c
index ecae863f3c..c5261ad2ff 100644
--- a/epan/dissectors/packet-mndp.c
+++ b/epan/dissectors/packet-mndp.c
@@ -255,9 +255,8 @@ test_mndp(tvbuff_t *tvb)
return TRUE;
}
-#if 0
static gboolean
-dissect_mndp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+dissect_mndp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
if ( !test_mndp(tvb) ) {
return FALSE;
@@ -265,7 +264,6 @@ dissect_mndp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_mndp(tvb, pinfo, tree);
return TRUE;
}
-#endif
static int
dissect_mndp_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
@@ -362,7 +360,7 @@ proto_reg_handoff_mndp(void)
mndp_handle = new_create_dissector_handle(dissect_mndp_static, proto_mndp);
dissector_add_uint("udp.port", PORT_MNDP, mndp_handle);
- /* heur_dissector_add("udp", dissect_mndp_heur, "MNDP over UDP", "mndp_udp", proto_mndp); */
+ heur_dissector_add("udp", dissect_mndp_heur, "MNDP over UDP", "mndp_udp", proto_mndp, HEURISTIC_DISABLE);
}
/*
diff --git a/epan/dissectors/packet-mojito.c b/epan/dissectors/packet-mojito.c
index c795df74ad..22e7c4b889 100644
--- a/epan/dissectors/packet-mojito.c
+++ b/epan/dissectors/packet-mojito.c
@@ -1045,7 +1045,7 @@ proto_reg_handoff_mojito(void)
if (!initialized) {
mojito_handle = new_create_dissector_handle(dissect_mojito, proto_mojito);
- heur_dissector_add("udp", dissect_mojito_heuristic, "Mojito over UDP", "mojito_udp", proto_mojito);
+ heur_dissector_add("udp", dissect_mojito_heuristic, "Mojito over UDP", "mojito_udp", proto_mojito, HEURISTIC_ENABLE);
initialized = TRUE;
}
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index bad8e4866b..ea51a46639 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -1538,11 +1538,11 @@ proto_register_mp2t(void)
void
proto_reg_handoff_mp2t(void)
{
- heur_dissector_add("udp", heur_dissect_mp2t, "MP2T over UDP", "mp2t_udp", proto_mp2t);
+ heur_dissector_add("udp", heur_dissect_mp2t, "MP2T over UDP", "mp2t_udp", proto_mp2t, HEURISTIC_ENABLE);
dissector_add_uint("rtp.pt", PT_MP2T, mp2t_handle);
dissector_add_for_decode_as("udp.port", mp2t_handle);
- heur_dissector_add("usb.bulk", heur_dissect_mp2t, "MP2T USB bulk endpoint", "mp2t_usb_bulk", proto_mp2t);
+ heur_dissector_add("usb.bulk", heur_dissect_mp2t, "MP2T USB bulk endpoint", "mp2t_usb_bulk", proto_mp2t, HEURISTIC_ENABLE);
dissector_add_uint("wtap_encap", WTAP_ENCAP_MPEG_2_TS, mp2t_handle);
dissector_add_uint("l2tp.pw_type", L2TPv3_PROTOCOL_DOCSIS_DMPT, mp2t_handle);
diff --git a/epan/dissectors/packet-mpeg-audio.c b/epan/dissectors/packet-mpeg-audio.c
index 12ae35e326..30b1b0890d 100644
--- a/epan/dissectors/packet-mpeg-audio.c
+++ b/epan/dissectors/packet-mpeg-audio.c
@@ -688,5 +688,5 @@ proto_register_mpeg_audio(void)
void
proto_reg_handoff_mpeg_audio(void)
{
- heur_dissector_add("mpeg", dissect_mpeg_audio, "MPEG Audio", "mpeg_audio", proto_mpeg_audio);
+ heur_dissector_add("mpeg", dissect_mpeg_audio, "MPEG Audio", "mpeg_audio", proto_mpeg_audio, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c
index d6d7cfd0a3..63f48bffc9 100644
--- a/epan/dissectors/packet-mpeg-pes.c
+++ b/epan/dissectors/packet-mpeg-pes.c
@@ -1331,5 +1331,5 @@ proto_reg_handoff_mpeg_pes(void)
dissector_handle_t mpeg_handle = find_dissector("mpeg");
dissector_add_uint("wtap_encap", WTAP_ENCAP_MPEG, mpeg_handle);
- heur_dissector_add("mpeg", dissect_mpeg_pes, "MPEG PES", "mpeg_pes", proto_mpeg_pes);
+ heur_dissector_add("mpeg", dissect_mpeg_pes, "MPEG PES", "mpeg_pes", proto_mpeg_pes, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-mq-pcf.c b/epan/dissectors/packet-mq-pcf.c
index ae0da66f53..484f2aee4b 100644
--- a/epan/dissectors/packet-mq-pcf.c
+++ b/epan/dissectors/packet-mq-pcf.c
@@ -708,7 +708,7 @@ void proto_register_mqpcf(void)
void proto_reg_handoff_mqpcf(void)
{
- heur_dissector_add("mq", dissect_mqpcf_heur, "WebSphere MQ PCF", "mqpcf_mq", proto_mqpcf);
+ heur_dissector_add("mq", dissect_mqpcf_heur, "WebSphere MQ PCF", "mqpcf_mq", proto_mqpcf, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index 781b20b08b..616fcc8b05 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -4783,9 +4783,9 @@ void proto_reg_handoff_mq(void)
mq_spx_handle = create_dissector_handle(dissect_mq_spx, proto_mq);
dissector_add_for_decode_as("tcp.port", mq_tcp_handle);
- heur_dissector_add("tcp", dissect_mq_heur_tcp, "WebSphere MQ over TCP", "mq_tcp", proto_mq);
- heur_dissector_add("netbios", dissect_mq_heur_netbios, "WebSphere MQ over Netbios", "mq_netbios", proto_mq);
- heur_dissector_add("http", dissect_mq_heur_http, "WebSphere MQ over HTTP", "mq_http", proto_mq);
+ heur_dissector_add("tcp", dissect_mq_heur_tcp, "WebSphere MQ over TCP", "mq_tcp", proto_mq, HEURISTIC_ENABLE);
+ heur_dissector_add("netbios", dissect_mq_heur_netbios, "WebSphere MQ over Netbios", "mq_netbios", proto_mq, HEURISTIC_ENABLE);
+ heur_dissector_add("http", dissect_mq_heur_http, "WebSphere MQ over HTTP", "mq_http", proto_mq, HEURISTIC_ENABLE);
dissector_add_uint("spx.socket", MQ_SOCKET_SPX, mq_spx_handle);
data_handle = find_dissector("data");
mqpcf_handle = find_dissector("mqpcf");
diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c
index bf8723f52b..91fdcfde0a 100644
--- a/epan/dissectors/packet-msrp.c
+++ b/epan/dissectors/packet-msrp.c
@@ -922,7 +922,7 @@ proto_reg_handoff_msrp(void)
{
msrp_handle = find_dissector("msrp");
dissector_add_for_decode_as("tcp.port", msrp_handle); /* for "decode-as" */
- heur_dissector_add("tcp", dissect_msrp_heur, "MSRP over TCP", "msrp_tcp", proto_msrp);
+ heur_dissector_add("tcp", dissect_msrp_heur, "MSRP over TCP", "msrp_tcp", proto_msrp, HEURISTIC_ENABLE);
dissector_add_uint("tcp.port", TCP_PORT_MSRP, msrp_handle);
media_type_dissector_table = find_dissector_table("media_type");
}
diff --git a/epan/dissectors/packet-nbd.c b/epan/dissectors/packet-nbd.c
index 185a572ba0..77c5c81ba1 100644
--- a/epan/dissectors/packet-nbd.c
+++ b/epan/dissectors/packet-nbd.c
@@ -473,7 +473,7 @@ void proto_register_nbd(void)
void
proto_reg_handoff_nbd(void)
{
- heur_dissector_add("tcp", dissect_nbd_tcp_heur, "NBD over TCP", "nbd_tcp", proto_nbd);
+ heur_dissector_add("tcp", dissect_nbd_tcp_heur, "NBD over TCP", "nbd_tcp", proto_nbd, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c
index f4690a5b9d..3423d6b8fa 100644
--- a/epan/dissectors/packet-ndmp.c
+++ b/epan/dissectors/packet-ndmp.c
@@ -4264,7 +4264,7 @@ proto_reg_handoff_ndmp(void)
{
ndmp_handle = new_create_dissector_handle(dissect_ndmp, proto_ndmp);
dissector_add_uint("tcp.port",TCP_PORT_NDMP, ndmp_handle);
- heur_dissector_add("tcp", dissect_ndmp_heur, "NDMP over TCP", "ndmp_tcp", proto_ndmp);
+ heur_dissector_add("tcp", dissect_ndmp_heur, "NDMP over TCP", "ndmp_tcp", proto_ndmp, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index fb4fb8bfda..27643de081 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -3319,7 +3319,7 @@ proto_reg_handoff_ntlmssp(void)
&ntlmssp_seal_fns);
ntlmssp_tap = register_tap("ntlmssp");
- heur_dissector_add("credssp", dissect_ntlmssp_heur, "NTLMSSP over CredSSP", "ntlmssp_credssp", proto_ntlmssp);
+ heur_dissector_add("credssp", dissect_ntlmssp_heur, "NTLMSSP over CredSSP", "ntlmssp_credssp", proto_ntlmssp, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-openflow.c b/epan/dissectors/packet-openflow.c
index 5089b477a8..49a9e50bde 100644
--- a/epan/dissectors/packet-openflow.c
+++ b/epan/dissectors/packet-openflow.c
@@ -39,7 +39,6 @@ void proto_reg_handoff_openflow(void);
#define OFP_LEGACY2_PORT 6634
#define OFP_IANA_PORT 6653
static int g_openflow_port = OFP_IANA_PORT;
-static gboolean openflow_heur_enabled = TRUE;
static dissector_handle_t openflow_handle;
static dissector_handle_t openflow_v1_handle;
@@ -121,10 +120,6 @@ dissect_openflow_heur(tvbuff_t *tvb, packet_info *pinfo,
{
conversation_t *conversation = NULL;
- if (!openflow_heur_enabled) {
- return FALSE;
- }
-
if ((pinfo->destport != OFP_LEGACY_PORT) &&
(pinfo->destport != OFP_LEGACY2_PORT) &&
(pinfo->destport != OFP_IANA_PORT) &&
@@ -179,12 +174,7 @@ proto_register_openflow(void)
10, &g_openflow_port);
/* Register heuristic preference */
- prefs_register_bool_preference(openflow_module, "heuristic",
- "Try to decode OpenFlow on other common ports",
- "Try to decode OpenFlow on several common "
- "ports in addition to the one supplied by "
- "user above (6653 is the IANA assigned port).",
- &openflow_heur_enabled);
+ prefs_register_obsolete_preference(openflow_module, "heuristic");
/* Register desegment preference */
prefs_register_bool_preference(openflow_module, "desegment",
@@ -202,7 +192,7 @@ proto_reg_handoff_openflow(void)
if (!initialized) {
openflow_handle = new_create_dissector_handle(dissect_openflow, proto_openflow);
- heur_dissector_add("tcp", dissect_openflow_heur, "OpenFlow over TCP", "openflow_tcp", proto_openflow);
+ heur_dissector_add("tcp", dissect_openflow_heur, "OpenFlow over TCP", "openflow_tcp", proto_openflow, HEURISTIC_ENABLE);
initialized = TRUE;
} else {
dissector_delete_uint("tcp.port", currentPort, openflow_handle);
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c
index c5404e5db7..7af67cc298 100644
--- a/epan/dissectors/packet-opensafety.c
+++ b/epan/dissectors/packet-opensafety.c
@@ -2805,13 +2805,13 @@ proto_reg_handoff_opensafety(void)
data_dissector = find_dissector ( "data" );
/* EPL & SercosIII dissector registration */
- heur_dissector_add("epl_data", dissect_opensafety_epl, "openSAFETY over EPL", "opensafety_epl_data", proto_opensafety);
- heur_dissector_add("sercosiii", dissect_opensafety_siii, "openSAFETY over SercosIII", "opensafety_sercosiii", proto_opensafety);
+ heur_dissector_add("epl_data", dissect_opensafety_epl, "openSAFETY over EPL", "opensafety_epl_data", proto_opensafety, HEURISTIC_ENABLE);
+ heur_dissector_add("sercosiii", dissect_opensafety_siii, "openSAFETY over SercosIII", "opensafety_sercosiii", proto_opensafety, HEURISTIC_ENABLE);
/* If an openSAFETY UDP transport filter is present, add to its
* heuristic filter list. Otherwise ignore the transport */
if ( find_dissector("opensafety_udp") != NULL )
- heur_dissector_add("opensafety_udp", dissect_opensafety_udpdata, "openSAFETY over UDP", "opensafety_udp", proto_opensafety);
+ heur_dissector_add("opensafety_udp", dissect_opensafety_udpdata, "openSAFETY over UDP", "opensafety_udp", proto_opensafety, HEURISTIC_ENABLE);
/* Modbus TCP dissector registration */
dissector_add_string("modbus.data", "data", find_dissector("opensafety_mbtcp"));
@@ -2822,7 +2822,7 @@ proto_reg_handoff_opensafety(void)
*/
if ( find_dissector("pn_io") != NULL )
{
- heur_dissector_add("pn_io", dissect_opensafety_pn_io, "openSAFETY over Profinet", "opensafety_pn_io", proto_opensafety);
+ heur_dissector_add("pn_io", dissect_opensafety_pn_io, "openSAFETY over Profinet", "opensafety_pn_io", proto_opensafety, HEURISTIC_DISABLE);
}
else
{
diff --git a/epan/dissectors/packet-openwire.c b/epan/dissectors/packet-openwire.c
index 0a413946ea..ecc7e4872f 100644
--- a/epan/dissectors/packet-openwire.c
+++ b/epan/dissectors/packet-openwire.c
@@ -2005,7 +2005,7 @@ proto_register_openwire(void)
void
proto_reg_handoff_openwire(void)
{
- heur_dissector_add("tcp", dissect_openwire_heur, "OpenWire over TCP", "njack_tcp", proto_openwire);
+ heur_dissector_add("tcp", dissect_openwire_heur, "OpenWire over TCP", "openwire_tcp", proto_openwire, HEURISTIC_ENABLE);
openwire_tcp_handle = new_create_dissector_handle(dissect_openwire_tcp, proto_openwire);
dissector_add_for_decode_as("tcp.port", openwire_tcp_handle);
}
diff --git a/epan/dissectors/packet-osc.c b/epan/dissectors/packet-osc.c
index 3b67fb4612..111bb72fa7 100644
--- a/epan/dissectors/packet-osc.c
+++ b/epan/dissectors/packet-osc.c
@@ -907,7 +907,7 @@ proto_reg_handoff_osc(void)
/* (The UDP heuristic is a bit expensive */
osc_udp_handle = new_create_dissector_handle(dissect_osc_udp, proto_osc);
/* register as heuristic dissector for UDP connections */
- heur_dissector_add("udp", dissect_osc_heur_udp, "Open Sound Control over UDP", "osc_udp", proto_osc);
+ heur_dissector_add("udp", dissect_osc_heur_udp, "Open Sound Control over UDP", "osc_udp", proto_osc, HEURISTIC_ENABLE);
initialized = TRUE;
}
diff --git a/epan/dissectors/packet-ouch.c b/epan/dissectors/packet-ouch.c
index 677e3ffc5b..07b201ae58 100644
--- a/epan/dissectors/packet-ouch.c
+++ b/epan/dissectors/packet-ouch.c
@@ -1596,7 +1596,7 @@ void
proto_reg_handoff_ouch(void)
{
ouch_handle = new_create_dissector_handle(dissect_ouch, proto_ouch);
- heur_dissector_add("soupbintcp", dissect_ouch_heur, "OUCH over SoupBinTCP", "ouch_soupbintcp", proto_ouch);
+ heur_dissector_add("soupbintcp", dissect_ouch_heur, "OUCH over SoupBinTCP", "ouch_soupbintcp", proto_ouch, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-paltalk.c b/epan/dissectors/packet-paltalk.c
index 2587eb1eb9..d2cb0d0d5c 100644
--- a/epan/dissectors/packet-paltalk.c
+++ b/epan/dissectors/packet-paltalk.c
@@ -131,7 +131,7 @@ proto_register_paltalk(void)
void
proto_reg_handoff_paltalk(void)
{
- heur_dissector_add("tcp", dissect_paltalk, "Paltalk over TCP", "paltalk_tcp", proto_paltalk);
+ heur_dissector_add("tcp", dissect_paltalk, "Paltalk over TCP", "paltalk_tcp", proto_paltalk, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-pana.c b/epan/dissectors/packet-pana.c
index ac137a84cd..9a26324aea 100644
--- a/epan/dissectors/packet-pana.c
+++ b/epan/dissectors/packet-pana.c
@@ -887,7 +887,7 @@ proto_reg_handoff_pana(void)
dissector_handle_t pana_handle;
- heur_dissector_add("udp", dissect_pana, "PANA over UDP", "pana_udp", proto_pana);
+ heur_dissector_add("udp", dissect_pana, "PANA over UDP", "pana_udp", proto_pana, HEURISTIC_ENABLE);
pana_handle = new_create_dissector_handle(dissect_pana, proto_pana);
dissector_add_for_decode_as("udp.port", pana_handle);
diff --git a/epan/dissectors/packet-pathport.c b/epan/dissectors/packet-pathport.c
index edb75955ce..1907f95875 100644
--- a/epan/dissectors/packet-pathport.c
+++ b/epan/dissectors/packet-pathport.c
@@ -707,7 +707,7 @@ proto_reg_handoff_pathport(void)
static dissector_handle_t pathport_handle;
pathport_handle = new_create_dissector_handle(dissect_pathport, proto_pathport);
- heur_dissector_add("udp", dissect_pathport_heur, "Pathport over UDP", "pathport_udp", proto_pathport);
+ heur_dissector_add("udp", dissect_pathport_heur, "Pathport over UDP", "pathport_udp", proto_pathport, HEURISTIC_ENABLE);
dissector_add_uint("udp.port", PATHPORT_UDP_PORT, pathport_handle);
}
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index d2a6733d90..0621136849 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -1231,9 +1231,6 @@ static dissector_handle_t lookup_rrc_dissector_handle(struct pdcp_lte_info *p_p
/* Forwad declarations */
static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-/* Heuristic dissection */
-static gboolean global_pdcp_lte_heur = FALSE;
-
/* Heuristic dissector looks for supported framing protocol (see wiki page) */
static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, void *data _U_)
@@ -1245,15 +1242,6 @@ static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
gboolean infoAlreadySet = FALSE;
gboolean seqnumLengthTagPresent = FALSE;
- /* This is a heuristic dissector, which means we get all the UDP
- * traffic not sent to a known dissector and not claimed by
- * a heuristic dissector called before us!
- */
-
- if (!global_pdcp_lte_heur) {
- return FALSE;
- }
-
/* Do this again on re-dissection to re-discover offset of actual PDU */
/* Needs to be at least as long as:
@@ -2633,11 +2621,7 @@ void proto_register_pdcp(void)
"Attempt to decode ROHC data",
&global_pdcp_dissect_rohc);
- prefs_register_bool_preference(pdcp_lte_module, "heuristic_pdcp_lte_over_udp",
- "Try Heuristic LTE-PDCP over UDP framing",
- "When enabled, use heuristic dissector to find PDCP-LTE frames sent with "
- "UDP framing",
- &global_pdcp_lte_heur);
+ prefs_register_obsolete_preference(pdcp_lte_module, "heuristic_pdcp_lte_over_udp");
prefs_register_enum_preference(pdcp_lte_module, "layer_to_show",
"Which layer info to show in Info column",
@@ -2699,7 +2683,7 @@ void proto_register_pdcp(void)
void proto_reg_handoff_pdcp_lte(void)
{
/* Add as a heuristic UDP dissector */
- heur_dissector_add("udp", dissect_pdcp_lte_heur, "PDCP-LTE over UDP", "pdcp_lte_udp", proto_pdcp_lte);
+ heur_dissector_add("udp", dissect_pdcp_lte_heur, "PDCP-LTE over UDP", "pdcp_lte_udp", proto_pdcp_lte, HEURISTIC_DISABLE);
ip_handle = find_dissector("ip");
ipv6_handle = find_dissector("ipv6");
diff --git a/epan/dissectors/packet-peekremote.c b/epan/dissectors/packet-peekremote.c
index 6b8777391b..0be19b51da 100644
--- a/epan/dissectors/packet-peekremote.c
+++ b/epan/dissectors/packet-peekremote.c
@@ -693,7 +693,7 @@ proto_reg_handoff_peekremote(void)
peekremote_handle = new_create_dissector_handle(dissect_peekremote_legacy, proto_peekremote);
dissector_add_uint("udp.port", 5000, peekremote_handle);
- heur_dissector_add("udp", dissect_peekremote_new, "OmniPeek Remote over UDP", "peekremote_udp", proto_peekremote);
+ heur_dissector_add("udp", dissect_peekremote_new, "OmniPeek Remote over UDP", "peekremote_udp", proto_peekremote, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-pktgen.c b/epan/dissectors/packet-pktgen.c
index 6db7b27d5c..beeda2b4d6 100644
--- a/epan/dissectors/packet-pktgen.c
+++ b/epan/dissectors/packet-pktgen.c
@@ -187,7 +187,7 @@ void proto_register_pktgen(void)
void proto_reg_handoff_pktgen(void)
{
/* Register as a heuristic UDP dissector */
- heur_dissector_add("udp", dissect_pktgen, "Linux Kernel Packet Generator over UDP", "pktgen_udp", proto_pktgen);
+ heur_dissector_add("udp", dissect_pktgen, "Linux Kernel Packet Generator over UDP", "pktgen_udp", proto_pktgen, HEURISTIC_ENABLE);
/* Find data dissector handle */
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 82d02a8f80..1dd0713dd8 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -5110,7 +5110,7 @@ proto_reg_handoff_ppp_raw_hdlc(void)
ppp_raw_hdlc_handle);
dissector_add_uint("gre.proto", ETHERTYPE_3GPP2, ppp_raw_hdlc_handle);
- heur_dissector_add("usb.bulk", dissect_ppp_usb, "PPP USB bulk endpoint", "ppp_usb_bulk", proto_ppp);
+ heur_dissector_add("usb.bulk", dissect_ppp_usb, "PPP USB bulk endpoint", "ppp_usb_bulk", proto_ppp, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c
index eb6fdee337..88c0e41c1f 100644
--- a/epan/dissectors/packet-pvfs2.c
+++ b/epan/dissectors/packet-pvfs2.c
@@ -3632,7 +3632,7 @@ proto_reg_handoff_pvfs(void)
pvfs_handle = new_create_dissector_handle(dissect_pvfs_heur, proto_pvfs);
dissector_add_uint("tcp.port", TCP_PORT_PVFS2, pvfs_handle);
- heur_dissector_add("tcp", dissect_pvfs_heur, "PVFS over TCP", "pvfs_tcp", proto_pvfs);
+ heur_dissector_add("tcp", dissect_pvfs_heur, "PVFS over TCP", "pvfs_tcp", proto_pvfs, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 47074db6fd..16420ea3d8 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -3916,7 +3916,7 @@ proto_reg_handoff_q931(void)
/*
* For H.323.
*/
- heur_dissector_add("tcp", dissect_q931_tpkt_heur, "Q.931 over TPKT over TCP", "q931_tcp", proto_q931);
+ heur_dissector_add("tcp", dissect_q931_tpkt_heur, "Q.931 over TPKT over TCP", "q931_tcp", proto_q931, HEURISTIC_ENABLE);
}
static void reset_q931_packet_info(q931_packet_info *pi)
diff --git a/epan/dissectors/packet-ranap.c b/epan/dissectors/packet-ranap.c
index e69366ade5..e0f78c1c6b 100644
--- a/epan/dissectors/packet-ranap.c
+++ b/epan/dissectors/packet-ranap.c
@@ -16863,12 +16863,9 @@ proto_reg_handoff_ranap(void)
dissector_add_uint("sccp.ssn", global_ranap_sccp_ssn, ranap_handle);
local_ranap_sccp_ssn = global_ranap_sccp_ssn;
- /* Add heuristic dissector
- * Perhaps we want a preference whether the heuristic dissector
- * is or isn't enabled
- */
- heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap);
- heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap);
+
+ heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap, HEURISTIC_ENABLE);
+ heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c
index ddb6ae5163..936088751a 100644
--- a/epan/dissectors/packet-redbackli.c
+++ b/epan/dissectors/packet-redbackli.c
@@ -291,7 +291,7 @@ void proto_reg_handoff_redbackli(void) {
redbackli_handle = find_dissector("redbackli");
dissector_add_for_decode_as("udp.port", redbackli_handle);
- heur_dissector_add("udp", redbackli_dissect_heur, "Redback Lawful Intercept over UDP", "redbackli_udp", proto_redbackli);
+ heur_dissector_add("udp", redbackli_dissect_heur, "Redback Lawful Intercept over UDP", "redbackli_udp", proto_redbackli, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-reload-framing.c b/epan/dissectors/packet-reload-framing.c
index b7a7883358..36c3f2563c 100644
--- a/epan/dissectors/packet-reload-framing.c
+++ b/epan/dissectors/packet-reload-framing.c
@@ -599,9 +599,9 @@ proto_reg_handoff_reload_framing(void)
dissector_add_uint("tcp.port", TCP_PORT_RELOAD, reload_framing_tcp_handle);
dissector_add_uint("udp.port", UDP_PORT_RELOAD, reload_framing_udp_handle);
- heur_dissector_add("udp", dissect_reload_framing_heur, "RELOAD Framing over UDP", "reload_framing_udp", proto_reload_framing);
- heur_dissector_add("tcp", dissect_reload_framing_heur, "RELOAD Framing over TCP", "reload_framing_tcp", proto_reload_framing);
- heur_dissector_add("dtls", dissect_reload_framing_heur_dtls, "RELOAD Framing over DTLS", "reload_framing_dtls", proto_reload_framing);
+ heur_dissector_add("udp", dissect_reload_framing_heur, "RELOAD Framing over UDP", "reload_framing_udp", proto_reload_framing, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_reload_framing_heur, "RELOAD Framing over TCP", "reload_framing_tcp", proto_reload_framing, HEURISTIC_ENABLE);
+ heur_dissector_add("dtls", dissect_reload_framing_heur_dtls, "RELOAD Framing over DTLS", "reload_framing_dtls", proto_reload_framing, HEURISTIC_ENABLE);
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
}
diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c
index a8cd81de45..3978502137 100644
--- a/epan/dissectors/packet-reload.c
+++ b/epan/dissectors/packet-reload.c
@@ -5947,8 +5947,8 @@ proto_reg_handoff_reload(void)
data_handle = find_dissector("data");
xml_handle = find_dissector("xml");
- heur_dissector_add("udp", dissect_reload_heur, "RELOAD over UDP", "reload_udp", proto_reload);
- heur_dissector_add("tcp", dissect_reload_heur, "RELOAD over TCP", "reload_tcp", proto_reload);
+ heur_dissector_add("udp", dissect_reload_heur, "RELOAD over UDP", "reload_udp", proto_reload, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_reload_heur, "RELOAD over TCP", "reload_tcp", proto_reload, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c
index 3071ff347f..309bb14eb4 100644
--- a/epan/dissectors/packet-rlc-lte.c
+++ b/epan/dissectors/packet-rlc-lte.c
@@ -80,9 +80,6 @@ static gboolean global_rlc_lte_call_ip_for_mtch = FALSE;
/* Preference to expect RLC headers without payloads */
static gboolean global_rlc_lte_headers_expected = FALSE;
-/* Heuristic dissection */
-static gboolean global_rlc_lte_heur = FALSE;
-
/* Re-assembly of segments */
static gboolean global_rlc_lte_reassembly = TRUE;
@@ -2700,15 +2697,6 @@ static gboolean dissect_rlc_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
gboolean infoAlreadySet = FALSE;
gboolean umSeqNumLengthTagPresent = FALSE;
- /* This is a heuristic dissector, which means we get all the UDP
- * traffic not sent to a known dissector and not claimed by
- * a heuristic dissector called before us!
- */
-
- if (!global_rlc_lte_heur) {
- return FALSE;
- }
-
/* Do this again on re-dissection to re-discover offset of actual PDU */
/* Needs to be at least as long as:
@@ -3577,11 +3565,7 @@ void proto_register_rlc_lte(void)
"only be called for complete PDUs (i.e. not segmented over RLC)",
&global_rlc_lte_call_ip_for_mtch);
- prefs_register_bool_preference(rlc_lte_module, "heuristic_rlc_lte_over_udp",
- "Try Heuristic LTE-RLC over UDP framing",
- "When enabled, use heuristic dissector to find RLC-LTE frames sent with "
- "UDP framing",
- &global_rlc_lte_heur);
+ prefs_register_obsolete_preference(rlc_lte_module, "heuristic_rlc_lte_over_udp");
prefs_register_bool_preference(rlc_lte_module, "header_only_mode",
"May see RLC headers only",
@@ -3606,7 +3590,7 @@ void proto_register_rlc_lte(void)
void proto_reg_handoff_rlc_lte(void)
{
/* Add as a heuristic UDP dissector */
- heur_dissector_add("udp", dissect_rlc_lte_heur, "RLC-LTE over UDP", "rlc_lte_udp", proto_rlc_lte);
+ heur_dissector_add("udp", dissect_rlc_lte_heur, "RLC-LTE over UDP", "rlc_lte_udp", proto_rlc_lte, HEURISTIC_DISABLE);
pdcp_lte_handle = find_dissector("pdcp-lte");
ip_handle = find_dissector("ip");
diff --git a/epan/dissectors/packet-rlc.c b/epan/dissectors/packet-rlc.c
index 741623a17e..ddc7780255 100644
--- a/epan/dissectors/packet-rlc.c
+++ b/epan/dissectors/packet-rlc.c
@@ -60,10 +60,6 @@ static gboolean global_rlc_perform_reassemby = TRUE;
/* Preference to expect RLC headers without payloads */
static gboolean global_rlc_headers_expected = FALSE;
-
-/* Heuristic dissection */
-static gboolean global_rlc_heur = FALSE;
-
/* Preference to expect ciphered data */
static gboolean global_rlc_ciphered = FALSE;
@@ -2578,14 +2574,6 @@ dissect_rlc_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
proto_item *ti = NULL;
proto_tree *subtree = NULL;
- /* This is a heuristic dissector, which means we get all the UDP
- * traffic not sent to a known dissector and not claimed by
- * a heuristic dissector called before us!
- */
- if (!global_rlc_heur) {
- return FALSE;
- }
-
/* Do this again on re-dissection to re-discover offset of actual PDU */
/* Needs to be at least as long as:
@@ -2955,11 +2943,7 @@ proto_register_rlc(void)
/* Preferences */
rlc_module = prefs_register_protocol(proto_rlc, NULL);
- prefs_register_bool_preference(rlc_module, "heuristic_rlc_over_udp",
- "Try Heuristic RLC over UDP framing",
- "When enabled, use heuristic dissector to find RLC frames sent with "
- "UDP framing",
- &global_rlc_heur);
+ prefs_register_obsolete_preference(rlc_module, "heuristic_rlc_over_udp");
prefs_register_bool_preference(rlc_module, "perform_reassembly",
"Try to reassemble SDUs",
@@ -3003,7 +2987,7 @@ proto_reg_handoff_rlc(void)
ip_handle = find_dissector("ip");
bmc_handle = find_dissector("bmc");
/* Add as a heuristic UDP dissector */
- heur_dissector_add("udp", dissect_rlc_heur, "RLC over UDP", "rlc_udp", proto_rlc);
+ heur_dissector_add("udp", dissect_rlc_heur, "RLC over UDP", "rlc_udp", proto_rlc, HEURISTIC_DISABLE);
}
/*
diff --git a/epan/dissectors/packet-rlm.c b/epan/dissectors/packet-rlm.c
index 7f86a3c667..32eb183050 100644
--- a/epan/dissectors/packet-rlm.c
+++ b/epan/dissectors/packet-rlm.c
@@ -151,7 +151,7 @@ dissect_rlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
void
proto_reg_handoff_rlm(void)
{
- heur_dissector_add("udp", dissect_rlm, "Redundant Link Management over UDP", "rlm_udp", proto_rlm);
+ heur_dissector_add("udp", dissect_rlm, "Redundant Link Management over UDP", "rlm_udp", proto_rlm, HEURISTIC_ENABLE);
}
void
diff --git a/epan/dissectors/packet-rmt-norm.c b/epan/dissectors/packet-rmt-norm.c
index 91efc97b7a..980b1e48c3 100644
--- a/epan/dissectors/packet-rmt-norm.c
+++ b/epan/dissectors/packet-rmt-norm.c
@@ -132,8 +132,6 @@ static const value_string string_norm_nack_form[] =
#define hdrlen2bytes(x) ((x)*4U)
-static gboolean global_norm_heur = FALSE;
-
typedef struct norm_packet_data
{
guint8 encoding_id;
@@ -654,8 +652,6 @@ dissect_norm_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
{
guint8 byte1;
- if (!global_norm_heur)
- return FALSE;
if (tvb_reported_length(tvb) < 12)
return FALSE; /* not enough to check */
byte1 = tvb_get_guint8(tvb, 0);
@@ -972,10 +968,7 @@ void proto_register_norm(void)
/* Register preferences */
module = prefs_register_protocol(proto_rmt_norm, NULL);
- prefs_register_bool_preference(module, "heuristic_norm",
- "Try to decode UDP packets as NORM packets",
- "Check this to decode NORM traffic between clients",
- &global_norm_heur);
+ prefs_register_obsolete_preference(module, "heuristic_norm");
}
void proto_reg_handoff_norm(void)
@@ -984,7 +977,7 @@ void proto_reg_handoff_norm(void)
handle = new_create_dissector_handle(dissect_norm, proto_rmt_norm);
dissector_add_for_decode_as("udp.port", handle);
- heur_dissector_add("udp", dissect_norm_heur, "NORM over UDP", "rmt_norm_udp", proto_rmt_norm);
+ heur_dissector_add("udp", dissect_norm_heur, "NORM over UDP", "rmt_norm_udp", proto_rmt_norm, HEURISTIC_DISABLE);
rmt_fec_handle = find_dissector("rmt-fec");
}
diff --git a/epan/dissectors/packet-rnsap.c b/epan/dissectors/packet-rnsap.c
index 64b4772cdb..b9fc200dde 100644
--- a/epan/dissectors/packet-rnsap.c
+++ b/epan/dissectors/packet-rnsap.c
@@ -55371,11 +55371,8 @@ proto_reg_handoff_rnsap(void)
rrc_dl_dcch_handle = find_dissector("rrc.dl.dcch");
dissector_add_uint("sccp.ssn", SCCP_SSN_RNSAP, rnsap_handle);
- /* Add heuristic dissector
- * Perhaps we want a preference whether the heuristic dissector
- * is or isn't enabled
- */
- /*heur_dissector_add("sccp", dissect_sccp_rnsap_heur, "RNSAP over SCCP", "ranap_sccp", proto_rnsap); */
+ /* Add heuristic dissector */
+ /*heur_dissector_add("sccp", dissect_sccp_rnsap_heur, "RNSAP over SCCP", "ranap_sccp", proto_rnsap, HEURISTIC_DISABLE); */
/*--- Included file: packet-rnsap-dis-tab.c ---*/
@@ -56174,7 +56171,7 @@ proto_reg_handoff_rnsap(void)
/*--- End of included file: packet-rnsap-dis-tab.c ---*/
-#line 190 "../../asn1/rnsap/packet-rnsap-template.c"
+#line 187 "../../asn1/rnsap/packet-rnsap-template.c"
}
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index 32d872138f..5d18e23230 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -4149,8 +4149,8 @@ proto_reg_handoff_rpc(void)
rpc_handle = find_dissector("rpc");
dissector_add_uint("udp.port", 111, rpc_handle);
- heur_dissector_add("tcp", dissect_rpc_tcp_heur, "RPC over TCP", "rpc_tcp", proto_rpc);
- heur_dissector_add("udp", dissect_rpc_heur, "RPC over UDP", "rpc_udp", proto_rpc);
+ heur_dissector_add("tcp", dissect_rpc_tcp_heur, "RPC over TCP", "rpc_tcp", proto_rpc, HEURISTIC_ENABLE);
+ heur_dissector_add("udp", dissect_rpc_heur, "RPC over UDP", "rpc_udp", proto_rpc, HEURISTIC_ENABLE);
gssapi_handle = find_dissector("gssapi");
spnego_krb5_wrap_handle = find_dissector("spnego-krb5-wrap");
data_handle = find_dissector("data");
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c
index 148ded4007..46a2e62c8b 100644
--- a/epan/dissectors/packet-rpcap.c
+++ b/epan/dissectors/packet-rpcap.c
@@ -1468,8 +1468,8 @@ proto_reg_handoff_rpcap (void)
data_handle = find_dissector ("data");
rpcap_prefs_initialized = TRUE;
- heur_dissector_add ("tcp", dissect_rpcap_heur_tcp, "RPCAP over TCP", "rpcap_tcp", proto_rpcap);
- heur_dissector_add ("udp", dissect_rpcap_heur_udp, "RPCAP over UDP", "rpcap_udp", proto_rpcap);
+ heur_dissector_add ("tcp", dissect_rpcap_heur_tcp, "RPCAP over TCP", "rpcap_tcp", proto_rpcap, HEURISTIC_ENABLE);
+ heur_dissector_add ("udp", dissect_rpcap_heur_udp, "RPCAP over UDP", "rpcap_udp", proto_rpcap, HEURISTIC_ENABLE);
}
info_added = FALSE;
diff --git a/epan/dissectors/packet-rpcrdma.c b/epan/dissectors/packet-rpcrdma.c
index 5d1e26544a..1704b43125 100644
--- a/epan/dissectors/packet-rpcrdma.c
+++ b/epan/dissectors/packet-rpcrdma.c
@@ -591,8 +591,8 @@ proto_reg_handoff_rpcordma(void)
if (!initialized) {
rpcordma_handler = new_create_dissector_handle(dissect_rpcordma, proto_rpcordma);
- heur_dissector_add("infiniband.payload", dissect_rpcordma_heur, "Infiniband RPC over RDMA", "rpcordma_infiniband", proto_rpcordma);
- heur_dissector_add("infiniband.mad.cm.private", dissect_rpcordma_heur, "RPC over RDMA in PrivateData of CM packets", "rpcordma_ib_private", proto_rpcordma);
+ heur_dissector_add("infiniband.payload", dissect_rpcordma_heur, "Infiniband RPC over RDMA", "rpcordma_infiniband", proto_rpcordma, HEURISTIC_ENABLE);
+ heur_dissector_add("infiniband.mad.cm.private", dissect_rpcordma_heur, "RPC over RDMA in PrivateData of CM packets", "rpcordma_ib_private", proto_rpcordma, HEURISTIC_ENABLE);
/* allocate enough space in the addresses to store the largest address (a GID) */
manual_addr_data[0] = wmem_alloc(wmem_epan_scope(), GID_SIZE);
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index ab07249ec9..6681ff6dd8 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -697,9 +697,6 @@ static expert_field ei_rtcp_roundtrip_delay_negative = EI_INIT;
static void dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree );
-/* Heuristic dissection */
-static gboolean global_rtcp_heur = FALSE;
-
/* Displaying set info */
static gboolean global_rtcp_show_setup_info = TRUE;
static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
@@ -802,16 +799,6 @@ dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
unsigned int first_byte;
unsigned int packet_type;
- /* This is a heuristic dissector, which means we get all the UDP
- * traffic not sent to a known dissector and not claimed by
- * a heuristic dissector called before us!
- */
-
- if (!global_rtcp_heur)
- {
- return FALSE;
- }
-
/* Look at first byte */
first_byte = tvb_get_guint8(tvb, offset);
@@ -6502,11 +6489,7 @@ proto_register_rtcp(void)
"this RTCP stream to be created",
&global_rtcp_show_setup_info);
- prefs_register_bool_preference(rtcp_module, "heuristic_rtcp",
- "Try to decode RTCP outside of conversations",
- "If call control SIP/H.323/RTSP/.. messages are missing in the trace, "
- "RTCP isn't decoded without this",
- &global_rtcp_heur);
+ prefs_register_obsolete_preference(rtcp_module, "heuristic_rtcp");
prefs_register_bool_preference(rtcp_module, "show_roundtrip_calculation",
"Show relative roundtrip calculations",
@@ -6537,8 +6520,8 @@ proto_reg_handoff_rtcp(void)
dissector_add_for_decode_as("udp.port", rtcp_handle);
dissector_add_for_decode_as("flip.payload", rtcp_handle );
- heur_dissector_add( "udp", dissect_rtcp_heur_udp, "RTCP over UDP", "rtcp_udp", proto_rtcp);
- heur_dissector_add("stun", dissect_rtcp_heur, "RTCP over TURN", "rtcp_stun", proto_rtcp);
+ heur_dissector_add( "udp", dissect_rtcp_heur_udp, "RTCP over UDP", "rtcp_udp", proto_rtcp, HEURISTIC_ENABLE);
+ heur_dissector_add("stun", dissect_rtcp_heur, "RTCP over TURN", "rtcp_stun", proto_rtcp, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c
index ea58ee934f..e17b539919 100644
--- a/epan/dissectors/packet-rtmpt.c
+++ b/epan/dissectors/packet-rtmpt.c
@@ -2431,7 +2431,6 @@ dissect_rtmpt_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
-#if 0
static gboolean
dissect_rtmpt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
@@ -2456,13 +2455,12 @@ dissect_rtmpt_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
conversation_set_dissector(conversation, rtmpt_tcp_handle);
/* Dissect the packet */
- dissect_rtmpt_tcp(tvb, pinfo, tree);
+ dissect_rtmpt_tcp(tvb, pinfo, tree, data);
return TRUE;
}
}
return FALSE;
}
-#endif
static void
dissect_amf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
@@ -2933,7 +2931,7 @@ proto_reg_handoff_rtmpt(void)
{
dissector_handle_t amf_handle;
-/* heur_dissector_add("tcp", dissect_rtmpt_heur, "RTMPT over TCP", "rtmpt_tcp", proto_rtmpt); */
+ heur_dissector_add("tcp", dissect_rtmpt_heur, "RTMPT over TCP", "rtmpt_tcp", proto_rtmpt, HEURISTIC_DISABLE);
rtmpt_tcp_handle = new_create_dissector_handle(dissect_rtmpt_tcp, proto_rtmpt);
/* dissector_add_for_decode_as("tcp.port", rtmpt_tcp_handle); */
dissector_add_uint("tcp.port", RTMP_PORT, rtmpt_tcp_handle);
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index e01fb26040..fbdbd56128 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -306,9 +306,6 @@ static void get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info);
/* Preferences bool to control whether or not setup info should be shown */
static gboolean global_rtp_show_setup_info = TRUE;
-/* Try heuristic RTP decode */
-static gboolean global_rtp_heur = FALSE;
-
/* desegment RTP streams */
static gboolean desegment_rtp = TRUE;
@@ -1335,14 +1332,6 @@ dissect_rtp_heur_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
unsigned int version;
unsigned int offset = 0;
- /* This is a heuristic dissector, which means we get all the UDP
- * traffic not sent to a known dissector and not claimed by
- * a heuristic dissector called before us!
- */
-
- if (! global_rtp_heur)
- return FALSE;
-
/* Get the fields in the first octet */
octet1 = tvb_get_guint8( tvb, offset );
version = RTP_VERSION( octet1 );
@@ -3701,11 +3690,7 @@ proto_register_rtp(void)
"this RTP stream to be created",
&global_rtp_show_setup_info);
- prefs_register_bool_preference(rtp_module, "heuristic_rtp",
- "Try to decode RTP outside of conversations",
- "If call control SIP/H323/RTSP/.. messages are missing in the trace, "
- "RTP isn't decoded without this",
- &global_rtp_heur);
+ prefs_register_obsolete_preference(rtp_module, "heuristic_rtp");
prefs_register_bool_preference(rtp_module, "desegment_rtp_streams",
"Allow subdissector to reassemble RTP streams",
@@ -3745,8 +3730,8 @@ proto_reg_handoff_rtp(void)
dissector_add_for_decode_as("udp.port", rtp_handle);
dissector_add_string("rtp_dyn_payload_type", "red", rtp_rfc2198_handle);
- heur_dissector_add( "udp", dissect_rtp_heur_udp, "RTP over UDP", "rtp_udp", proto_rtp);
- heur_dissector_add("stun", dissect_rtp_heur_stun, "RTP over TURN", "rtp_stun", proto_rtp);
+ heur_dissector_add( "udp", dissect_rtp_heur_udp, "RTP over UDP", "rtp_udp", proto_rtp, HEURISTIC_DISABLE);
+ heur_dissector_add("stun", dissect_rtp_heur_stun, "RTP over TURN", "rtp_stun", proto_rtp, HEURISTIC_DISABLE);
rtp_hdr_ext_ed137_handle = find_dissector("rtp.ext.ed137");
rtp_hdr_ext_ed137a_handle = find_dissector("rtp.ext.ed137a");
diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c
index 1524f8ebde..cc555c47bd 100644
--- a/epan/dissectors/packet-rtps.c
+++ b/epan/dissectors/packet-rtps.c
@@ -9035,8 +9035,8 @@ void proto_register_rtps(void) {
void proto_reg_handoff_rtps(void) {
- heur_dissector_add("udp", dissect_rtps_udp, "RTPS over UDP", "rtps_udp", proto_rtps);
- heur_dissector_add("tcp", dissect_rtps_tcp, "RTPS over TCP", "rtps_tcp", proto_rtps);
+ heur_dissector_add("udp", dissect_rtps_udp, "RTPS over UDP", "rtps_udp", proto_rtps, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_rtps_tcp, "RTPS over TCP", "rtps_tcp", proto_rtps, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-s7comm.c b/epan/dissectors/packet-s7comm.c
index a52787b69b..5d039fa648 100644
--- a/epan/dissectors/packet-s7comm.c
+++ b/epan/dissectors/packet-s7comm.c
@@ -3457,7 +3457,7 @@ void
proto_reg_handoff_s7comm(void)
{
/* register ourself as an heuristic cotp (ISO 8073) payload dissector */
- heur_dissector_add("cotp", dissect_s7comm, "S7 Communication over COTP", "s7comm_cotp", proto_s7comm);
+ heur_dissector_add("cotp", dissect_s7comm, "S7 Communication over COTP", "s7comm_cotp", proto_s7comm, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c
index bbe90b8047..e82e8e75ef 100644
--- a/epan/dissectors/packet-ses.c
+++ b/epan/dissectors/packet-ses.c
@@ -1916,8 +1916,8 @@ proto_reg_handoff_ses(void)
/* add our session dissector to cotp dissector list
* and cotp_is dissector list*/
- heur_dissector_add("cotp", dissect_ses_heur, "SES over COTP", "ses_cotp", proto_ses);
- heur_dissector_add("cotp_is", dissect_ses_heur, "SES over COTP (inactive subset)", "ses_cotp_is", proto_ses);
+ heur_dissector_add("cotp", dissect_ses_heur, "SES over COTP", "ses_cotp", proto_ses, HEURISTIC_ENABLE);
+ heur_dissector_add("cotp_is", dissect_ses_heur, "SES over COTP (inactive subset)", "ses_cotp_is", proto_ses, HEURISTIC_ENABLE);
}
@@ -1931,7 +1931,7 @@ void
proto_reg_handoff_clses(void)
{
/* add our session dissector to cltp dissector list */
- heur_dissector_add("cltp", dissect_ses_heur, "CLSP over COTP", "clses_cotp", proto_clses);
+ heur_dissector_add("cltp", dissect_ses_heur, "CLSP over COTP", "clses_cotp", proto_clses, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index c7f70b460f..28d0bfd050 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -6131,10 +6131,10 @@ proto_reg_handoff_sip(void)
dissector_add_uint("udp.port", UDP_PORT_SIP, sip_handle);
dissector_add_string("media_type", "message/sip", sip_handle);
- heur_dissector_add("udp", dissect_sip_heur, "SIP over UDP", "sip_udp", proto_sip);
- heur_dissector_add("tcp", dissect_sip_tcp_heur, "SIP over TCP", "sip_tcp", proto_sip);
- heur_dissector_add("sctp", dissect_sip_heur, "SIP over SCTP", "sip_sctp", proto_sip);
- heur_dissector_add("stun", dissect_sip_heur, "SIP over TURN", "sip_stun", proto_sip);
+ heur_dissector_add("udp", dissect_sip_heur, "SIP over UDP", "sip_udp", proto_sip, HEURISTIC_ENABLE);
+ heur_dissector_add("tcp", dissect_sip_tcp_heur, "SIP over TCP", "sip_tcp", proto_sip, HEURISTIC_ENABLE);
+ heur_dissector_add("sctp", dissect_sip_heur, "SIP over SCTP", "sip_sctp", proto_sip, HEURISTIC_ENABLE);
+ heur_dissector_add("stun", dissect_sip_heur, "SIP over TURN", "sip_stun", proto_sip, HEURISTIC_ENABLE);
sip_prefs_initialized = TRUE;
} else {
dissector_delete_uint_range("tcp.port", sip_tcp_port_range, sip_tcp_handle);
diff --git a/epan/dissectors/packet-skype.c b/epan/dissectors/packet-skype.c
index 3c65b09c9d..f75c969fb3 100644
--- a/epan/dissectors/packet-skype.c
+++ b/epan/dissectors/packet-skype.c
@@ -287,7 +287,6 @@ dissect_skype_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return offset;
}
-#if SKYPE_HEUR
static gboolean
test_skype_udp(tvbuff_t *tvb)
{
@@ -321,7 +320,6 @@ dissect_skype_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
}
return TRUE;
}
-#endif
static int
dissect_skype_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
@@ -448,11 +446,9 @@ proto_reg_handoff_skype(void)
skype_handle = new_create_dissector_handle(dissect_skype_static, proto_skype);
dissector_add_for_decode_as("tcp.port", skype_handle);
dissector_add_for_decode_as("udp.port", skype_handle);
-#if SKYPE_HEUR
- heur_dissector_add("tcp", dissect_skype_heur, "Skype over TCP", "sip_tcp", proto_skype);
- heur_dissector_add("udp", dissect_skype_heur, "Skype over UDP", "sip_udp", proto_skype);
-#endif
+ heur_dissector_add("tcp", dissect_skype_heur, "Skype over TCP", "skype_tcp", proto_skype, HEURISTIC_DISABLE);
+ heur_dissector_add("udp", dissect_skype_heur, "Skype over UDP", "skype_udp", proto_skype, HEURISTIC_DISABLE);
}
/*
diff --git a/epan/dissectors/packet-smb-direct.c b/epan/dissectors/packet-smb-direct.c
index a6e51840df..9f6122c47e 100644
--- a/epan/dissectors/packet-smb-direct.c
+++ b/epan/dissectors/packet-smb-direct.c
@@ -703,11 +703,11 @@ proto_reg_handoff_smb_direct(void)
heur_dissector_add("iwarp_ddp_rdmap",
dissect_smb_direct_iwarp_heur,
"SMB Direct over iWARP", "smb_direct_iwarp",
- proto_smb_direct);
+ proto_smb_direct, HEURISTIC_ENABLE);
heur_dissector_add("infiniband.payload",
dissect_smb_direct_infiniband_heur,
"SMB Direct Infiniband", "smb_direct_infiniband",
- proto_smb_direct);
+ proto_smb_direct, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 69d9e71180..6e4cd4256a 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -20530,10 +20530,10 @@ proto_reg_handoff_smb(void)
gssapi_handle = find_dissector("gssapi");
ntlmssp_handle = find_dissector("ntlmssp");
- heur_dissector_add("netbios", dissect_smb_heur, "SMB over Netbios", "smb_netbios", proto_smb);
- heur_dissector_add("smb_direct", dissect_smb_heur, "SMB over SMB Direct", "smb_smb_direct", proto_smb);
- heur_dissector_add("cotp", dissect_smb_heur, "SMB over COTP", "smb_cotp", proto_smb);
- heur_dissector_add("vines_spp", dissect_smb_heur, "SMB over Vines", "smb_vines", proto_smb);
+ heur_dissector_add("netbios", dissect_smb_heur, "SMB over Netbios", "smb_netbios", proto_smb, HEURISTIC_ENABLE);
+ heur_dissector_add("smb_direct", dissect_smb_heur, "SMB over SMB Direct", "smb_smb_direct", proto_smb, HEURISTIC_ENABLE);
+ heur_dissector_add("cotp", dissect_smb_heur, "SMB over COTP", "smb_cotp", proto_smb, HEURISTIC_ENABLE);
+ heur_dissector_add("vines_spp", dissect_smb_heur, "SMB over Vines", "smb_vines", proto_smb, HEURISTIC_ENABLE);
smb_handle = find_dissector("smb");
dissector_add_uint("ipx.socket", IPX_SOCKET_NWLINK_SMB_SERVER, smb_handle);
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index 52d397170f..4f478ce528 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -9085,8 +9085,8 @@ proto_reg_handoff_smb2(void)
gssapi_handle = find_dissector("gssapi");
ntlmssp_handle = find_dissector("ntlmssp");
rsvd_handle = find_dissector("rsvd");
- heur_dissector_add("netbios", dissect_smb2_heur, "SMB2 over Netbios", "smb2_netbios", proto_smb2);
- heur_dissector_add("smb_direct", dissect_smb2_heur, "SMB2 over SMB Direct", "smb2_smb_direct", proto_smb2);
+ heur_dissector_add("netbios", dissect_smb2_heur, "SMB2 over Netbios", "smb2_netbios", proto_smb2, HEURISTIC_ENABLE);
+ heur_dissector_add("smb_direct", dissect_smb2_heur, "SMB2 over SMB Direct", "smb2_smb_direct", proto_smb2, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-smcr.c b/epan/dissectors/packet-smcr.c
index 27ad5d1616..533c56df45 100644
--- a/epan/dissectors/packet-smcr.c
+++ b/epan/dissectors/packet-smcr.c
@@ -1425,8 +1425,8 @@ proto_register_smcr(void)
void
proto_reg_handoff_smcr(void)
{
- heur_dissector_add("tcp", dissect_smcr_tcp_heur, "Shared Memory Communications over TCP", "smcr_tcp", proto_smcr);
- heur_dissector_add("infiniband.payload", dissect_smcr_infiniband_heur, "Shared Memory Communications Infiniband", "smcr_infiniband", proto_smcr);
+ heur_dissector_add("tcp", dissect_smcr_tcp_heur, "Shared Memory Communications over TCP", "smcr_tcp", proto_smcr, HEURISTIC_ENABLE);
+ heur_dissector_add("infiniband.payload", dissect_smcr_infiniband_heur, "Shared Memory Communications Infiniband", "smcr_infiniband", proto_smcr, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c
index 34578ec533..31b61a3e54 100644
--- a/epan/dissectors/packet-smpp.c
+++ b/epan/dissectors/packet-smpp.c
@@ -3797,8 +3797,8 @@ proto_reg_handoff_smpp(void)
*/
smpp_handle = find_dissector("smpp");
dissector_add_for_decode_as("tcp.port", smpp_handle);
- heur_dissector_add("tcp", dissect_smpp_heur, "SMPP over TCP", "smpp_tcp", proto_smpp);
- heur_dissector_add("x.25", dissect_smpp_heur, "SMPP over X.25", "smpp_x25", proto_smpp);
+ heur_dissector_add("tcp", dissect_smpp_heur, "SMPP over TCP", "smpp_tcp", proto_smpp, HEURISTIC_ENABLE);
+ heur_dissector_add("x.25", dissect_smpp_heur, "SMPP over X.25", "smpp_x25", proto_smpp, HEURISTIC_ENABLE);
/* Required for call_dissector() */
DebugLog(("Finding gsm_sms_ud subdissector\n"));
diff --git a/epan/dissectors/packet-spdy.c b/epan/dissectors/packet-spdy.c
index 26e008c6f8..f75cd0e067 100644
--- a/epan/dissectors/packet-spdy.c
+++ b/epan/dissectors/packet-spdy.c
@@ -1655,7 +1655,6 @@ static int dissect_spdy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
return tvb_captured_length(tvb);
}
-#if 0 /* heuristic too weak */
/*
* Looks for SPDY frame at tvb start.
* If not enough data for either, requests more via desegment struct.
@@ -1685,7 +1684,6 @@ gboolean dissect_spdy_heur(tvbuff_t *tvb,
return FALSE;
}
-#endif
/*
* Performs plugin registration.
@@ -1949,9 +1947,8 @@ void proto_reg_handoff_spdy(void) {
port_subdissector_table = find_dissector_table("http.port");
media_type_subdissector_table = find_dissector_table("media_type");
-#if 0 /* heuristic too weak */
- heur_dissector_add("tcp", dissect_spdy_heur, "SPDY over TCP", "spdy_tcp", proto_spdy);
-#endif
+ /* Weak heuristic, so disabled by default */
+ heur_dissector_add("tcp", dissect_spdy_heur, "SPDY over TCP", "spdy_tcp", proto_spdy, HEURISTIC_DISABLE);
}
/*
diff --git a/epan/dissectors/packet-spice.c b/epan/dissectors/packet-spice.c
index 64bc36fedd..d1a9b5a97c 100644
--- a/epan/dissectors/packet-spice.c
+++ b/epan/dissectors/packet-spice.c
@@ -4575,7 +4575,7 @@ proto_reg_handoff_spice(void)
{
spice_handle = new_create_dissector_handle(dissect_spice, proto_spice);
dissector_add_for_decode_as("tcp.port", spice_handle);
- heur_dissector_add("tcp", test_spice_protocol, "Spice over TCP", "spice_tcp", proto_spice);
+ heur_dissector_add("tcp", test_spice_protocol, "Spice over TCP", "spice_tcp", proto_spice, HEURISTIC_ENABLE);
jpeg_handle = find_dissector("image-jfif");
}
diff --git a/epan/dissectors/packet-sprt.c b/epan/dissectors/packet-sprt.c
index e87fc1d921..62e0caf43c 100644
--- a/epan/dissectors/packet-sprt.c
+++ b/epan/dissectors/packet-sprt.c
@@ -3431,7 +3431,7 @@ proto_reg_handoff_sprt(void)
sprt_handle = find_dissector("sprt");
dissector_add_for_decode_as("udp.port", sprt_handle);
- heur_dissector_add( "udp", dissect_sprt_heur, "SPRT over UDP", "sprt_udp", proto_sprt);
+ heur_dissector_add( "udp", dissect_sprt_heur, "SPRT over UDP", "sprt_udp", proto_sprt, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-starteam.c b/epan/dissectors/packet-starteam.c
index 74ba6a0308..bb4d0646e7 100644
--- a/epan/dissectors/packet-starteam.c
+++ b/epan/dissectors/packet-starteam.c
@@ -707,7 +707,7 @@ proto_register_starteam(void)
void
proto_reg_handoff_starteam(void)
{
- heur_dissector_add("tcp", dissect_starteam_heur, "StarTeam over TCP", "starteam_tcp", proto_starteam);
+ heur_dissector_add("tcp", dissect_starteam_heur, "StarTeam over TCP", "starteam_tcp", proto_starteam, HEURISTIC_ENABLE);
starteam_tcp_handle = new_create_dissector_handle(dissect_starteam_tcp, proto_starteam);
}
diff --git a/epan/dissectors/packet-stt.c b/epan/dissectors/packet-stt.c
index 0fcf3ff471..7addfce1cf 100644
--- a/epan/dissectors/packet-stt.c
+++ b/epan/dissectors/packet-stt.c
@@ -990,7 +990,7 @@ proto_reg_handoff_stt(void)
eth_handle = find_dissector("eth");
data_handle = find_dissector("data");
- heur_dissector_add("ip", dissect_stt_heur, "Stateless Transport Tunneling over IP", "stt_ip", proto_stt);
+ heur_dissector_add("ip", dissect_stt_heur, "Stateless Transport Tunneling over IP", "stt_ip", proto_stt, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c
index 6c47b9e741..8ed7db9241 100644
--- a/epan/dissectors/packet-stun.c
+++ b/epan/dissectors/packet-stun.c
@@ -1688,7 +1688,7 @@ proto_reg_handoff_stun(void)
dissector_add_for_decode_as("tcp.port", stun_tcp_handle);
dissector_add_for_decode_as("udp.port", stun_udp_handle);
- heur_dissector_add("udp", dissect_stun_heur, "STUN over UDP", "stun_udp", proto_stun);
+ heur_dissector_add("udp", dissect_stun_heur, "STUN over UDP", "stun_udp", proto_stun, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-t124.c b/epan/dissectors/packet-t124.c
index f464efad59..d70375455e 100644
--- a/epan/dissectors/packet-t124.c
+++ b/epan/dissectors/packet-t124.c
@@ -4034,6 +4034,6 @@ proto_reg_handoff_t124(void) {
register_ber_oid_dissector("0.0.20.124.0.1", dissect_t124, proto_t124, "Generic Conference Control");
- heur_dissector_add("t125", dissect_t124_heur, "T.124 over T.125", "t124_t125", proto_t124);
+ heur_dissector_add("t125", dissect_t124_heur, "T.124 over T.125", "t124_t125", proto_t124, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-t125.c b/epan/dissectors/packet-t125.c
index 250cd6c071..584d5e4f10 100644
--- a/epan/dissectors/packet-t125.c
+++ b/epan/dissectors/packet-t125.c
@@ -593,6 +593,6 @@ void proto_register_t125(void) {
/*--- proto_reg_handoff_t125 ---------------------------------------*/
void proto_reg_handoff_t125(void) {
- heur_dissector_add("cotp", dissect_t125_heur, "T.125 over COTP", "t125_cotp", proto_t125);
- heur_dissector_add("cotp_is", dissect_t125_heur, "T.125 over COTP (inactive subset)", "t125_cotp_is", proto_t125);
+ heur_dissector_add("cotp", dissect_t125_heur, "T.125 over COTP", "t125_cotp", proto_t125, HEURISTIC_ENABLE);
+ heur_dissector_add("cotp_is", dissect_t125_heur, "T.125 over COTP (inactive subset)", "t125_cotp_is", proto_t125, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-tali.c b/epan/dissectors/packet-tali.c
index 6b91c8299b..b8c9e2bd84 100644
--- a/epan/dissectors/packet-tali.c
+++ b/epan/dissectors/packet-tali.c
@@ -223,7 +223,7 @@ proto_register_tali(void)
void
proto_reg_handoff_tali(void)
{
- heur_dissector_add("tcp", dissect_tali_heur, "Tali over TCP", "tali_tcp", hfi_tali->id);
+ heur_dissector_add("tcp", dissect_tali_heur, "Tali over TCP", "tali_tcp", hfi_tali->id, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-tapa.c b/epan/dissectors/packet-tapa.c
index ca9f80c340..6b271b3ab7 100644
--- a/epan/dissectors/packet-tapa.c
+++ b/epan/dissectors/packet-tapa.c
@@ -627,7 +627,7 @@ proto_reg_handoff_tapa(void)
tapa_handle = find_dissector("tapa");
dissector_add_uint("udp.port", PORT_TAPA, tapa_handle);
- heur_dissector_add( "ip", dissect_tapa_heur, "TAPA over IP", "tapa_ip", proto_tapa);
+ heur_dissector_add( "ip", dissect_tapa_heur, "TAPA over IP", "tapa_ip", proto_tapa, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index 8189f60519..f62aba044e 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -3270,7 +3270,7 @@ proto_reg_handoff_tds(void)
dissector_add_uint("tcp.port", 1433, tds_tcp_handle);
dissector_add_uint("tcp.port", 2433, tds_tcp_handle);
- heur_dissector_add("tcp", dissect_tds_tcp_heur, "Tabular Data Stream over TCP", "tds_tcp", proto_tds);
+ heur_dissector_add("tcp", dissect_tds_tcp_heur, "Tabular Data Stream over TCP", "tds_tcp", proto_tds, HEURISTIC_ENABLE);
ntlmssp_handle = find_dissector("ntlmssp");
gssapi_handle = find_dissector("gssapi");
diff --git a/epan/dissectors/packet-teredo.c b/epan/dissectors/packet-teredo.c
index 657e811ded..091a38bb76 100644
--- a/epan/dissectors/packet-teredo.c
+++ b/epan/dissectors/packet-teredo.c
@@ -72,9 +72,6 @@ static dissector_table_t teredo_dissector_table;
/*static heur_dissector_list_t heur_subdissector_list;*/
static dissector_handle_t data_handle;
-static gboolean global_teredo_heur = FALSE;
-
-
static int
parse_teredo_auth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, e_teredohdr *teredoh)
@@ -257,9 +254,6 @@ dissect_teredo_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
guint16 val;
int offset = 0;
- if (!global_teredo_heur)
- return FALSE;
-
if (tvb_captured_length_remaining(tvb, offset) < 40)
return FALSE;
@@ -397,11 +391,7 @@ proto_register_teredo(void)
teredo_module = prefs_register_protocol(proto_teredo, NULL);
- prefs_register_bool_preference(teredo_module, "heuristic_teredo",
- "Try to decode UDP packets as Teredo IPv6",
- "Check this to decode IPv6 traffic between Teredo clients and "
- "relays",
- &global_teredo_heur);
+ prefs_register_obsolete_preference(teredo_module, "heuristic_teredo");
}
@@ -415,7 +405,7 @@ proto_reg_handoff_teredo(void)
teredo_tap = register_tap("teredo");
dissector_add_uint("udp.port", UDP_PORT_TEREDO, teredo_handle);
- heur_dissector_add("udp", dissect_teredo_heur, "Teredo over UDP", "teredo_udp", proto_teredo);
+ heur_dissector_add("udp", dissect_teredo_heur, "Teredo over UDP", "teredo_udp", proto_teredo, HEURISTIC_DISABLE);
}
/*
diff --git a/epan/dissectors/packet-tfp.c b/epan/dissectors/packet-tfp.c
index 14c9c65607..66c5b0ce65 100644
--- a/epan/dissectors/packet-tfp.c
+++ b/epan/dissectors/packet-tfp.c
@@ -413,7 +413,7 @@ proto_reg_handoff_tfp(void) {
tfp_handle_tcp = create_dissector_handle(dissect_tfp_tcp, proto_tfp);
dissector_add_uint("tcp.port", tfp_PORT, tfp_handle_tcp);
- heur_dissector_add("usb.bulk", dissect_tfp_bulk_heur, "Tinkerforge USB bulk endpoint", "tfp_usb_bulk", proto_tfp);
+ heur_dissector_add("usb.bulk", dissect_tfp_bulk_heur, "Tinkerforge USB bulk endpoint", "tfp_usb_bulk", proto_tfp, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-tftp.c b/epan/dissectors/packet-tftp.c
index 67b66fbb4a..feb3205916 100644
--- a/epan/dissectors/packet-tftp.c
+++ b/epan/dissectors/packet-tftp.c
@@ -683,7 +683,7 @@ proto_reg_handoff_tftp(void)
if (!tftp_initialized) {
tftp_handle = find_dissector("tftp");
data_handle = find_dissector("data");
- heur_dissector_add("stun", dissect_embeddedtftp_heur, "TFTP over TURN", "tftp_stun", proto_tftp);
+ heur_dissector_add("stun", dissect_embeddedtftp_heur, "TFTP over TURN", "tftp_stun", proto_tftp, HEURISTIC_ENABLE);
tftp_initialized = TRUE;
} else {
dissector_delete_uint_range("udp.port", tftp_port_range, tftp_handle);
diff --git a/epan/dissectors/packet-thrift.c b/epan/dissectors/packet-thrift.c
index 28463f29ee..b25ed61fae 100644
--- a/epan/dissectors/packet-thrift.c
+++ b/epan/dissectors/packet-thrift.c
@@ -439,7 +439,7 @@ void proto_register_thrift(void) {
void proto_reg_handoff_thrift(void) {
- heur_dissector_add("tcp", dissect_thrift_heur, "Thrift over TCP", "thrift_tcp", proto_thrift);
+ heur_dissector_add("tcp", dissect_thrift_heur, "Thrift over TCP", "thrift_tcp", proto_thrift, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-tte.c b/epan/dissectors/packet-tte.c
index 7656637f96..92839649ea 100644
--- a/epan/dissectors/packet-tte.c
+++ b/epan/dissectors/packet-tte.c
@@ -191,7 +191,7 @@ proto_register_tte(void)
void
proto_reg_handoff_tte(void)
{
- heur_dissector_add("eth", dissect_tte, "TTEthernet", "tte_eth", proto_tte);
+ heur_dissector_add("eth", dissect_tte, "TTEthernet", "tte_eth", proto_tte, HEURISTIC_ENABLE);
hf_eth_dst = proto_registrar_get_id_byname ("eth.dst");
hf_eth_src = proto_registrar_get_id_byname ("eth.src");
diff --git a/epan/dissectors/packet-turnchannel.c b/epan/dissectors/packet-turnchannel.c
index 1fecf9ed86..92cc7ea425 100644
--- a/epan/dissectors/packet-turnchannel.c
+++ b/epan/dissectors/packet-turnchannel.c
@@ -213,7 +213,7 @@ proto_reg_handoff_turnchannel(void)
/* TURN negotiation is handled through STUN2 dissector (packet-stun.c),
so only it should be able to determine if a packet is a TURN packet */
- heur_dissector_add("stun", dissect_turnchannel_heur, "TURN Channel over STUN", "turnchannel_stun", proto_turnchannel);
+ heur_dissector_add("stun", dissect_turnchannel_heur, "TURN Channel over STUN", "turnchannel_stun", proto_turnchannel, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
}
diff --git a/epan/dissectors/packet-tuxedo.c b/epan/dissectors/packet-tuxedo.c
index b3da7038fe..641f469231 100644
--- a/epan/dissectors/packet-tuxedo.c
+++ b/epan/dissectors/packet-tuxedo.c
@@ -186,7 +186,7 @@ proto_reg_handoff_tuxedo(void)
{
tuxedo_handle = create_dissector_handle(dissect_tuxedo, proto_tuxedo);
dissector_add_for_decode_as("tcp.port", tuxedo_handle);
- heur_dissector_add("tcp", dissect_tuxedo_heur, "Tuxedo over TCP", "tuxedo_tcp", proto_tuxedo);
+ heur_dissector_add("tcp", dissect_tuxedo_heur, "Tuxedo over TCP", "tuxedo_tcp", proto_tuxedo, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c
index 39de62c600..47a211900f 100644
--- a/epan/dissectors/packet-ucp.c
+++ b/epan/dissectors/packet-ucp.c
@@ -2822,7 +2822,7 @@ proto_reg_handoff_ucp(void)
* UCP can be spoken on any port so, when not on a specific port, try heuristic
* whenever TCP is spoken.
*/
- heur_dissector_add("tcp", dissect_ucp_heur, "UCP over TCP", "ucp_tcp", proto_ucp);
+ heur_dissector_add("tcp", dissect_ucp_heur, "UCP over TCP", "ucp_tcp", proto_ucp, HEURISTIC_ENABLE);
/*
* Also register as a dissector that can be selected by a TCP port number via "decode as".
diff --git a/epan/dissectors/packet-udt.c b/epan/dissectors/packet-udt.c
index 6a14be9b9f..d629aaed6e 100644
--- a/epan/dissectors/packet-udt.c
+++ b/epan/dissectors/packet-udt.c
@@ -453,7 +453,7 @@ void proto_reg_handoff_udt(void)
data_handle = find_dissector("data");
udt_handle = new_create_dissector_handle(dissect_udt, proto_udt);
- heur_dissector_add("udp", dissect_udt_heur, "UDT over UDP", "udt_udp", proto_udt);
+ heur_dissector_add("udp", dissect_udt_heur, "UDT over UDP", "udt_udp", proto_udt, HEURISTIC_ENABLE);
dissector_add_for_decode_as("udp.port", udt_handle);
}
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c
index ad185464c1..95e6329ce9 100644
--- a/epan/dissectors/packet-umts_fp.c
+++ b/epan/dissectors/packet-umts_fp.c
@@ -251,7 +251,6 @@ static gboolean preferences_call_mac_dissectors = TRUE;
static gboolean preferences_show_release_info = TRUE;
static gboolean preferences_payload_checksum = TRUE;
static gboolean preferences_header_checksum = TRUE;
-static gboolean preferences_udp_do_heur = FALSE;
#define UMTS_FP_USE_UAT 1
@@ -3760,10 +3759,6 @@ heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
{
struct fp_info *p_fp_info;
- if (!preferences_udp_do_heur) {
- return FALSE;
- }
-
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
/* if no FP info is present, this might be FP in a pcap(ng) file */
@@ -5609,10 +5604,7 @@ void proto_register_fp(void)
"Validate FP header checksums",
&preferences_header_checksum);
/* Determines whether or not to validate FP header checksums */
- prefs_register_bool_preference(fp_module, "udp_heur",
- "Enable UDP heur dissector",
- "Enable UDP heur dissector",
- &preferences_udp_do_heur);
+ prefs_register_obsolete_preference(fp_module, "udp_heur");
#ifdef UMTS_FP_USE_UAT
umts_fp_uat = uat_new("Endpoint and Channel Configuration",
@@ -5653,7 +5645,7 @@ void proto_reg_handoff_fp(void)
mac_fdd_hsdsch_handle = find_dissector("mac.fdd.hsdsch");
fp_handle = find_dissector("fp");
- heur_dissector_add("udp", heur_dissect_fp, "FP over UDP", "fp_udp", proto_fp);
+ heur_dissector_add("udp", heur_dissect_fp, "FP over UDP", "fp_udp", proto_fp, HEURISTIC_DISABLE);
dissector_add_uint("atm.aal2.type", TRAF_UMTS_FP, fp_handle);
}
diff --git a/epan/dissectors/packet-usb-masstorage.c b/epan/dissectors/packet-usb-masstorage.c
index c221a4f314..48acac126f 100644
--- a/epan/dissectors/packet-usb-masstorage.c
+++ b/epan/dissectors/packet-usb-masstorage.c
@@ -466,7 +466,7 @@ proto_reg_handoff_usb_ms(void)
usb_ms_control_handle = new_create_dissector_handle(dissect_usb_ms_control, proto_usb_ms);
dissector_add_uint("usb.control", IF_CLASS_MASS_STORAGE, usb_ms_control_handle);
- heur_dissector_add("usb.bulk", dissect_usb_ms_bulk_heur, "Mass Storage USB bulk endpoint", "ms_usb_bulk", proto_usb_ms);
+ heur_dissector_add("usb.bulk", dissect_usb_ms_bulk_heur, "Mass Storage USB bulk endpoint", "ms_usb_bulk", proto_usb_ms, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-vnc.c b/epan/dissectors/packet-vnc.c
index d3398e46b0..19cba28696 100644
--- a/epan/dissectors/packet-vnc.c
+++ b/epan/dissectors/packet-vnc.c
@@ -4788,7 +4788,7 @@ proto_reg_handoff_vnc(void)
dissector_add_uint("tcp.port", 5900, vnc_handle);
dissector_add_uint("tcp.port", 5901, vnc_handle);
- heur_dissector_add("tcp", test_vnc_protocol, "VNC over TCP", "vnc_tcp", proto_vnc);
+ heur_dissector_add("tcp", test_vnc_protocol, "VNC over TCP", "vnc_tcp", proto_vnc, HEURISTIC_ENABLE);
/* We don't register a port for the VNC HTTP server because
* that simply provides a java program for download via the
* HTTP protocol. The java program then connects to a standard
diff --git a/epan/dissectors/packet-vssmonitoring.c b/epan/dissectors/packet-vssmonitoring.c
index 1ac887c4da..ecb719bce0 100644
--- a/epan/dissectors/packet-vssmonitoring.c
+++ b/epan/dissectors/packet-vssmonitoring.c
@@ -57,8 +57,6 @@ static int hf_vssmonitoring_srcport = -1;
static gint ett_vssmonitoring = -1;
-static gboolean vssmonitoring_use_heuristics = TRUE;
-
static int
dissect_vssmonitoring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
@@ -124,9 +122,6 @@ dissect_vssmonitoring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
vssmonitoring_clksrc = (guint8)(((guint32)vssmonitoring_time.nsecs) >> CLKSRC_SHIFT);
vssmonitoring_time.nsecs &= VSS_NS_MASK;
- /* There are only heuristics for timestamps, the port stamp can be any value */
- if ( vssmonitoring_use_heuristics ) {
-
/* The timestamp will be based on the uptime until the TAP is completely booted,
* this takes about 60s, but use 1 hour to be sure
*/
@@ -155,7 +150,6 @@ dissect_vssmonitoring(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
*/
if ( vssmonitoring_time.nsecs >= 1000000000 )
return 0;
- }
}
/* All systems are go, lets dissect the VSS-Monitoring trailer */
@@ -233,17 +227,13 @@ proto_register_vssmonitoring(void)
vssmonitoring_module = prefs_register_protocol(proto_vssmonitoring, NULL);
- prefs_register_bool_preference(vssmonitoring_module, "use_heuristics",
- "Use heuristics to verify if trailer contains VSS-Monitoring data",
- "When enabled, Wireshark will do a check on the trailer data to verify"
- "whether it contains VSS-Monitoring time- and port-stamps.",
- &vssmonitoring_use_heuristics);
+ prefs_register_obsolete_preference(vssmonitoring_module, "use_heuristics");
}
void
proto_reg_handoff_vssmonitoring(void)
{
- heur_dissector_add("eth.trailer", dissect_vssmonitoring, "VSS-Monitoring ethernet trailer", "vssmonitoring_eth", proto_vssmonitoring);
+ heur_dissector_add("eth.trailer", dissect_vssmonitoring, "VSS-Monitoring ethernet trailer", "vssmonitoring_eth", proto_vssmonitoring, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-wassp.c b/epan/dissectors/packet-wassp.c
index 16a15019de..f9fe3ea7f8 100644
--- a/epan/dissectors/packet-wassp.c
+++ b/epan/dissectors/packet-wassp.c
@@ -984,7 +984,6 @@ test_wassp(tvbuff_t *tvb)
return TRUE;
}
-#if 0
static gboolean
dissect_wassp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
@@ -994,7 +993,6 @@ dissect_wassp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
dissect_wassp(tvb, pinfo, tree);
return TRUE;
}
-#endif
static int
dissect_wassp_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
@@ -2102,9 +2100,8 @@ proto_reg_handoff_wassp(void)
dissector_add_uint("udp.port", PORT_WASSP_DISCOVER, wassp_handle);
dissector_add_uint("udp.port", PORT_WASSP_TUNNEL, wassp_handle);
/* dissector_add_uint("udp.port", PORT_WASSP_PEER, wassp_handle); */
-#if 0
- heur_dissector_add("udp", dissect_wassp_heur, "WASSP over UDP", "wassp_udp", proto_wassp);
-#endif
+
+ heur_dissector_add("udp", dissect_wassp_heur, "WASSP over UDP", "wassp_udp", proto_wassp, HEURISTIC_DISABLE);
snmp_handle = find_dissector("snmp");
ieee80211_handle = find_dissector("wlan_withoutfcs");
diff --git a/epan/dissectors/packet-waveagent.c b/epan/dissectors/packet-waveagent.c
index 7a9aee0a0c..d2ba4eb38e 100644
--- a/epan/dissectors/packet-waveagent.c
+++ b/epan/dissectors/packet-waveagent.c
@@ -1905,7 +1905,7 @@ void proto_register_waveagent(void)
void proto_reg_handoff_waveagent(void)
{
- heur_dissector_add("udp", dissect_waveagent_heur, "WaveAgent over UDP", "waveagent_udp", proto_waveagent);
+ heur_dissector_add("udp", dissect_waveagent_heur, "WaveAgent over UDP", "waveagent_udp", proto_waveagent, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-wol.c b/epan/dissectors/packet-wol.c
index eac30fafd5..0e3bf71f81 100644
--- a/epan/dissectors/packet-wol.c
+++ b/epan/dissectors/packet-wol.c
@@ -333,7 +333,7 @@ proto_reg_handoff_wol(void)
* we'll miss some, but how else to do this ... add a thousand of
* these dissector_add_uint()'s and heur_dissector_add()'s??? */
dissector_add_uint("ethertype", ETHERTYPE_WOL, wol_handle);
- heur_dissector_add("udp", dissect_wolheur, "Wake On LAN over UDP", "wol_udp", proto_wol);
+ heur_dissector_add("udp", dissect_wolheur, "Wake On LAN over UDP", "wol_udp", proto_wol, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-xcsl.c b/epan/dissectors/packet-xcsl.c
index 18130d4dfc..8c17c0801d 100644
--- a/epan/dissectors/packet-xcsl.c
+++ b/epan/dissectors/packet-xcsl.c
@@ -348,7 +348,7 @@ void proto_register_xcsl(void) {
/* In case it concerns TCP, try to match on the xcsl header */
void proto_reg_handoff_xcsl(void) {
- heur_dissector_add("tcp", dissect_xcsl_tcp_heur, "XCSL over TCP", "xcsl_tcp", hfi_xcsl->id);
+ heur_dissector_add("tcp", dissect_xcsl_tcp_heur, "XCSL over TCP", "xcsl_tcp", hfi_xcsl->id, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index 389a099554..2084053972 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -1370,7 +1370,7 @@ proto_reg_handoff_xmcp(void)
if (!xmcp_prefs_initialized) {
xmcp_tcp_handle = new_create_dissector_handle(dissect_xmcp_tcp, proto_xmcp);
- heur_dissector_add("tcp", dissect_xmcp_heur, "XMCP over TCP", "xmcp_tcp", proto_xmcp);
+ heur_dissector_add("tcp", dissect_xmcp_heur, "XMCP over TCP", "xmcp_tcp", proto_xmcp, HEURISTIC_ENABLE);
media_type_dissector_table = find_dissector_table("media_type");
xmcp_prefs_initialized = TRUE;
} else {
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index f94ae4e9f4..2df4a69cfa 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -74,12 +74,6 @@ static xml_ns_t xml_ns = {(gchar *)"xml", "/", -1, -1, -1, NULL, NULL, N
static xml_ns_t unknown_ns = {(gchar *)"unknown", "?", -1, -1, -1, NULL, NULL, NULL};
static xml_ns_t *root_ns;
-static gboolean pref_heuristic_media = FALSE;
-static gboolean pref_heuristic_tcp = FALSE;
-static gboolean pref_heuristic_udp = FALSE;
-static gboolean pref_heuristic_media_save = FALSE;
-static gboolean pref_heuristic_tcp_save = FALSE;
-static gboolean pref_heuristic_udp_save = FALSE;
static gboolean pref_heuristic_unicode = FALSE;
static range_t *global_xml_tcp_range = NULL;
@@ -1346,40 +1340,6 @@ static void init_xml_names(void)
static void apply_prefs(void)
{
- if (pref_heuristic_media_save != pref_heuristic_media) {
- if (pref_heuristic_media) {
- heur_dissector_add("http", dissect_xml_heur, "XML in HTTP", "xml_http", xml_ns.hf_tag);
- heur_dissector_add("sip", dissect_xml_heur, "XML in SIP", "xml_sip", xml_ns.hf_tag);
- heur_dissector_add("media", dissect_xml_heur, "XML in media", "xml_media", xml_ns.hf_tag);
- pref_heuristic_media_save = TRUE;
- } else {
- heur_dissector_delete("http", dissect_xml_heur, xml_ns.hf_tag);
- heur_dissector_delete("sip", dissect_xml_heur, xml_ns.hf_tag);
- heur_dissector_delete("media", dissect_xml_heur, xml_ns.hf_tag);
- pref_heuristic_media_save = FALSE;
- }
- }
-
- if (pref_heuristic_tcp_save != pref_heuristic_tcp ) {
- if (pref_heuristic_tcp) {
- heur_dissector_add("tcp", dissect_xml_heur, "XML over TCP", "xml_tcp", xml_ns.hf_tag);
- pref_heuristic_tcp_save = TRUE;
- } else {
- heur_dissector_delete("tcp", dissect_xml_heur, xml_ns.hf_tag);
- pref_heuristic_tcp_save = FALSE;
- }
- }
-
- if (pref_heuristic_udp_save != pref_heuristic_udp ) {
- if (pref_heuristic_udp) {
- heur_dissector_add("udp", dissect_xml_heur, "XML over UDP", "xml_udp", xml_ns.hf_tag);
- pref_heuristic_udp_save = TRUE;
- } else {
- heur_dissector_delete("udp", dissect_xml_heur, xml_ns.hf_tag);
- pref_heuristic_udp_save = FALSE;
- }
- }
-
dissector_delete_uint_range("tcp.port", xml_tcp_range, xml_handle);
g_free(xml_tcp_range);
xml_tcp_range = range_copy(global_xml_tcp_range);
@@ -1454,18 +1414,12 @@ proto_register_xml(void)
proto_register_subtree_array((gint **)g_array_data(ett_arr), ett_arr->len);
xml_module = prefs_register_protocol(xml_ns.hf_tag, apply_prefs);
- prefs_register_bool_preference(xml_module, "heuristic", "Use Heuristics for media types",
- "Try to recognize XML for unknown media types",
- &pref_heuristic_media);
- prefs_register_bool_preference(xml_module, "heuristic_tcp", "Use Heuristics for TCP",
- "Try to recognize XML for unknown TCP ports",
- &pref_heuristic_tcp);
+ prefs_register_obsolete_preference(xml_module, "heuristic");
+ prefs_register_obsolete_preference(xml_module, "heuristic_tcp");
prefs_register_range_preference(xml_module, "tcp.port", "TCP Ports",
"TCP Ports range",
&global_xml_tcp_range, 65535);
- prefs_register_bool_preference(xml_module, "heuristic_udp", "Use Heuristics for UDP",
- "Try to recognize XML for unknown UDP ports",
- &pref_heuristic_udp);
+ prefs_register_obsolete_preference(xml_module, "heuristic_udp");
/* XXX - UCS-2, or UTF-16? */
prefs_register_bool_preference(xml_module, "heuristic_unicode", "Use Unicode in heuristics",
"Try to recognize XML encoded in Unicode (UCS-2BE)",
@@ -1494,7 +1448,14 @@ proto_reg_handoff_xml(void)
xml_handle = find_dissector("xml");
g_hash_table_foreach(media_types, add_dissector_media, NULL);
- heur_dissector_add("wtap_file", dissect_xml_heur, "XML file", "xml_wtap", xml_ns.hf_tag);
+
+ heur_dissector_add("http", dissect_xml_heur, "XML in HTTP", "xml_http", xml_ns.hf_tag, HEURISTIC_DISABLE);
+ heur_dissector_add("sip", dissect_xml_heur, "XML in SIP", "xml_sip", xml_ns.hf_tag, HEURISTIC_DISABLE);
+ heur_dissector_add("media", dissect_xml_heur, "XML in media", "xml_media", xml_ns.hf_tag, HEURISTIC_DISABLE);
+ heur_dissector_add("tcp", dissect_xml_heur, "XML over TCP", "xml_tcp", xml_ns.hf_tag, HEURISTIC_DISABLE);
+ heur_dissector_add("udp", dissect_xml_heur, "XML over UDP", "xml_udp", xml_ns.hf_tag, HEURISTIC_DISABLE);
+
+ heur_dissector_add("wtap_file", dissect_xml_heur, "XML file", "xml_wtap", xml_ns.hf_tag, HEURISTIC_ENABLE);
}
diff --git a/epan/dissectors/packet-yhoo.c b/epan/dissectors/packet-yhoo.c
index 4fe7148530..f3c54aa8d7 100644
--- a/epan/dissectors/packet-yhoo.c
+++ b/epan/dissectors/packet-yhoo.c
@@ -309,7 +309,7 @@ proto_reg_handoff_yhoo(void)
* Just register as a heuristic TCP dissector, and reject stuff
* not to or from that port.
*/
- heur_dissector_add("tcp", dissect_yhoo, "Yahoo Messenger over TCP", "yhoo_tcp", proto_yhoo);
+ heur_dissector_add("tcp", dissect_yhoo, "Yahoo Messenger over TCP", "yhoo_tcp", proto_yhoo, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-ymsg.c b/epan/dissectors/packet-ymsg.c
index 52dc553e73..5830d84c47 100644
--- a/epan/dissectors/packet-ymsg.c
+++ b/epan/dissectors/packet-ymsg.c
@@ -560,7 +560,7 @@ proto_reg_handoff_ymsg(void)
* Just register as a heuristic TCP dissector, and reject stuff
* that doesn't begin with a YMSG signature.
*/
- heur_dissector_add("tcp", dissect_ymsg, "Yahoo YMSG Messenger over TCP", "ymsg_tcp", proto_ymsg);
+ heur_dissector_add("tcp", dissect_ymsg, "Yahoo YMSG Messenger over TCP", "ymsg_tcp", proto_ymsg, HEURISTIC_ENABLE);
}
/*
diff --git a/epan/dissectors/packet-zbee-nwk-gp.c b/epan/dissectors/packet-zbee-nwk-gp.c
index db7aab5829..6ecec12e30 100644
--- a/epan/dissectors/packet-zbee-nwk-gp.c
+++ b/epan/dissectors/packet-zbee-nwk-gp.c
@@ -1788,7 +1788,7 @@ proto_reg_handoff_zbee_nwk_gp(void)
data_handle = find_dissector("data");
/* Register our dissector with IEEE 802.15.4. */
dissector_add_for_decode_as(IEEE802154_PROTOABBREV_WPAN_PANID, find_dissector(ZBEE_PROTOABBREV_NWK_GP));
- heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_zbee_nwk_heur_gp, "ZigBee Green Power over IEEE 802.15.4", "zbee_nwk_gp_wlan", proto_zbee_nwk_gp);
+ heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_zbee_nwk_heur_gp, "ZigBee Green Power over IEEE 802.15.4", "zbee_nwk_gp_wlan", proto_zbee_nwk_gp, HEURISTIC_ENABLE);
} /* proto_reg_handoff_zbee */
/*
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c
index fe81e43270..3f2451ee48 100644
--- a/epan/dissectors/packet-zbee-nwk.c
+++ b/epan/dissectors/packet-zbee-nwk.c
@@ -1981,9 +1981,9 @@ void proto_reg_handoff_zbee_nwk(void)
/* Register our dissector with IEEE 802.15.4 */
dissector_add_for_decode_as(IEEE802154_PROTOABBREV_WPAN_PANID, find_dissector(ZBEE_PROTOABBREV_NWK));
- heur_dissector_add(IEEE802154_PROTOABBREV_WPAN_BEACON, dissect_zbee_beacon_heur, "ZigBee Beacon", "zbee_wlan_beacon", proto_zbee_beacon);
- heur_dissector_add(IEEE802154_PROTOABBREV_WPAN_BEACON, dissect_zbip_beacon_heur, "ZigBee IP Beacon", "zbip_wlan_beacon", proto_zbip_beacon);
- heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_zbee_nwk_heur, "ZigBee Network Layer over IEEE 802.15.4", "zbee_nwk_wlan", proto_zbee_nwk);
+ heur_dissector_add(IEEE802154_PROTOABBREV_WPAN_BEACON, dissect_zbee_beacon_heur, "ZigBee Beacon", "zbee_wlan_beacon", proto_zbee_beacon, HEURISTIC_ENABLE);
+ heur_dissector_add(IEEE802154_PROTOABBREV_WPAN_BEACON, dissect_zbip_beacon_heur, "ZigBee IP Beacon", "zbip_wlan_beacon", proto_zbip_beacon, HEURISTIC_ENABLE);
+ heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_zbee_nwk_heur, "ZigBee Network Layer over IEEE 802.15.4", "zbee_nwk_wlan", proto_zbee_nwk, HEURISTIC_ENABLE);
/* Handoff the ZigBee security dissector code. */
zbee_security_handoff();
diff --git a/epan/dissectors/packet-ziop.c b/epan/dissectors/packet-ziop.c
index 8875725ae1..2e7bbb57d4 100644
--- a/epan/dissectors/packet-ziop.c
+++ b/epan/dissectors/packet-ziop.c
@@ -332,7 +332,7 @@ proto_reg_handoff_ziop (void)
ziop_tcp_handle = new_create_dissector_handle(dissect_ziop_tcp, proto_ziop);
dissector_add_for_decode_as("udp.port", ziop_tcp_handle);
- heur_dissector_add("tcp", dissect_ziop_heur, "ZIOP over TCP", "ziop_tcp", proto_ziop);
+ heur_dissector_add("tcp", dissect_ziop_heur, "ZIOP over TCP", "ziop_tcp", proto_ziop, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
}
diff --git a/epan/packet.c b/epan/packet.c
index 18e61d337f..77ed6c2a48 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1964,19 +1964,37 @@ has_heur_dissector_list(const gchar *name) {
}
+static int
+find_matching_heur_dissector_by_short_name(gconstpointer a, gconstpointer b)
+{
+ const gchar *str_a = proto_get_protocol_short_name(((const heur_dtbl_entry_t *)a)->protocol);
+ const gchar *str_b = (const gchar*)b;
+
+ return strcmp(str_a, str_b);
+}
+
+heur_dtbl_entry_t*
+find_heur_dissector_by_short_name(heur_dissector_list_t heur_list, const char *short_name)
+{
+ GSList *found_entry;
+ found_entry = g_slist_find_custom(heur_list->dissectors, (gpointer) short_name, find_matching_heur_dissector_by_short_name);
+
+ return found_entry ? (heur_dtbl_entry_t *)(found_entry->data) : NULL;
+}
+
heur_dtbl_entry_t* find_heur_dissector_by_unique_short_name(const char *short_name)
{
return (heur_dtbl_entry_t*)g_hash_table_lookup(heuristic_short_names, (gpointer)short_name);
}
void
-heur_dissector_add(const char *name, heur_dissector_t dissector, const char *display_name, const char *short_name, const int proto)
+heur_dissector_add(const char *name, heur_dissector_t dissector, const char *display_name, const char *short_name, const int proto, heuristic_enable_e enable)
{
heur_dissector_list_t sub_dissectors = find_heur_dissector_list(name);
const char *proto_name;
heur_dtbl_entry_t *hdtbl_entry;
- guint i, list_size;
- GSList *list_entry;
+ guint i, list_size;
+ GSList *list_entry;
/*
* Make sure the dissector table exists.
@@ -2026,7 +2044,7 @@ heur_dissector_add(const char *name, heur_dissector_t dissector, const char *dis
hdtbl_entry->display_name = display_name;
hdtbl_entry->short_name = short_name;
hdtbl_entry->list_name = g_strdup(name);
- hdtbl_entry->enabled = TRUE;
+ hdtbl_entry->enabled = (enable == HEURISTIC_ENABLE);
/* do the table insertion */
g_hash_table_insert(heuristic_short_names, (gpointer)short_name, hdtbl_entry);
diff --git a/epan/packet.h b/epan/packet.h
index 0fecba3182..b2dfe43986 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -121,6 +121,11 @@ typedef int (*new_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, void *);
typedef gboolean (*heur_dissector_t)(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, void *);
+typedef enum {
+ HEURISTIC_DISABLE,
+ HEURISTIC_ENABLE
+} heuristic_enable_e;
+
typedef void (*DATFunc) (const gchar *table_name, ftenum_t selector_type,
gpointer key, gpointer value, gpointer user_data);
typedef void (*DATFunc_handle) (const gchar *table_name, gpointer value,
@@ -454,9 +459,10 @@ WS_DLL_PUBLIC heur_dtbl_entry_t* find_heur_dissector_by_unique_short_name(const
* @param display_name the string used to present heuristic to user, e.g. "HTTP over TCP"
* @param short_name the string used for "internal" use to identify heuristic, e.g. "http_tcp"
* @param proto the protocol id of the sub-dissector
+ * @param enable initially enabled or not
*/
WS_DLL_PUBLIC void heur_dissector_add(const char *name, heur_dissector_t dissector,
- const char *display_name, const char *short_name, const int proto);
+ const char *display_name, const char *short_name, const int proto, heuristic_enable_e enable);
/** Remove a sub-dissector from a heuristic dissector list.
* Call this in the prefs_reinit function of the sub-dissector.
diff --git a/epan/prefs.c b/epan/prefs.c
index 9bd1ac74e0..0ca84c3636 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -3807,6 +3807,78 @@ try_convert_to_custom_column(gpointer *el_data)
}
}
+static gboolean
+deprecated_heur_dissector_pref(gchar *pref_name, const gchar *value)
+{
+ struct heur_pref_name
+ {
+ const char* pref_name;
+ const char* short_name;
+ gboolean more_dissectors; /* For multiple dissectors controlled by the same preference */
+ };
+
+ struct heur_pref_name heur_prefs[] = {
+ {"acn.heuristic_acn", "acn_udp", 0},
+ {"bfcp.enable", "bfcp_tcp", 1},
+ {"bfcp.enable", "bfcp_udp", 0},
+ {"bt-dht.enable", "bittorrent_dht_udp", 0},
+ {"bt-utp.enable", "bt_utp_udp", 0},
+ {"cattp.enable", "cattp_udp", 0},
+ {"cfp.enable", "fp_eth", 0},
+ {"dicom.heuristic", "dicom_tcp", 0},
+ {"dnp3.heuristics", "dnp3_tcp", 1},
+ {"dnp3.heuristics", "dnp3_udp", 0},
+ {"dvb-s2_modeadapt.enable", "dvb_s2_udp", 0},
+ {"esl.enable", "esl_eth", 0},
+ {"fp.udp_heur", "fp_udp", 0},
+ {"gvsp.enable_heuristic", "gvsp_udp", 0},
+ {"hdcp2.enable", "hdcp2_tcp", 0},
+ {"hislip.enable_heuristic", "hislip_tcp", 0},
+ {"jxta.udp.heuristic", "jxta_udp", 0},
+ {"jxta.tcp.heuristic", "jxta_tcp", 0},
+ {"jxta.sctp.heuristic", "jxta_sctp", 0},
+ {"mac-lte.heuristic_mac_lte_over_udp", "mac_lte_udp", 0},
+ {"mbim.bulk_heuristic", "mbim_usb_bulk", 0},
+ {"norm.heuristic_norm", "rmt_norm_udp", 0},
+ {"openflow.heuristic", "openflow_tcp", 0},
+ {"pdcp-lte.heuristic_pdcp_lte_over_udp", "pdcp_lte_udp", 0},
+ {"rlc.heuristic_rlc_over_udp", "rlc_udp", 0},
+ {"rlc-lte.heuristic_rlc_lte_over_udp", "rlc_lte_udp", 0},
+ {"rtcp.heuristic_rtcp", "rtcp_udp", 1},
+ {"rtcp.heuristic_rtcp", "rtcp_stun", 0},
+ {"rtp.heuristic_rtp", "rtp_udp", 1},
+ {"rtp.heuristic_rtp", "rtp_stun", 0},
+ {"teredo.heuristic_teredo", "teredo_udp", 0},
+ {"vssmonitoring.use_heuristics", "vssmonitoring_eth", 0},
+ {"xml.heuristic", "xml_http", 1},
+ {"xml.heuristic", "xml_sip", 1},
+ {"xml.heuristic", "xml_media", 0},
+ {"xml.heuristic_tcp", "xml_tcp", 0},
+ {"xml.heuristic_udp", "xml_udp", 0},
+ };
+
+ unsigned int i;
+ heur_dtbl_entry_t* heuristic;
+
+
+ for (i = 0; i < sizeof(heur_prefs)/sizeof(struct heur_pref_name); i++)
+ {
+ if (strcmp(pref_name, heur_prefs[i].pref_name) == 0)
+ {
+ heuristic = find_heur_dissector_by_unique_short_name(heur_prefs[i].short_name);
+ if (heuristic != NULL) {
+ heuristic->enabled = ((g_ascii_strcasecmp(value, "true") == 0) ? TRUE : FALSE);
+ }
+
+ if (!heur_prefs[i].more_dissectors)
+ return TRUE;
+ }
+ }
+
+
+ return FALSE;
+}
+
static prefs_set_pref_e
set_pref(gchar *pref_name, const gchar *value, void *private_data _U_,
gboolean return_range_errors)
@@ -3870,6 +3942,8 @@ set_pref(gchar *pref_name, const gchar *value, void *private_data _U_,
if (string_to_name_resolve(value, &gbl_resolv_flags) != '\0')
return PREFS_SET_SYNTAX_ERR;
}
+ } else if (deprecated_heur_dissector_pref(pref_name, value)) {
+ /* Handled within deprecated_heur_dissector_pref() if found */
} else {
/* Handle deprecated "global" options that don't have a module
* associated with them
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index 8fbb2a23b6..9f7d2f8b50 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -301,7 +301,7 @@ WSLUA_METHOD Proto_register_heuristic(lua_State* L) {
/* now register the single/common heur_dissect_lua function */
/* XXX - ADD PARAMETERS FOR NEW heur_dissector_add PARAMETERS!!! */
- heur_dissector_add(listname, heur_dissect_lua, proto_name, proto->loname, proto->hfid);
+ heur_dissector_add(listname, heur_dissect_lua, proto_name, proto->loname, proto->hfid, HEURISTIC_ENABLE);
} else {
luaL_argerror(L,3,"The heuristic dissector must be a function");
diff --git a/plugins/ethercat/packet-esl.c b/plugins/ethercat/packet-esl.c
index 8cc9814ad0..70f0d416bf 100644
--- a/plugins/ethercat/packet-esl.c
+++ b/plugins/ethercat/packet-esl.c
@@ -92,7 +92,6 @@ typedef struct _EslHeader
#define SIZEOF_ESLHEADER 16
static dissector_handle_t eth_withoutfcs_handle;
-static int esl_enable_dissector = FALSE;
void proto_reg_handoff_esl(void);
@@ -349,9 +348,7 @@ proto_register_esl(void) {
esl_module = prefs_register_protocol(proto_esl, proto_reg_handoff_esl);
- prefs_register_bool_preference(esl_module, "enable", "Enable dissector",
- "Enable this dissector (default is false)",
- &esl_enable_dissector);
+ prefs_register_obsolete_preference(esl_module, "enable");
proto_register_field_array(proto_esl,hf,array_length(hf));
proto_register_subtree_array(ett,array_length(ett));
@@ -365,10 +362,9 @@ proto_reg_handoff_esl(void) {
if (!initialized) {
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
- heur_dissector_add("eth", dissect_esl_heur, "EtherCAT over Ethernet", "esl_eth", proto_esl);
+ heur_dissector_add("eth", dissect_esl_heur, "EtherCAT over Ethernet", "esl_eth", proto_esl, HEURISTIC_DISABLE);
initialized = TRUE;
}
- proto_set_decoding(proto_esl, esl_enable_dissector);
}
/*
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index 7537295f7e..e3f910c69f 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -12267,7 +12267,7 @@ proto_reg_handoff_pn_io (void)
dcerpc_init_uuid (proto_pn_io, ett_pn_io, &uuid_pn_io_supervisor, ver_pn_io_supervisor, pn_io_dissectors, hf_pn_io_opnum);
dcerpc_init_uuid (proto_pn_io, ett_pn_io, &uuid_pn_io_parameterserver, ver_pn_io_parameterserver, pn_io_dissectors, hf_pn_io_opnum);
- heur_dissector_add("pn_rt", dissect_PNIO_heur, "PROFINET IO", "pn_io_pn_rt", proto_pn_io);
+ heur_dissector_add("pn_rt", dissect_PNIO_heur, "PROFINET IO", "pn_io_pn_rt", proto_pn_io, HEURISTIC_ENABLE);
}
/*
diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c
index ae143370ae..adf1882042 100644
--- a/plugins/profinet/packet-dcom-cba-acco.c
+++ b/plugins/profinet/packet-dcom-cba-acco.c
@@ -5147,7 +5147,7 @@ proto_reg_handoff_dcom_cba_acco (void)
&uuid_ICBAAccoSync, ver_ICBAAccoSync, ICBAAccoSync_dissectors, hf_cba_acco_opnum);
- heur_dissector_add("pn_rt", dissect_CBA_Connection_Data_heur, "PROFINET CBA IO", "pn_cba_pn_rt", proto_ICBAAccoServer);
+ heur_dissector_add("pn_rt", dissect_CBA_Connection_Data_heur, "PROFINET CBA IO", "pn_cba_pn_rt", proto_ICBAAccoServer, HEURISTIC_ENABLE);
}
/*
diff --git a/plugins/profinet/packet-pn-dcp.c b/plugins/profinet/packet-pn-dcp.c
index 0ad437b9f3..4bb89bbec9 100644
--- a/plugins/profinet/packet-pn-dcp.c
+++ b/plugins/profinet/packet-pn-dcp.c
@@ -1291,7 +1291,7 @@ void
proto_reg_handoff_pn_dcp (void)
{
/* register ourself as an heuristic pn-rt payload dissector */
- heur_dissector_add("pn_rt", dissect_PNDCP_Data_heur, "PROFINET DCP IO", "pn_dcp_pn_rt", proto_pn_dcp);
+ heur_dissector_add("pn_rt", dissect_PNDCP_Data_heur, "PROFINET DCP IO", "pn_dcp_pn_rt", proto_pn_dcp, HEURISTIC_ENABLE);
}
/*
diff --git a/plugins/profinet/packet-pn-mrrt.c b/plugins/profinet/packet-pn-mrrt.c
index 69ddea0272..269fe015dd 100644
--- a/plugins/profinet/packet-pn-mrrt.c
+++ b/plugins/profinet/packet-pn-mrrt.c
@@ -242,7 +242,7 @@ proto_reg_handoff_pn_mrrt (void)
{
/* register ourself as an heuristic pn-rt payload dissector */
- heur_dissector_add("pn_rt", dissect_PNMRRT_Data_heur, "PROFINET MRRT IO", "pn_mrrt_pn_rt", proto_pn_mrrt);
+ heur_dissector_add("pn_rt", dissect_PNMRRT_Data_heur, "PROFINET MRRT IO", "pn_mrrt_pn_rt", proto_pn_mrrt, HEURISTIC_ENABLE);
}
/*
diff --git a/plugins/profinet/packet-pn-ptcp.c b/plugins/profinet/packet-pn-ptcp.c
index 5da4c0881d..0c642bc8a3 100644
--- a/plugins/profinet/packet-pn-ptcp.c
+++ b/plugins/profinet/packet-pn-ptcp.c
@@ -1079,7 +1079,7 @@ void
proto_reg_handoff_pn_ptcp (void)
{
/* register ourself as an heuristic pn-rt payload dissector */
- heur_dissector_add("pn_rt", dissect_PNPTCP_Data_heur, "PROFINET PTCP IO", "pn_ptcp_pn_rt", proto_pn_ptcp);
+ heur_dissector_add("pn_rt", dissect_PNPTCP_Data_heur, "PROFINET PTCP IO", "pn_ptcp_pn_rt", proto_pn_ptcp, HEURISTIC_ENABLE);
}
/*
diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c
index bde5ca3791..210f9e5428 100644
--- a/plugins/profinet/packet-pn-rt.c
+++ b/plugins/profinet/packet-pn-rt.c
@@ -1000,8 +1000,8 @@ proto_reg_handoff_pn_rt(void)
dissector_add_uint("ethertype", ETHERTYPE_PROFINET, pn_rt_handle);
dissector_add_uint("udp.port", 0x8892, pn_rt_handle);
- heur_dissector_add("pn_rt", dissect_CSF_SDU_heur, "PROFINET CSF_SDU IO", "pn_csf_sdu_pn_rt", proto_pn_rt);
- heur_dissector_add("pn_rt", dissect_FRAG_PDU_heur, "PROFINET Frag PDU IO", "pn_frag_pn_rt", proto_pn_rt);
+ heur_dissector_add("pn_rt", dissect_CSF_SDU_heur, "PROFINET CSF_SDU IO", "pn_csf_sdu_pn_rt", proto_pn_rt, HEURISTIC_ENABLE);
+ heur_dissector_add("pn_rt", dissect_FRAG_PDU_heur, "PROFINET Frag PDU IO", "pn_frag_pn_rt", proto_pn_rt, HEURISTIC_ENABLE);
data_handle = find_dissector("data");
ethertype_subdissector_table = find_dissector_table("ethertype");