]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Clean up the port definitions.
authorGuy Harris <[email protected]>
Tue, 14 Jul 2015 20:39:07 +0000 (13:39 -0700)
committerGuy Harris <[email protected]>
Tue, 14 Jul 2015 20:39:22 +0000 (13:39 -0700)
From Bill Parker: sort the port definitions, add some additional
ports, and use #ifndef/#endif around all definitions.

From me: use consistent indentation, add the RFCs for NetBIOS-over-TCP
to the #defines for the NBT ports, and don't keep the IPv6 ports
separate.

tcp.h
udp.h

diff --git a/tcp.h b/tcp.h
index 2e58801625960ebb8154d3b78a40d74001fd741b..716f986b81795ad2c246fb104650f7770c3f0816 100644 (file)
--- a/tcp.h
+++ b/tcp.h
@@ -91,50 +91,63 @@ struct tcphdr {
 #define TCPOPT_TSTAMP_HDR      \
     (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
 
+#ifndef FTP_PORT
+#define FTP_PORT               21
+#endif
+#ifndef SSH_PORT
+#define SSH_PORT               22
+#endif
 #ifndef TELNET_PORT
-#define TELNET_PORT             23
+#define TELNET_PORT            23
 #endif
 #ifndef SMTP_PORT
 #define SMTP_PORT              25
 #endif
 #ifndef NAMESERVER_PORT
-#define NAMESERVER_PORT         53
+#define NAMESERVER_PORT                53
+#endif
+#ifndef HTTP_PORT
+#define HTTP_PORT              80
+#endif
+#ifndef NETBIOS_SSN_PORT
+#define NETBIOS_SSN_PORT       139     /* RFC 1001, RFC 1002 */
 #endif
 #ifndef BGP_PORT
-#define BGP_PORT                179
+#define BGP_PORT               179
 #endif
-#define NETBIOS_SSN_PORT        139
-#ifndef OPENFLOW_PORT_OLD
-#define OPENFLOW_PORT_OLD       6633
+#ifndef RPKI_RTR_PORT
+#define RPKI_RTR_PORT          323
 #endif
-#ifndef OPENFLOW_PORT_IANA
-#define OPENFLOW_PORT_IANA      6653
+#ifndef SMB_PORT
+#define SMB_PORT               445
+#endif
+#ifndef RTSP_PORT
+#define RTSP_PORT              554
+#endif
+#ifndef MSDP_PORT
+#define MSDP_PORT              639
+#endif
+#ifndef LDP_PORT
+#define LDP_PORT               646
 #endif
 #ifndef PPTP_PORT
-#define PPTP_PORT              1723
+#define PPTP_PORT              1723
 #endif
-#define BEEP_PORT               10288
 #ifndef NFS_PORT
-#define NFS_PORT               2049
+#define NFS_PORT               2049
 #endif
-#define MSDP_PORT              639
-#define RPKI_RTR_PORT          323
-#define LDP_PORT                646
-#ifndef SMB_PORT
-#define SMB_PORT                445
+#ifndef OPENFLOW_PORT_OLD
+#define OPENFLOW_PORT_OLD      6633
 #endif
-#ifndef HTTP_PORT
-#define HTTP_PORT              80
+#ifndef OPENFLOW_PORT_IANA
+#define OPENFLOW_PORT_IANA     6653
 #endif
 #ifndef HTTP_PORT_ALT
 #define HTTP_PORT_ALT          8080
 #endif
-#ifndef RTSP_PORT
-#define RTSP_PORT              554
-#endif
 #ifndef RTSP_PORT_ALT
 #define RTSP_PORT_ALT          8554
 #endif
-#ifndef FTP_PORT
-#define FTP_PORT               21
+#ifndef BEEP_PORT
+#define BEEP_PORT              10288
 #endif
diff --git a/udp.h b/udp.h
index 1bdc923bfc468ded293fdf90aca37679f2a0c181..825b2ded566f9f1008ec083ebbb6dc63fc623573 100644 (file)
--- a/udp.h
+++ b/udp.h
@@ -44,62 +44,261 @@ 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*/
-#define KERBEROS_PORT 88       /*XXX*/
-#define SUNRPC_PORT 111                /*XXX*/
-#define SNMP_PORT 161          /*XXX*/
-#define NTP_PORT 123           /*XXX*/
-#define SNMPTRAP_PORT 162      /*XXX*/
-#define ISAKMP_PORT 500                /*XXX*/
-#define SYSLOG_PORT 514         /* rfc3164 */
-#define TIMED_PORT 525         /*XXX*/
-#define RIP_PORT 520           /*XXX*/
-#define LDP_PORT 646
-#define AODV_PORT 654          /*XXX*/
-#define OLSR_PORT 698           /* rfc3626 */
-#define KERBEROS_SEC_PORT 750  /*XXX*/
-#define L2TP_PORT 1701         /*XXX*/
-#define SIP_PORT 5060
-#define ISAKMP_PORT_NATT  4500  /* rfc3948 */
-#define ISAKMP_PORT_USER1 7500 /*XXX - nonstandard*/
-#define ISAKMP_PORT_USER2 8500 /*XXX - nonstandard*/
-#define RX_PORT_LOW 7000       /*XXX*/
-#define RX_PORT_HIGH 7009      /*XXX*/
-#define NETBIOS_NS_PORT   137
-#define NETBIOS_DGRAM_PORT   138
-#define CISCO_AUTORP_PORT 496  /*XXX*/
-#define RADIUS_PORT 1645
-#define RADIUS_NEW_PORT 1812
-#define RADIUS_ACCOUNTING_PORT 1646
-#define RADIUS_NEW_ACCOUNTING_PORT 1813
-#define RADIUS_COA_PORT 3799
-#define HSRP_PORT 1985         /*XXX*/
-#define LMP_PORT                701 /* rfc4204 */
-#define LWRES_PORT             921
-#define VQP_PORT               1589
-#define ZEPHYR_SRV_PORT                2103
-#define ZEPHYR_CLT_PORT                2104
-#define VAT_PORT               3456
-#define MPLS_LSP_PING_PORT      3503 /* draft-ietf-mpls-lsp-ping-02.txt */
-#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 */
-#define OTV_PORT                8472  /* draft-hasmit-otv-04 */
-#define VXLAN_PORT              4789  /* RFC 7348 */
-#define GENEVE_PORT             6081  /* draft-gross-geneve-02 */
-
-#ifdef INET6
-#define RIPNG_PORT              521   /* RFC 2080 */
-#define DHCP6_SERV_PORT 546    /*XXX*/
-#define DHCP6_CLI_PORT 547     /*XXX*/
-#define AHCP_PORT 5359         /* draft-chroboczek-ahcp-00 */
-#define BABEL_PORT              6696  /* RFC 6126 errata */
-#define BABEL_PORT_OLD          6697  /* RFC 6126 */
+#ifndef NAMESERVER_PORT
+#define NAMESERVER_PORT                        53
+#endif
+#ifndef TACACS_DB_PORT
+#define TACACS_DB_PORT                 65      /*XXX*/
+#endif
+#ifndef ORACLE_SQLNET_PORT
+#define ORACLE_SQLNET_PORT             66      /*XXX*/
+#endif
+#ifndef BOOTPS_PORT
+#define BOOTPS_PORT                    67      /* RFC951 */
+#endif
+#ifndef BOOTPC_PORT
+#define BOOTPC_PORT                    68      /* RFC951 */
+#endif
+#ifndef TFTP_PORT
+#define TFTP_PORT                      69      /*XXX*/
+#endif
+#ifndef KERBEROS_PORT
+#define KERBEROS_PORT                  88      /*XXX*/
+#endif
+#ifndef SUNRPC_PORT
+#define SUNRPC_PORT                    111     /*XXX*/
+#endif
+#ifndef NTP_PORT
+#define NTP_PORT                       123     /*XXX*/
+#endif
+#ifndef NETBIOS_NS_PORT
+#define NETBIOS_NS_PORT                        137     /* RFC 1001, RFC 1002 */
+#endif
+#ifndef NETBIOS_DGRAM_PORT
+#define NETBIOS_DGRAM_PORT             138     /* RFC 1001, RFC 1002 */
+#endif
+#ifndef NETBIOS_SSN_PORT
+#define NETBIOS_SSN_PORT               139     /* RFC 1001, RFC 1002 */
+#endif
+#ifndef SNMP_PORT
+#define SNMP_PORT                      161     /*XXX*/
+#endif
+#ifndef SNMPTRAP_PORT
+#define SNMPTRAP_PORT                  162     /*XXX*/
+#endif
+#ifndef BGP_PORT
+#define BGP_PORT                       179     /*XXX*/
+#endif
+#ifndef APPLETALK_RTMP_PORT
+#define APPLETALK_RTMP_PORT            201     /*XXX*/
+#endif
+#ifndef APPLETALK_NB_PORT
+#define APPLETALK_NB_PORT              202     /*XXX*/
+#endif
+#ifndef APPLETALK_ECHO
+#define APPLETALK_ECHO                 204     /*XXX*/
+#endif
+#ifndef APPLETALK_ZONE_INFO_PORT       
+#define APPLETALK_ZONE_INFO_PORT       206     /*XXX*/
+#endif
+#ifndef LDAP_PORT
+#define LDAP_PORT                      389     /*XXX*/
+#endif
+#ifndef HTTPS_PORT
+#define HTTPS_PORT                     443     /*XXX*/
+#endif
+#ifndef MICROSOFT_DS_PORT
+#define MICROSOFT_DS_PORT              445     /*XXX*/
+#endif
+#ifndef KERBEROS5_PASSWD_PORT
+#define KERBEROS5_PASSWD_PORT          464     /* PER IANA */
+#endif
+#ifndef CISCO_AUTORP_PORT
+#define CISCO_AUTORP_PORT              496     /*XXX*/
+#endif
+#ifndef ISAKMP_PORT
+#define ISAKMP_PORT                    500     /*XXX*/
+#endif
+#ifndef SYSLOG_PORT
+#define SYSLOG_PORT                    514     /* rfc3164 */
+#endif
+#ifndef RIP_PORT
+#define RIP_PORT                       520     /*XXX*/
+#endif
+#ifndef RIPNG_PORT
+#define RIPNG_PORT                     521     /* RFC 2080 */
+#endif
+#ifndef TIMED_PORT
+#define TIMED_PORT                     525     /*XXX*/
+#endif
+#ifndef KERBEROS_LOGIN_PORT
+#define KERBEROS_LOGIN_PORT            543     /*XXX*/
+#endif
+#ifndef KERBEROS_SHELL_PORT
+#define KERBEROS_SHELL_PORT            544     /*XXX*/
+#endif
+#ifndef DHCP6_SERV_PORT
+#define DHCP6_SERV_PORT                        546     /*XXX*/
+#endif
+#ifndef DHCP6_CLI_PORT
+#define DHCP6_CLI_PORT                 547     /*XXX*/
+#endif
+#ifndef LDAPS_PORT
+#define LDAPS_PORT                     636     /*XXX - LDAP over TLS/SSL */
+#endif
+#ifndef LDP_PORT
+#define LDP_PORT                       646
+#endif
+#ifndef DHCP_FAILOVER_PORT
+#define DHCP_FAILOVER_PORT             647     /*XXX*/
+#endif
+#ifndef AQDV_PORT
+#define AODV_PORT                      654     /*XXX*/
+#endif
+#ifndef OLSR_PORT
+#define OLSR_PORT                      698     /* rfc3626 */
+#endif
+#ifndef LMP_PORT
+#define LMP_PORT                       701     /* rfc4204 */
+#endif
+#ifndef CISCO_TDP_PORT
+#define CISCO_TDP_PORT                 711     /*XXX*/
+#endif
+#ifndef KERBEROS_ADM_PORT
+#define KERBEROS_ADM_PORT              749     /*XXX - Kerberos v5 */
+#endif
+#ifndef KERBEROS_SEC_PORT
+#define KERBEROS_SEC_PORT              750     /*XXX - Kerberos v4 */
+#endif
+#ifndef RSYNC_PORT
+#define RSYNC_PORT                     873     /*XXX*/
+#endif
+#ifndef LWRES_PORT
+#define LWRES_PORT                     921     /*XXX*/
+#endif
+#ifndef OPENSSL_PORT
+#define OPENSSL_PORT                   1194    /*XXX*/
+#endif
+#ifndef LOTUS_NOTES_PORT
+#define LOTUS_NOTES_PORT               1352    /*XXX*/
+#endif
+#ifndef MS_SQL_SERVER_PORT
+#define MS_SQL_SERVER_PORT             1433    /*XXX*/
+#endif
+#ifndef MS_SQL_SERVER_MONITOR
+#define MS_SQL_SERVER_MONITOR          1434    /*XXX*/
+#endif
+#ifndef INGRESLOCK_PORT
+#define INGRESLOCK_PORT                        1524    /*XXX*/
+#endif
+#ifndef VQP_PORT
+#define VQP_PORT                       1589    /*XXX*/
+#endif
+#ifndef RADIUS_PORT
+#define RADIUS_PORT                    1645    /*XXX*/
+#endif
+#ifndef RADIUS_ACCOUNTING_PORT
+#define RADIUS_ACCOUNTING_PORT         1646
+#endif
+#ifndef L2TP_PORT
+#define L2TP_PORT                      1701    /*XXX*/
+#endif
+#ifndef RADIUS_NEW_PORT
+#define RADIUS_NEW_PORT                        1812    /*XXX*/
+#endif
+#ifndef RADIUS_NEW_ACCOUNTING_PORT
+#define RADIUS_NEW_ACCOUNTING_PORT     1813
+#endif
+#ifndef HSRP_PORT
+#define HSRP_PORT                      1985    /*XXX*/
+#endif
+#ifndef NFS_DAEMON_PORT
+#define NFS_DAEMON_PORT                        2049    /*XXX*/
+#endif
+#ifndef ZEPHYR_SRV_PORT
+#define ZEPHYR_SRV_PORT                        2103    /*XXX*/
+#endif
+#ifndef ZEPHYR_CLI_PORT
+#define ZEPHYR_CLT_PORT                        2104    /*XXX*/
+#endif
+#ifndef MYSQL_PORT
+#define MYSQL_PORT                     3306    /*XXX*/
+#endif
+#ifndef MS_RDP_PORT
+#define MS_RDP_PORT                    3389    /*XXX*/
+#endif
+#ifndef VAT_PORT
+#define VAT_PORT                       3456    /*XXX*/
+#endif
+#ifndef MPLS_LSP_PING_PORT
+#define MPLS_LSP_PING_PORT             3503    /* draft-ietf-mpls-lsp-ping-02.txt */
+#endif
+#ifndef SUBVERSION_PORT
+#define SUBVERSION_PORT                        3690    /*XXX*/
+#endif
+#ifndef BFD_CONTROL_PORT
+#define BFD_CONTROL_PORT               3784    /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
+#endif
+#ifndef BFD_ECHO_PORT
+#define BFD_ECHO_PORT                  3785    /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
+#endif
+#ifndef RADIUS_COA_PORT
+#define RADIUS_COA_PORT                        3799    /*XXX*/
+#endif
+#ifndef NFS_LOCK_DAEMON_PORT
+#define NFS_LOCK_DAEMON_PORT           4045    /*XXX*/
+#endif
+#ifndef ISAKMP_PORT_NATT
+#define ISAKMP_PORT_NATT               4500    /* rfc3948 */
+#endif
+#ifndef WB_PORT
+#define WB_PORT                                4567
+#endif
+#ifndef VXLAN_PORT
+#define VXLAN_PORT                     4789    /* RFC 7348 */
+#endif
+#ifndef SIP_DS_PORT
+#define SIP_DS_PORT                    5059    /*XXX*/
+#endif
+#ifndef SIP_PORT
+#define SIP_PORT                       5060
+#endif
+#ifndef MULTICASTDNS_PORT
+#define MULTICASTDNS_PORT              5353    /* RFC 6762 */
+#endif
+#ifndef AHCP_PORT
+#define AHCP_PORT                      5359    /* draft-chroboczek-ahcp-00 */
+#endif
+#ifndef GENEVE_PORT
+#define GENEVE_PORT                    6081    /* draft-gross-geneve-02 */
+#endif
+#ifndef SFLOW_PORT
+#define SFLOW_PORT                     6343    /* http://www.sflow.org/developers/specifications.php */
+#endif
+#ifndef BABEL_PORT
+#define BABEL_PORT                     6696    /* RFC 6126 errata */
+#endif
+#ifndef BABEL_PORT_OLD
+#define BABEL_PORT_OLD                 6697    /* RFC 6126 */
+#endif
+#ifndef RX_PORT_LOW
+#define RX_PORT_LOW                    7000    /*XXX*/
+#endif
+#ifndef RX_PORT_HIGH
+#define RX_PORT_HIGH                   7009    /*XXX*/
+#endif
+#ifndef ISAKMP_PORT_USER1
+#define ISAKMP_PORT_USER1              7500    /*XXX - nonstandard*/
+#endif
+#ifndef OTV_PORT
+#define OTV_PORT                       8472    /* draft-hasmit-otv-04 */
+#endif
+#ifndef ISAKMP_PORT_USER2
+#define ISAKMP_PORT_USER2              8500    /*XXX - nonstandard*/
+#endif
+#ifndef LWAPP_DATA_PORT
+#define LWAPP_DATA_PORT                        12222   /* RFC 5412 */
+#endif
+#ifndef LWAPP_CONTROL_PORT
+#define LWAPP_CONTROL_PORT             12223   /* RFC 5412 */
 #endif