Minor cleanup for proto_reg-handoff & etc
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 27 Sep 2008 14:02:23 +0000 (14:02 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 27 Sep 2008 14:02:23 +0000 (14:02 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26285 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-esis.c
epan/dissectors/packet-ftp.c
epan/dissectors/packet-gssapi.c
epan/dissectors/packet-l1-events.c
epan/dissectors/packet-smb.c
epan/dissectors/packet-text-media.c

index c19d03d12bd26e17f08ac98b67b11cc40f949a7b..cf981f831e12428e4700ea163908dda227a4acd2 100644 (file)
@@ -439,6 +439,7 @@ proto_register_esis(void) {
   proto_esis = proto_register_protocol( PROTO_STRING_ESIS, "ESIS", "esis");
   proto_register_field_array(proto_esis, hf, array_length(hf));
   proto_register_subtree_array(ett, array_length(ett));
+  register_dissector("esis", dissect_esis, proto_esis);
 }
 
 void
@@ -446,7 +447,6 @@ proto_reg_handoff_esis(void)
 {
   dissector_handle_t esis_handle;
 
-  esis_handle = create_dissector_handle(dissect_esis, proto_esis);
-  register_dissector("esis", dissect_esis, proto_esis);
+  esis_handle = find_dissector("esis");
   dissector_add("osinl", NLPID_ISO9542_ESIS, esis_handle);
 }
index 37d2d56cd8d1327ad32fc745ddf7da22e14be8b5..b03a826a59a180b0a3f58386e217f0ca07ef2586 100644 (file)
@@ -735,17 +735,15 @@ proto_register_ftp(void)
   register_dissector("ftp-data", dissect_ftpdata, proto_ftp_data);
   proto_register_field_array(proto_ftp, hf, array_length(hf));
   proto_register_subtree_array(ett, array_length(ett));
-
-  ftpdata_handle = create_dissector_handle(dissect_ftpdata, proto_ftp_data);
 }
 
 void
 proto_reg_handoff_ftp(void)
 {
-  dissector_handle_t ftpdata_handle, ftp_handle;
+  dissector_handle_t ftp_handle;
 
-  ftpdata_handle = create_dissector_handle(dissect_ftpdata, proto_ftp_data);
+  ftpdata_handle = find_dissector("ftp-data");
   dissector_add("tcp.port", TCP_PORT_FTPDATA, ftpdata_handle);
-  ftp_handle = create_dissector_handle(dissect_ftp, proto_ftp);
+  ftp_handle = find_dissector("ftp");
   dissector_add("tcp.port", TCP_PORT_FTP, ftp_handle);
 }
index 87d52afff8f0f974d20fa578a37c110436ddecb7..3b3aced2a6265c1ac7c1ed71dc9ec9dbb92ebad3 100644 (file)
@@ -111,7 +111,7 @@ gssapi_reassembly_init(void)
  * Subdissectors
  */
 
-static dissector_handle_t ntlmssp_handle = NULL;
+static dissector_handle_t ntlmssp_handle;
 
 static GHashTable *gssapi_oids;
 
@@ -629,6 +629,6 @@ proto_reg_handoff_gssapi(void)
                                          DCE_C_RPC_AUTHN_PROTOCOL_SPNEGO,
                                          &gssapi_auth_fns);
 
-       gssapi_handle = create_dissector_handle(dissect_gssapi, proto_gssapi);
+       gssapi_handle = find_dissector("gssapi");
        dissector_add_string("dns.tsig.mac", "gss.microsoft.com", gssapi_handle);
 }
index e393509b1b5870ec0fd240fe04824e5fe65a1fd5..40c15647fd7b1a7f77c9b141d54eb70ae9968931 100644 (file)
@@ -51,9 +51,6 @@ static gint proto_l1_events = -1;
 /* Subtrees */
 static gint ett_l1_events = -1;
 
-/* Dissector handles */
-static dissector_handle_t l1_events_handle;
-
 static void
 dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -138,15 +135,14 @@ proto_register_l1_events(void)
                        "Layer 1 Event Messages", /* Long name */
                        "Layer 1 Events",         /* Short name */
                        "data-l1-events");              /* Filter name */
-       register_dissector("data-l1-events", dissect_l1_events, 
-                          proto_l1_events);
+       register_dissector("data-l1-events", dissect_l1_events, proto_l1_events);
 }
 
 void
 proto_reg_handoff_l1_events(void)
 {
-       l1_events_handle = create_dissector_handle(
-                                       dissect_l1_events, proto_l1_events);
+       dissector_handle_t l1_events_handle;
 
+       l1_events_handle = find_dissector("data-l1-events");
         dissector_add("wtap_encap", WTAP_ENCAP_LAYER1_EVENT, l1_events_handle); /* for text msgs from trace files */
 }
index f13b33b8018c6a38cbf48b5166ab3c087462cfb5..66c0e050db38d9800feae741a0af92524cbdefa8 100644 (file)
@@ -753,8 +753,8 @@ static gint ett_smb_posix_ace_perms = -1;
 
 static int smb_tap = -1;
 
-static dissector_handle_t gssapi_handle = NULL;
-static dissector_handle_t ntlmssp_handle = NULL;
+static dissector_handle_t gssapi_handle;
+static dissector_handle_t ntlmssp_handle;
 
 static const fragment_items smb_frag_items = {
        &ett_smb_segment,
@@ -19233,10 +19233,10 @@ proto_reg_handoff_smb(void)
        heur_dissector_add("netbios", dissect_smb_heur, proto_smb);
        heur_dissector_add("cotp", dissect_smb_heur, proto_smb);
        heur_dissector_add("vines_spp", dissect_smb_heur, proto_smb);
-       smb_handle = create_dissector_handle(dissect_smb, proto_smb);
+
+       smb_handle = find_dissector("smb");
        dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_SERVER, smb_handle);
        dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_REDIR, smb_handle);
-       dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_MESSENGER,
-           smb_handle);
+       dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_MESSENGER, smb_handle);
        dissector_add("spp.socket", IDP_SOCKET_SMB, smb_handle);
 }
index d4b6be5746643d268036ffe4c4162c8d5439dcf2..421fce3d681e24811ad0c56d672f18b3f21ca86c 100644 (file)
@@ -56,9 +56,6 @@ static gint proto_text_lines = -1;
 /* Subtrees */
 static gint ett_text_lines = -1;
 
-/* Dissector handles */
-static dissector_handle_t text_lines_handle;
-
 static void
 dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -140,8 +137,9 @@ proto_register_text_lines(void)
 void
 proto_reg_handoff_text_lines(void)
 {
-       text_lines_handle = create_dissector_handle(
-                                       dissect_text_lines, proto_text_lines);
+       dissector_handle_t text_lines_handle;
+
+       text_lines_handle = find_dissector("data-text-lines");
 
        dissector_add_string("media_type", "text/plain", text_lines_handle); /* RFC 2046 */
        dissector_add_string("media_type", "text/richtext", text_lines_handle);  /* RFC 1341 */