Minor proto_reg_handoff cleanup: use find_dissector when appropriate.
authorBill Meier <wmeier@newsguy.com>
Tue, 30 Sep 2008 14:49:44 +0000 (14:49 -0000)
committerBill Meier <wmeier@newsguy.com>
Tue, 30 Sep 2008 14:49:44 +0000 (14:49 -0000)
svn path=/trunk/; revision=26308

30 files changed:
epan/dissectors/packet-dua.c
epan/dissectors/packet-epmd.c
epan/dissectors/packet-erf.c
epan/dissectors/packet-eth.c
epan/dissectors/packet-fr.c
epan/dissectors/packet-gprs-llc.c
epan/dissectors/packet-image-gif.c
epan/dissectors/packet-image-jfif.c
epan/dissectors/packet-imf.c
epan/dissectors/packet-ip.c
epan/dissectors/packet-iua.c
epan/dissectors/packet-kerberos4.c
epan/dissectors/packet-m3ua.c
epan/dissectors/packet-mpls.c
epan/dissectors/packet-ms-mms.c
epan/dissectors/packet-mtp3.c
epan/dissectors/packet-mtp3mg.c
epan/dissectors/packet-nt-sonmp.c
epan/dissectors/packet-pw-eth.c
epan/dissectors/packet-q933.c
epan/dissectors/packet-radiotap.c
epan/dissectors/packet-smpp.c
epan/dissectors/packet-smtp.c
epan/dissectors/packet-sua.c
epan/dissectors/packet-tapa.c
epan/dissectors/packet-tnef.c
epan/dissectors/packet-tpkt.c
epan/dissectors/packet-udp.c
epan/dissectors/packet-usb-masstorage.c
epan/dissectors/packet-wbxml.c

index 4291440d157fa4aa54a557f99a479d043750a502..d3908d9ebc1da260d85055c9c0b3e2ee56d4fa2f 100644 (file)
@@ -768,7 +768,7 @@ proto_reg_handoff_dua(void)
 {
   dissector_handle_t dua_handle;
 
-  dua_handle  = create_dissector_handle(dissect_dua, proto_dua);
+  dua_handle  = find_dissector("dua");
   data_handle = find_dissector("data");
   dpnss_handle = find_dissector("dpnss");
   dissector_add("sctp.ppi", DUA_PAYLOAD_PROTOCOL_ID, dua_handle);
index 1a6b5f28dfb23e46812ac6e507b20ea0d8681c36..f5ad02d769a1b997f1577feb621664610c2437ac 100644 (file)
@@ -316,6 +316,6 @@ void
 proto_reg_handoff_epmd(void)
 {
     dissector_handle_t epmd_handle;
-    epmd_handle = new_create_dissector_handle(dissect_epmd, proto_epmd);
+    epmd_handle = find_dissector("epmd");
     dissector_add("tcp.port", EPMD_PORT, epmd_handle);
 }
index 624a1ae8440cbd1d5e8efdf889cba18dc5dd1245..49a208dbb61004ac982f6ccea594f2080ac1ab44 100644 (file)
@@ -1228,7 +1228,7 @@ proto_reg_handoff_erf(void)
 {
   dissector_handle_t erf_handle;
 
-  erf_handle = create_dissector_handle(dissect_erf, proto_erf);
+  erf_handle = find_dissector("erf");
   dissector_add("wtap_encap", WTAP_ENCAP_ERF, erf_handle);
 
   /* Dissector called to dump raw data, or unknown protocol */
index 94d187e8eb2b4a96b8668ada2f144048046bbad6..c37ad8ab63b99514c95bea669e064b850cf38d32 100644 (file)
@@ -559,8 +559,7 @@ proto_reg_handoff_eth(void)
         */
        fw1_handle = find_dissector("fw1");
 
-       eth_maybefcs_handle = create_dissector_handle(dissect_eth_maybefcs,
-           proto_eth);
+       eth_maybefcs_handle = find_dissector("eth");
        dissector_add("wtap_encap", WTAP_ENCAP_ETHERNET, eth_maybefcs_handle);
 
        eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
index 6ed77b671fd3046bcbf9f6e5fbe09c0cdd82d397..3a4825553a18b41dea18357be76cbca87b069bb2 100644 (file)
@@ -942,7 +942,7 @@ void proto_reg_handoff_fr(void)
 {
   dissector_handle_t fr_handle, fr_phdr_handle;
 
-  fr_handle = create_dissector_handle(dissect_fr, proto_fr);
+  fr_handle = find_dissector("fr");
   dissector_add("gre.proto", ETHERTYPE_RAW_FR, fr_handle);
   dissector_add("wtap_encap", WTAP_ENCAP_FRELAY, fr_handle);
 
index a08a7e3f0438824df794771b130985aef23f72fe..e4ff86518c94e53b25086fac1e79ef5ab473d927 100644 (file)
@@ -1312,7 +1312,7 @@ proto_reg_handoff_llcgprs(void)
        dissector_handle_t gprs_llc_handle;
 
        /* make sure that the top level can call this dissector */
-       gprs_llc_handle = create_dissector_handle(dissect_llcgprs, proto_llcgprs);
+       gprs_llc_handle = find_dissector("llcgprs");
        dissector_add("wtap_encap", WTAP_ENCAP_GPRS_LLC, gprs_llc_handle);
 
        data_handle = find_dissector("data");
index 4ae5efb7ccd521e93f8017eed5eb4759d0357574..363090b64a5d60964b8305c6424cc1836804e62e 100644 (file)
@@ -695,7 +695,7 @@ proto_reg_handoff_gif(void)
 {
        dissector_handle_t gif_handle;
 
-       gif_handle = create_dissector_handle(dissect_gif, proto_gif);
+       gif_handle = find_dissector("image-gif");
 
        /* Register the GIF media type */
        dissector_add_string("media_type", "image/gif", gif_handle);
index 44415c36b39b3396499c600dd92bba1498a96154..f9b8f14267175bdeb2eea9e27fee93e6f3dddd15 100644 (file)
@@ -1214,7 +1214,7 @@ proto_reg_handoff_jfif(void)
 {
        dissector_handle_t jfif_handle;
 
-       jfif_handle = create_dissector_handle(dissect_jfif, proto_jfif);
+       jfif_handle = find_dissector("image-jfif");
 
        /* Register the JPEG media type */
        dissector_add_string("media_type", "image/jfif", jfif_handle);
index 02b741431b166dc2a88f332e28f574e9a494edd6..5bcbd82fca9bb94fe92bd541b8412b62e5580356 100644 (file)
@@ -902,7 +902,7 @@ proto_reg_handoff_imf(void)
 {
   dissector_handle_t imf_handle;
 
-  imf_handle = create_dissector_handle(dissect_imf, proto_imf);
+  imf_handle = find_dissector(PFNAME);
 
   dissector_add_string("media_type",
                       "message/rfc822", imf_handle);
index c6e05a6ab33ebff1ea883d1886e8552f0ebe5e46..779a2d119cd76b545febd231ffb19307c5f9f4b0 100644 (file)
@@ -2771,6 +2771,6 @@ proto_reg_handoff_icmp(void)
   ip_handle = find_dissector("ip");
   ipv6_handle = find_dissector("ipv6");
 
-  icmp_handle = create_dissector_handle(dissect_icmp, proto_icmp);
+  icmp_handle = find_dissector("icmp");
   dissector_add("ip.proto", IP_PROTO_ICMP, icmp_handle);
 }
index 86415e84cfda9d7a214af6016ac10ab2885577b9..deb5ecf16bf91cfb7b414685b1431ecad3e02ae2 100644 (file)
@@ -962,7 +962,7 @@ proto_reg_handoff_iua(void)
 {
   dissector_handle_t iua_handle;
 
-  iua_handle  = create_dissector_handle(dissect_iua, proto_iua);
+  iua_handle  = find_dissector("iua");
   q931_handle = find_dissector("q931");
   x25_handle  = find_dissector("x.25");
 
index ff35d754854a2263dbd1961f47783098005ee6b4..5ca393113d48d764d904b6d17357c436e27f1150 100644 (file)
@@ -457,6 +457,6 @@ proto_reg_handoff_krb4(void)
 {
   dissector_handle_t krb4_handle;
 
-  krb4_handle = new_create_dissector_handle(dissect_krb4, proto_krb4);
+  krb4_handle = find_dissector("krb4");
   dissector_add("udp.port", UDP_PORT_KRB4, krb4_handle);
 }
index 9d032030cae0b99661cf8ba5061f5a8724ba9174..6aed04015df7fb29ed6cb2e57ebe73ac9fd3d24c 100644 (file)
@@ -2058,7 +2058,7 @@ proto_reg_handoff_m3ua(void)
    */
   mtp3_handle = find_dissector("mtp3");
   data_handle = find_dissector("data");
-  m3ua_handle = create_dissector_handle(dissect_m3ua, proto_m3ua);
+  m3ua_handle = find_dissector("m3ua");
   dissector_add("sctp.ppi",  M3UA_PAYLOAD_PROTOCOL_ID, m3ua_handle);
   dissector_add("sctp.port", SCTP_PORT_M3UA, m3ua_handle);
 
index 705de9ea00653fb2cea3ed877a277fbffff84d9b..0a244ca14f8eda063108914eab0b1d5a9baeb8db 100644 (file)
@@ -711,7 +711,7 @@ proto_reg_handoff_mpls(void)
         data_handle = find_dissector("data");
         ppp_subdissector_table = find_dissector_table("ppp.protocol");
 
-       mpls_handle = create_dissector_handle(dissect_mpls, proto_mpls);
+       mpls_handle = find_dissector("mpls");
        dissector_add("ethertype", ETHERTYPE_MPLS, mpls_handle);
        dissector_add("ethertype", ETHERTYPE_MPLS_MULTI, mpls_handle);
        dissector_add("ppp.protocol", PPP_MPLS_UNI, mpls_handle);
index ae2e74fb54a0dec36ea6b2f25820904c4b64cf2c..c84a7e1e750104a4cb0cb27549b3ff0a9fd4c9f3 100644 (file)
@@ -1975,8 +1975,7 @@ void proto_register_msmms(void)
 
 void proto_reg_handoff_msmms_command(void)
 {
-    msmms_handle = new_create_dissector_handle(dissect_msmms_pdu, proto_msmms);
-
+    msmms_handle = find_dissector("msmms");
     /* Control commands using TCP port */
     dissector_add("tcp.port", MSMMS_PORT, msmms_handle);
     /* Data command(s) using UDP port */
index 57a599b46de84f8c5688dc513a12e684c2a27d50..bf14d054eb7be7e895b71c763670ebdbca247f4a 100644 (file)
@@ -831,8 +831,7 @@ proto_reg_handoff_mtp3(void)
 {
   dissector_handle_t mtp3_handle;        
          
-  mtp3_handle = create_dissector_handle(dissect_mtp3, proto_mtp3);       
-                 
+  mtp3_handle = find_dissector("mtp3");               
   dissector_add("wtap_encap", WTAP_ENCAP_MTP3, mtp3_handle);     
   dissector_add_string("tali.opcode", "mtp3", mtp3_handle);
                  
index 3e5157e7e175f34f699ba192ebcba57cdc205c96..107f437aa118d9e3f071d55cc4b05dd9aa164c09 100644 (file)
@@ -1532,7 +1532,7 @@ proto_reg_handoff_mtp3mg(void)
 {
     dissector_handle_t mtp3mg_handle;
 
-    mtp3mg_handle = create_dissector_handle(dissect_mtp3mg, proto_mtp3mg);
+    mtp3mg_handle = find_dissector("mtp3mg");
 
     dissector_add("mtp3.service_indicator", MTP3MG_SI, mtp3mg_handle);
 
index eac62d972f0a196c2332d7db35b1f5282bf35946..a616e6692153a5d07d1542232320086958258de4 100644 (file)
@@ -317,7 +317,7 @@ proto_reg_handoff_sonmp(void)
 {
        dissector_handle_t sonmp_handle;
        
-       sonmp_handle = create_dissector_handle(dissect_sonmp, proto_sonmp);
+       sonmp_handle = find_dissector("sonmp");
        
        dissector_add("llc.nortel_pid", 0x01a1, sonmp_handle); /* flatnet hello */
        dissector_add("llc.nortel_pid", 0x01a2, sonmp_handle); /* Segment hello */ 
index d9dd6e7ab7fb69a824ebe3cc57c06e13c48847f9..9a6db5ba61864e85eb07c570a1370326b2f9e88d 100644 (file)
@@ -150,9 +150,8 @@ proto_reg_handoff_pw_eth(void)
 
        eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
 
-       pw_eth_handle = create_dissector_handle(dissect_pw_eth, proto_pw_eth);
+       pw_eth_handle = find_dissector("pw_eth");
        dissector_add("mpls.label", LABEL_INVALID, pw_eth_handle);
-       pw_eth_handle_nocw = create_dissector_handle(dissect_pw_eth_nocw, 
-                                                    proto_pw_eth_nocw);
+       pw_eth_handle_nocw = find_dissector("pw_eth_nocw");
        dissector_add("mpls.label", LABEL_INVALID, pw_eth_handle_nocw);
 }
index e02851533c5f5f76c0a9ad85121b790e5cf8e7f4..ea966b593d80e4ffb8261c81284870e40a3b8643 100644 (file)
@@ -2280,6 +2280,6 @@ proto_reg_handoff_q933(void)
 {
        dissector_handle_t q933_handle;
 
-       q933_handle = create_dissector_handle(dissect_q933, proto_q933);
+       q933_handle = find_dissector("q933");
        dissector_add("fr.osinl", NLPID_Q_933, q933_handle);
 }
index 14ecae904e53ab73d1870499ca09f56d3f5455bc..5757de3c1b328c1cf3e7377021f5d527ca68b478 100644 (file)
@@ -1289,7 +1289,7 @@ proto_reg_handoff_radiotap(void)
     ieee80211_handle = find_dissector("wlan");
     ieee80211_datapad_handle = find_dissector("wlan_datapad");
 
-    radiotap_handle = create_dissector_handle(dissect_radiotap, proto_radiotap);
+    radiotap_handle = find_dissector("radiotap");
 
     dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11_WLAN_RADIOTAP, radiotap_handle);
 }
index 999e49d55c634d78b5e483d62f08e823ab44d134..9188c6e99d5cc71a887d4e024427388e4532c5ab 100644 (file)
@@ -3425,7 +3425,7 @@ proto_reg_handoff_smpp(void)
      * to specify that a given X.25 circuit is to be dissected as SMPP,
      * however.
      */
-    smpp_handle = create_dissector_handle(dissect_smpp, proto_smpp);
+    smpp_handle = find_dissector("smpp");
     dissector_add_handle("tcp.port", smpp_handle);
     heur_dissector_add("tcp", dissect_smpp_heur, proto_smpp);
     heur_dissector_add("x.25", dissect_smpp_heur, proto_smpp);
index 7009f0cbc586d2a53c80847ac106da0a31b789c0..e1e018191a558ef55def4333074e60bdd9621e62 100644 (file)
@@ -908,7 +908,7 @@ proto_reg_handoff_smtp(void)
 {
   dissector_handle_t smtp_handle;
 
-  smtp_handle = create_dissector_handle(dissect_smtp, proto_smtp);
+  smtp_handle = find_dissector("smtp");
   dissector_add("tcp.port", TCP_PORT_SMTP, smtp_handle);
   dissector_add("tcp.port", TCP_PORT_SUBMISSION, smtp_handle);
 
index 37c49b869c74249cb5a51c26ce4bd76befdbfa83..8663e0e6243b318ed44967f3da786ca343bc7880 100644 (file)
@@ -2111,7 +2111,7 @@ proto_reg_handoff_sua(void)
 {
   dissector_handle_t sua_handle;
 
-  sua_handle = create_dissector_handle(dissect_sua, proto_sua);
+  sua_handle = find_dissector("sua");
   dissector_add("sctp.ppi",  SUA_PAYLOAD_PROTOCOL_ID, sua_handle);
   dissector_add("sctp.port", SCTP_PORT_SUA,           sua_handle);
 
index df5527caef9caa2c2d70d5b3243e9410e2b9a630..6a3798df5cdd32daf774f0e22200299677d0fed0 100644 (file)
@@ -619,7 +619,7 @@ proto_reg_handoff_tapa(void)
 {
        dissector_handle_t tapa_handle;
 
-       tapa_handle = new_create_dissector_handle(dissect_tapa_static, proto_tapa);
+       tapa_handle = find_dissector("tapa");
        dissector_add("udp.port", PORT_TAPA, tapa_handle);
 }
 
index e559a67990e28e43f723dc826e47d8b2e94e699c..597224950625cfb3289c9430dfb55a5bb3f53ff7 100644 (file)
@@ -812,8 +812,7 @@ proto_reg_handoff_tnef(void)
 {
   dissector_handle_t tnef_handle;
 
-  tnef_handle = create_dissector_handle(dissect_tnef, proto_tnef);
-
+  tnef_handle = find_dissector(PFNAME);
   dissector_add_string("media_type", "application/ms-tnef", tnef_handle);
 
   /* X.400 file transfer bodypart */
index 358e6888296fc1cb4a217696dcb0a2d7f7a92cc3..a5750b576594ea1781e34a9b3d9b1f7ca28f6236 100644 (file)
@@ -665,19 +665,19 @@ proto_register_tpkt(void)
 void
 proto_reg_handoff_tpkt(void)
 {
-       dissector_handle_t tpkt_handle;
+       dissector_handle_t tpkt_handle, tpkt_x224_handle;
 
        osi_tp_handle = find_dissector("ositp");
-       tpkt_handle = create_dissector_handle(dissect_tpkt, proto_tpkt);
+       tpkt_handle = find_dissector("tpkt");
        dissector_add("tcp.port", TCP_PORT_TPKT, tpkt_handle);
 
        x224_handle = find_dissector("x224");
-       tpkt_handle = create_dissector_handle(dissect_tpkt_x224, proto_tpkt);
-       dissector_add("tcp.port", TCP_PORT_TPKT_X224, tpkt_handle);
+       tpkt_x224_handle = create_dissector_handle(dissect_tpkt_x224, proto_tpkt);
+       dissector_add("tcp.port", TCP_PORT_TPKT_X224, tpkt_x224_handle);
        
        /*
-       tpkt_handle = create_dissector_handle(dissect_ascii_tpkt, proto_tpkt);
-       dissector_add("tcp.port", TCP_PORT_TPKT, tpkt_handle);
+       tpkt_ascii_handle = create_dissector_handle(dissect_ascii_tpkt, proto_tpkt);
+       dissector_add("tcp.port", TCP_PORT_TPKT, tpkt_ascii_handle);
        */
        
 }
index 6d92266d4d5a3215e97a37f356b26dba29284ed3..229b101bb577590541f64eaae563cf04446df10b 100644 (file)
@@ -544,7 +544,7 @@ proto_reg_handoff_udp(void)
        dissector_handle_t udp_handle;
        dissector_handle_t udplite_handle;
 
-       udp_handle = create_dissector_handle(dissect_udp, proto_udp);
+       udp_handle = find_dissector("udp");
        dissector_add("ip.proto", IP_PROTO_UDP, udp_handle);
        udplite_handle = create_dissector_handle(dissect_udplite, proto_udplite);
        dissector_add("ip.proto", IP_PROTO_UDPLITE, udplite_handle);
index 031e6eac4b14d715fa02989f7b515ec6733526c7..6685b62aa0190d696fbcd9fbfaabfcc11cbe66ce 100644 (file)
@@ -448,7 +448,7 @@ proto_reg_handoff_usb_ms(void)
     dissector_handle_t usb_ms_bulk_handle;
     dissector_handle_t usb_ms_control_handle;
 
-    usb_ms_bulk_handle = create_dissector_handle(dissect_usb_ms_bulk, proto_usb_ms);
+    usb_ms_bulk_handle = find_dissector("usbms");
     dissector_add("usb.bulk", IF_CLASS_MASSTORAGE, usb_ms_bulk_handle);
 
     usb_ms_control_handle = new_create_dissector_handle(dissect_usb_ms_control, proto_usb_ms);
index b80a050793e8bd76adbdc9d3191b8b741d450014..4c763b31243ce5873e04f662743251c9c51321b2 100644 (file)
@@ -8339,7 +8339,7 @@ proto_reg_handoff_wbxml(void)
         * heur_dissector_add("wsp", dissect_wbxml_heur, proto_wbxml);
         */
 
-       wbxml_handle = create_dissector_handle(dissect_wbxml, proto_wbxml);
+       wbxml_handle = find_dissector("wbxml");
 
        /* Register the WSP content types (defined as protocol port)
         * for WBXML dissection.