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/profinet/packet-pn-rt.c | |
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/profinet/packet-pn-rt.c')
-rw-r--r-- | plugins/profinet/packet-pn-rt.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c index 4ee1237fa8..f9a7432829 100644 --- a/plugins/profinet/packet-pn-rt.c +++ b/plugins/profinet/packet-pn-rt.c @@ -51,10 +51,6 @@ #include "packet-pn.h" - - -void proto_reg_handoff_pn_rt(void); - /* Define the pn-rt proto */ static int proto_pn_rt = -1; @@ -418,7 +414,7 @@ proto_register_pn_rt(void) /* Register our configuration options */ - pn_rt_module = prefs_register_protocol(proto_pn_rt, proto_reg_handoff_pn_rt); + pn_rt_module = prefs_register_protocol(proto_pn_rt, NULL); prefs_register_bool_preference(pn_rt_module, "summary_in_tree", "Show PN-RT summary in protocol tree", @@ -432,23 +428,13 @@ proto_register_pn_rt(void) } -/* The registration hand-off routine - * Is called at startup, and everytime the preferences of this protocol changed. */ +/* The registration hand-off routine is called at startup */ void proto_reg_handoff_pn_rt(void) { - static int pn_rt_prefs_initialized = FALSE; - static dissector_handle_t pn_rt_handle; + dissector_handle_t pn_rt_handle; - - if (!pn_rt_prefs_initialized) { - pn_rt_handle = create_dissector_handle(dissect_pn_rt, proto_pn_rt); - pn_rt_prefs_initialized = TRUE; - } - else { - dissector_delete("ethertype", ETHERTYPE_PROFINET, pn_rt_handle); - dissector_delete("udp.port", 0x8892, pn_rt_handle); - } + pn_rt_handle = create_dissector_handle(dissect_pn_rt, proto_pn_rt); dissector_add("ethertype", ETHERTYPE_PROFINET, pn_rt_handle); dissector_add("udp.port", 0x8892, pn_rt_handle); |