aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS5
-rw-r--r--plugins/sercosiii/packet-sercosiii_1v1.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index f5b210d29d..0942affe76 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3243,6 +3243,9 @@ Jakub Zawadzki <darkjames [AT] darkjames.ath.cx> {
JSON dissector
}
+Roland Knall <rknall [AT] gmail.com> {
+ Support for heuristic subdissectors for SERCOS III
+}
and by:
@@ -3354,7 +3357,7 @@ Brice Augustin <bricecotte [AT] gmail.com>
Matt Thornton <MATT_THORNTON [AT] appsig.com>
Markus Seehofer <Markus.Seehofer [AT] hirschmann.de>
Timo Metsala <timo.metsala [AT] gmail.com>
-Tomer Shani <thetour [AT} japan.com>
+Tomer Shani <thetour [AT] japan.com>
Manu Pathak <mapathak [AT] cisco.com>
Kaul <mykaul [AT] gmail.com>
John Sullivan <john [AT] kanargh.force9.co.uk>
diff --git a/plugins/sercosiii/packet-sercosiii_1v1.c b/plugins/sercosiii/packet-sercosiii_1v1.c
index fe4c1b5c2e..77dda1a76f 100644
--- a/plugins/sercosiii/packet-sercosiii_1v1.c
+++ b/plugins/sercosiii/packet-sercosiii_1v1.c
@@ -40,6 +40,9 @@ static gint proto_siii = -1;
static gint ett_siii = -1;
static gint ett_siii_header = -1;
+/* Allow heuristic dissection */
+static heur_dissector_list_t heur_subdissector_list;
+
/* Main dissector entry */
static void
dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@@ -55,6 +58,14 @@ dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SERCOS III V1.1");
col_clear(pinfo->cinfo, COL_INFO);
+ /*
+ * In case the packet is a protocol encoded in the basic SercosIII transport stream,
+ * give that protocol a chance to make a heuristic dissection, before we continue
+ * to dissect it as a normal SercosIII packet.
+ */
+ if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree))
+ return;
+
/* check what we got on our hand */
type = tvb_get_guint8(tvb, 0);
if(type&0x80) /* primary or secondary channel */
@@ -97,6 +108,9 @@ proto_register_sercosiii(void)
register_dissector("sercosiii", dissect_siii, proto_siii);
+ /* subdissector code */
+ register_heur_dissector_list("sercosiii", &heur_subdissector_list);
+
/* Required function calls to register the header fields and subtrees used */
proto_register_subtree_array(ett, array_length(ett));