aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/profinet
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-07-03 19:25:34 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-07-03 19:25:34 +0000
commit3826755b0a85c752c5d5977d40f395fc461772cc (patch)
treeaeb73298e1a349085b2188eb81eceea0325fb18e /plugins/profinet
parentaea7d0a5bcf5e76f275bee62108df1b5141ea21a (diff)
From Roland Knall:
implement a named dissector for the PN/IO sub-protocol for Profinet, as well as a heuristic dissector ("pn_io"), other protocols can attach too. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6062 svn path=/trunk/; revision=37882
Diffstat (limited to 'plugins/profinet')
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index c8a44bb477..fd53b17ca4 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -571,6 +571,8 @@ static guint16 ver_pn_io_supervisor = 1;
static e_uuid_t uuid_pn_io_parameterserver = { 0xDEA00004, 0x6C97, 0x11D1, { 0x82, 0x71, 0x00, 0xA0, 0x24, 0x42, 0xDF, 0x7D } };
static guint16 ver_pn_io_parameterserver = 1;
+/* Allow heuristic dissection */
+static heur_dissector_list_t heur_pn_subdissector_list;
static const value_string pn_io_block_type[] = {
{ 0x0000, "Reserved" },
@@ -7709,6 +7711,13 @@ dissect_PNIO_heur(tvbuff_t *tvb,
guint8 u8CBAVersion;
guint16 u16FrameID;
+ /*
+ * In case the packet is a protocol encoded in the basic PNIO transport stream,
+ * give that protocol a chance to make a heuristic dissection, before we continue
+ * to dissect it as a normal PNIO packet.
+ */
+ if (dissector_try_heuristic(heur_pn_subdissector_list, tvb, pinfo, tree))
+ return FALSE;
/* the sub tvb will NOT contain the frame_id here! */
u16FrameID = GPOINTER_TO_UINT(pinfo->private_data);
@@ -8735,6 +8744,10 @@ proto_register_pn_io (void)
proto_register_field_array (proto_pn_io, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
+ /* subdissector code */
+ new_register_dissector("pn_io", dissect_PNIO_heur, proto_pn_io);
+ register_heur_dissector_list("pn_io", &heur_pn_subdissector_list);
+
register_init_routine(pnio_reinit);
register_dissector_filter("PN-IO AR", pn_io_ar_conv_valid, pn_io_ar_conv_filter);