Minor proto_reg_handoff cleanup: use find_dissector when appropriate.

svn path=/trunk/; revision=26308
This commit is contained in:
Bill Meier 2008-09-30 14:49:44 +00:00
parent 09bef39f3d
commit aa30dcd129
30 changed files with 36 additions and 41 deletions

View 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);

View 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);
}

View 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 */

View 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");

View 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);

View 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");

View 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);

View 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);

View 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);

View 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);
}

View 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");

View 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);
}

View 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);

View 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);

View 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 */

View 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);

View 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);

View 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 */

View 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);
}

View 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);
}

View 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);
}

View 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);

View 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);

View 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);

View 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);
}

View 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 */

View 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);
*/
}

View 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);

View 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);

View 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.