diff options
Diffstat (limited to 'epan/dissectors/packet-dns.c')
-rw-r--r-- | epan/dissectors/packet-dns.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index e6d72e21e4..d0a018666d 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -4048,19 +4048,30 @@ static int dns_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_di void proto_reg_handoff_dns(void) { - dissector_handle_t dns_sctp_handle; - dissector_handle_t mdns_udp_handle; - dissector_handle_t llmnr_udp_handle; - static range_t *dns_tcp_port_range; static range_t *dns_udp_port_range; static gboolean Initialized = FALSE; if (!Initialized) { + dissector_handle_t dns_sctp_handle; + dissector_handle_t mdns_udp_handle; + dissector_handle_t llmnr_udp_handle; + dns_udp_handle = create_dissector_handle(dissect_dns_udp, proto_dns); - dns_tcp_handle = new_create_dissector_handle(dissect_dns_tcp, proto_dns); + dns_sctp_handle = create_dissector_handle(dissect_dns_sctp, proto_dns); + mdns_udp_handle = create_dissector_handle(dissect_mdns_udp, proto_mdns); + llmnr_udp_handle = create_dissector_handle(dissect_llmnr_udp, proto_llmnr); + dissector_add_uint("udp.port", UDP_PORT_MDNS, mdns_udp_handle); + dissector_add_uint("tcp.port", TCP_PORT_MDNS, dns_tcp_handle); + dissector_add_uint("udp.port", UDP_PORT_LLMNR, llmnr_udp_handle); + dissector_add_uint("sctp.port", SCTP_PORT_DNS, dns_sctp_handle); +#if 0 + dissector_add_uint("sctp.ppi", DNS_PAYLOAD_PROTOCOL_ID, dns_sctp_handle); +#endif stats_tree_register("dns", "dns", "DNS", 0, dns_stats_tree_packet, dns_stats_tree_init, NULL); + gssapi_handle = find_dissector("gssapi"); + ntlmssp_handle = find_dissector("ntlmssp"); Initialized = TRUE; } else { @@ -4074,21 +4085,6 @@ proto_reg_handoff_dns(void) dns_udp_port_range = range_copy(global_dns_udp_port_range); dissector_add_uint_range("tcp.port", dns_tcp_port_range, dns_tcp_handle); dissector_add_uint_range("udp.port", dns_udp_port_range, dns_udp_handle); - - dns_sctp_handle = create_dissector_handle(dissect_dns_sctp, proto_dns); - mdns_udp_handle = create_dissector_handle(dissect_mdns_udp, proto_mdns); - llmnr_udp_handle = create_dissector_handle(dissect_llmnr_udp, proto_llmnr); - - dissector_add_uint("udp.port", UDP_PORT_MDNS, mdns_udp_handle); - dissector_add_uint("tcp.port", TCP_PORT_MDNS, dns_tcp_handle); - dissector_add_uint("udp.port", UDP_PORT_LLMNR, llmnr_udp_handle); - dissector_add_uint("sctp.port", SCTP_PORT_DNS, dns_sctp_handle); -#if 0 - dissector_add_uint("sctp.ppi", DNS_PAYLOAD_PROTOCOL_ID, dns_sctp_handle); -#endif - - gssapi_handle = find_dissector("gssapi"); - ntlmssp_handle = find_dissector("ntlmssp"); } void @@ -5566,6 +5562,8 @@ proto_register_dns(void) dns_tsig_dissector_table = register_dissector_table("dns.tsig.mac", "DNS TSIG MAC Dissectors", FT_STRING, BASE_NONE, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); + dns_tcp_handle = new_register_dissector("dns", dissect_dns_tcp, proto_dns); + dns_tap = register_tap("dns"); } |