From 017f36d61bd8f72f3eb06f962245385dc0a5ed38 Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Tue, 4 Nov 2008 22:01:35 +0000 Subject: Minor cleanup mostly related to proto_reg_handoff Remove code for unused handles; Localize handles to proto_reg_handoff as appropriate; Localize "saved_prefs" to proto_reg_handoff; In some cases: move "once-only" code in proto_reg_handoff so that it's executed only the first time thru proto_reg_handoff; Properly delete/add port when pref changed (packet_ulp); svn path=/trunk/; revision=26697 --- asn1/sabp/packet-sabp-template.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'asn1/sabp') diff --git a/asn1/sabp/packet-sabp-template.c b/asn1/sabp/packet-sabp-template.c index c70e4eb8b9..5fcca687e2 100644 --- a/asn1/sabp/packet-sabp-template.c +++ b/asn1/sabp/packet-sabp-template.c @@ -56,9 +56,6 @@ #include "packet-sabp-val.h" -static dissector_handle_t sabp_handle = NULL; -static dissector_handle_t sabp_tcp_handle = NULL; - /* Initialize the protocol and registered fields */ static int proto_sabp = -1; @@ -200,8 +197,6 @@ void proto_register_sabp(void) { /* Register dissector */ register_dissector("sabp", dissect_sabp, proto_sabp); register_dissector("sabp.tcp", dissect_sabp_tcp, proto_sabp); - sabp_handle = find_dissector("sabp"); - sabp_tcp_handle = find_dissector("sabp.tcp"); /* Register dissector tables */ sabp_ies_dissector_table = register_dissector_table("sabp.ies", "SABP-PROTOCOL-IES", FT_UINT32, BASE_DEC); @@ -217,14 +212,16 @@ void proto_register_sabp(void) { void proto_reg_handoff_sabp(void) { + dissector_handle_t sabp_handle; + dissector_handle_t sabp_tcp_handle; + sabp_handle = find_dissector("sabp"); + sabp_tcp_handle = find_dissector("sabp.tcp"); + dissector_add("udp.port", 3452, sabp_handle); + dissector_add("tcp.port", 3452, sabp_tcp_handle); #include "packet-sabp-dis-tab.c" - sabp_handle = find_dissector("sabp"); - dissector_add("tcp.port", 3452, sabp_tcp_handle); - dissector_add("udp.port", 3452, sabp_handle); - dissector_add_handle("tcp.port", sabp_tcp_handle); } -- cgit v1.2.3