From: Denis Ovsienko Date: Mon, 13 Jul 2015 09:12:03 +0000 (+0100) Subject: refine use of nameser.h X-Git-Tag: tcpdump-4.8.0~214 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/3ba4165c4b7cc369c9b7809a8f106cad0926c02c refine use of nameser.h Move the port number #define's to the TCP and UDP files such that they don't require nameser.h anymore. Update the TCP printer to disregard the multicast DNS port as it is UDP-only. --- diff --git a/nameser.h b/nameser.h index 11e71ef8..e075f092 100644 --- a/nameser.h +++ b/nameser.h @@ -70,20 +70,6 @@ /* number of bytes of fixed size data in resource record */ #define RRFIXEDSZ 10 -/* - * Internet nameserver port number - */ -#define NAMESERVER_PORT 53 - -/* - * Port for multicast DNS; see - * - * http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt - * - * for the current mDNS spec. - */ -#define MULTICASTDNS_PORT 5353 - /* * Currently defined opcodes */ diff --git a/print-tcp.c b/print-tcp.c index 34678a17..0cc338d6 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -51,8 +51,6 @@ __RCSID("$NetBSD: print-tcp.c,v 1.8 2007/07/24 11:53:48 drochner Exp $"); #include "rpc_auth.h" #include "rpc_msg.h" -#include "nameser.h" - #ifdef HAVE_LIBCRYPTO #include #include "signature.h" @@ -700,8 +698,7 @@ tcp_print(netdissect_options *ndo, ND_PRINT((ndo, ": ")); rtsp_print(ndo, bp, length); } else if (length > 2 && - (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT || - sport == MULTICASTDNS_PORT || dport == MULTICASTDNS_PORT)) { + (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT)) { /* * TCP DNS query has 2byte length at the head. * XXX packet could be unaligned, it can go strange diff --git a/print-udp.c b/print-udp.c index dc161abf..1e02f2ea 100644 --- a/print-udp.c +++ b/print-udp.c @@ -40,7 +40,6 @@ #include "rpc_auth.h" #include "rpc_msg.h" -#include "nameser.h" #include "nfs.h" struct rtcphdr { diff --git a/tcp.h b/tcp.h index e8c8d2ca..2e588016 100644 --- a/tcp.h +++ b/tcp.h @@ -97,6 +97,9 @@ struct tcphdr { #ifndef SMTP_PORT #define SMTP_PORT 25 #endif +#ifndef NAMESERVER_PORT +#define NAMESERVER_PORT 53 +#endif #ifndef BGP_PORT #define BGP_PORT 179 #endif diff --git a/udp.h b/udp.h index 743ddfaf..1bdc923b 100644 --- a/udp.h +++ b/udp.h @@ -44,6 +44,7 @@ struct udphdr { uint16_t uh_sum; /* udp checksum */ }; +#define NAMESERVER_PORT 53 #define BOOTPS_PORT 67 /* RFC951 */ #define BOOTPC_PORT 68 /* RFC951 */ #define TFTP_PORT 69 /*XXX*/ @@ -86,6 +87,7 @@ struct udphdr { #define BFD_CONTROL_PORT 3784 /* draft-katz-ward-bfd-v4v6-1hop-00.txt */ #define BFD_ECHO_PORT 3785 /* draft-katz-ward-bfd-v4v6-1hop-00.txt */ #define WB_PORT 4567 +#define MULTICASTDNS_PORT 5353 /* RFC 6762 */ #define SFLOW_PORT 6343 /* http://www.sflow.org/developers/specifications.php */ #define LWAPP_DATA_PORT 12222 /* RFC 5412 */ #define LWAPP_CONTROL_PORT 12223 /* RFC 5412 */