aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-opensafety.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-11-15 20:35:51 -0500
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-11-16 13:45:18 +0000
commitf92ed4df2d4720720080d8013da124a0eb956de7 (patch)
tree2b3bf92972a849fe668f121e53e45bfe1b7c6451 /epan/dissectors/packet-opensafety.c
parent3b8ed366ddd149f2cc1428a713235c18afc192e7 (diff)
Remove ipproto member of packet_info.
All situations can be handled with "shimmed" dissector functions. Change-Id: Ic85483b32d99d3270b193c9f6b29574d8fad46a8 Reviewed-on: https://code.wireshark.org/review/5327 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-opensafety.c')
-rw-r--r--epan/dissectors/packet-opensafety.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c
index b26424bc46..47fdeb124e 100644
--- a/epan/dissectors/packet-opensafety.c
+++ b/epan/dissectors/packet-opensafety.c
@@ -2301,6 +2301,15 @@ dissect_opensafety_epl(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tr
return result;
}
+static gboolean
+dissect_opensafety_siii_udp(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
+{
+ if ( ! global_enable_siii )
+ return FALSE;
+
+ return opensafety_package_dissector("openSAFETY/SercosIII UDP", "", FALSE, FALSE, 0,
+ message_tvb, pinfo, tree, OPENSAFETY_ACYCLIC_DATA );
+}
static gboolean
dissect_opensafety_siii(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ )
@@ -2311,12 +2320,6 @@ dissect_opensafety_siii(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *t
if ( ! global_enable_siii )
return result;
- if ( pinfo->ipproto == IP_PROTO_UDP )
- {
- return opensafety_package_dissector("openSAFETY/SercosIII UDP", "", FALSE, FALSE, 0,
- message_tvb, pinfo, tree, OPENSAFETY_ACYCLIC_DATA );
- }
-
/* We can assume to have a SercosIII package, as the SercosIII dissector won't detect
* SercosIII-UDP packages, this is most likely SercosIII-over-ethernet */
@@ -2441,7 +2444,7 @@ apply_prefs ( void )
/* Sercos III dissector does not handle UDP transport, has to be handled
* separately, everything else should be caught by the heuristic dissector
*/
- dissector_add_uint("udp.port", opensafety_udp_siii_port_number, find_dissector("opensafety_siii"));
+ dissector_add_uint("udp.port", opensafety_udp_siii_port_number, find_dissector("opensafety_siii_udp"));
}
@@ -2849,7 +2852,7 @@ proto_register_opensafety(void)
/* Registering default and ModBus/TCP dissector */
new_register_dissector("opensafety_udpdata", dissect_opensafety_udpdata, proto_opensafety );
new_register_dissector("opensafety_mbtcp", dissect_opensafety_mbtcp, proto_opensafety );
- new_register_dissector("opensafety_siii", dissect_opensafety_siii, proto_opensafety );
+ new_register_dissector("opensafety_siii_udp", dissect_opensafety_siii_udp, proto_opensafety );
new_register_dissector("opensafety_pnio", dissect_opensafety_pn_io, proto_opensafety);
}