diff options
author | Bill Meier <wmeier@newsguy.com> | 2008-10-25 20:24:31 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2008-10-25 20:24:31 +0000 |
commit | 05c1929f1d51ef94a5827147aee61d2320434783 (patch) | |
tree | 3e6cc68f2dc569fe027498b7deb3d0574cd99c09 /plugins/ethercat | |
parent | 94c73a47c9e361b6eeeecf53e9b600f9cf1b77a9 (diff) |
proto_register/proto_reg_handoff; Various small cleanup and bug-fixing
remove unnecessary #include prefs.f and emem.h in a few cases...
svn path=/trunk/; revision=26554
Diffstat (limited to 'plugins/ethercat')
-rw-r--r-- | plugins/ethercat/packet-ams.c | 11 | ||||
-rw-r--r-- | plugins/ethercat/packet-ecatmb.c | 9 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-datagram.c | 4 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-frame.c | 6 | ||||
-rw-r--r-- | plugins/ethercat/packet-ioraw.c | 4 | ||||
-rw-r--r-- | plugins/ethercat/packet-nv.c | 4 |
6 files changed, 10 insertions, 28 deletions
diff --git a/plugins/ethercat/packet-ams.c b/plugins/ethercat/packet-ams.c index c58d8fa11b..f857ad0862 100644 --- a/plugins/ethercat/packet-ams.c +++ b/plugins/ethercat/packet-ams.c @@ -39,14 +39,10 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/prefs.h> #include <epan/strutil.h> -#include <epan/emem.h> #include "packet-ams.h" -void proto_reg_handoff_ams(void); - /* Define the ams proto */ int proto_ams = -1; @@ -1226,8 +1222,7 @@ void proto_register_ams(void) &ett_ams_adsdnrequest }; - proto_ams = proto_register_protocol("AMS", - "AMS", "ams"); + proto_ams = proto_register_protocol("AMS", "AMS", "ams"); proto_register_field_array(proto_ams, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -1238,9 +1233,9 @@ void proto_register_ams(void) void proto_reg_handoff_ams(void) { - static dissector_handle_t ams_handle; + dissector_handle_t ams_handle; - ams_handle = create_dissector_handle(dissect_ams, proto_ams); + ams_handle = find_dissector("ams"); dissector_add("tcp.port", 0xbf02, ams_handle); dissector_add("ecatf.type", 2, ams_handle); } diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index c850ad3e57..d77d3cfe25 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -40,15 +40,10 @@ #include <epan/packet.h> #include <epan/addr_resolv.h> -#include <epan/prefs.h> #include <epan/strutil.h> -#include <epan/emem.h> #include "packet-ecatmb.h" -void proto_reg_handoff_ecat_mailbox(void); - - #define BIT2BYTE(x) ((x+7)/8) #define ENDOF(p) ((p)+1) /* pointer to end of *p */ @@ -2073,10 +2068,10 @@ void proto_register_ecat_mailbox(void) void proto_reg_handoff_ecat_mailbox(void) { - static dissector_handle_t ecat_mailbox_handle; + dissector_handle_t ecat_mailbox_handle; /* Register this dissector as a sub dissector to E88A4 based on ether type. */ - ecat_mailbox_handle = create_dissector_handle(dissect_ecat_mailbox, proto_ecat_mailbox); + ecat_mailbox_handle = find_dissector("ecat_mailbox"); dissector_add("ecatf.type", 5, ecat_mailbox_handle); eth_handle = find_dissector("eth_withoutfcs"); diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c index 71e2d4ee06..e402f0b658 100644 --- a/plugins/ethercat/packet-ethercat-datagram.c +++ b/plugins/ethercat/packet-ethercat-datagram.c @@ -45,8 +45,6 @@ #include "packet-ethercat-datagram.h" #include "packet-ecatmb.h" -void proto_reg_handoff_ecat(void); - static heur_dissector_list_t heur_subdissector_list; static dissector_handle_t ecat_mailbox_handle; @@ -1707,7 +1705,7 @@ void proto_register_ecat(void) /* The registration hand-off routing */ void proto_reg_handoff_ecat(void) { - static dissector_handle_t ecat_handle; + dissector_handle_t ecat_handle; /* Register this dissector as a sub dissector to EtherCAT frame based on ether type. */ diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c index c2d5845795..4ab5920932 100644 --- a/plugins/ethercat/packet-ethercat-frame.c +++ b/plugins/ethercat/packet-ethercat-frame.c @@ -45,8 +45,6 @@ #include "packet-ethercat-frame.h" -void proto_reg_handoff_ethercat_frame(void); - /* Define the Ethercat frame proto */ static int proto_ethercat_frame = -1; @@ -166,9 +164,9 @@ void proto_register_ethercat_frame(void) void proto_reg_handoff_ethercat_frame(void) { - static dissector_handle_t ethercat_frame_handle; + dissector_handle_t ethercat_frame_handle; - ethercat_frame_handle = create_dissector_handle(dissect_ethercat_frame, proto_ethercat_frame); + ethercat_frame_handle = find_dissector("ecatf"); dissector_add("ethertype", ETHERTYPE_ECATF, ethercat_frame_handle); dissector_add("udp.port", ETHERTYPE_ECATF, ethercat_frame_handle); dissector_add("tcp.port", ETHERTYPE_ECATF, ethercat_frame_handle); diff --git a/plugins/ethercat/packet-ioraw.c b/plugins/ethercat/packet-ioraw.c index f045fc7cc5..c6fb808d86 100644 --- a/plugins/ethercat/packet-ioraw.c +++ b/plugins/ethercat/packet-ioraw.c @@ -44,8 +44,6 @@ #include "packet-ioraw.h" -void proto_reg_handoff_ioraw(void); - /* Define the ioraw proto */ int proto_ioraw = -1; @@ -127,7 +125,7 @@ void proto_register_ioraw(void) void proto_reg_handoff_ioraw(void) { - static dissector_handle_t ioraw_handle; + dissector_handle_t ioraw_handle; ioraw_handle = create_dissector_handle(dissect_ioraw, proto_ioraw); dissector_add("ecatf.type", 3, ioraw_handle); diff --git a/plugins/ethercat/packet-nv.c b/plugins/ethercat/packet-nv.c index eca2d27de5..49c7663b36 100644 --- a/plugins/ethercat/packet-nv.c +++ b/plugins/ethercat/packet-nv.c @@ -44,8 +44,6 @@ #include "packet-nv.h" -void proto_reg_handoff_nv(void); - /* Define the nv proto */ int proto_nv = -1; @@ -247,7 +245,7 @@ void proto_register_nv(void) void proto_reg_handoff_nv(void) { - static dissector_handle_t nv_handle; + dissector_handle_t nv_handle; nv_handle = create_dissector_handle(dissect_nv, proto_nv); dissector_add("ecatf.type", 4, nv_handle); |