diff options
Diffstat (limited to 'usr.sbin/services_mkdb')
| -rw-r--r-- | usr.sbin/services_mkdb/Makefile | 23 | ||||
| -rw-r--r-- | usr.sbin/services_mkdb/Makefile.depend | 16 | ||||
| -rw-r--r-- | usr.sbin/services_mkdb/extern.h | 34 | ||||
| -rw-r--r-- | usr.sbin/services_mkdb/services | 2057 | ||||
| -rw-r--r-- | usr.sbin/services_mkdb/services_mkdb.8 | 109 | ||||
| -rw-r--r-- | usr.sbin/services_mkdb/services_mkdb.c | 461 | ||||
| -rw-r--r-- | usr.sbin/services_mkdb/uniq.c | 165 | 
7 files changed, 2865 insertions, 0 deletions
| diff --git a/usr.sbin/services_mkdb/Makefile b/usr.sbin/services_mkdb/Makefile new file mode 100644 index 000000000000..c1c7ca0bfcff --- /dev/null +++ b/usr.sbin/services_mkdb/Makefile @@ -0,0 +1,23 @@ +PACKAGE=	runtime + +CONFS=	services +PROG=	services_mkdb +MAN=	services_mkdb.8 +SRCS=	services_mkdb.c uniq.c extern.h + +.include <bsd.endian.mk> +.include <src.opts.mk> +.if ${MK_SERVICESDB} != "no" +# SERVICES_MKDB_CMD defined here +.include <src.tools.mk> + +afterinstallconfig: +	${SERVICES_MKDB_CMD} ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \ +		${DESTDIR}/etc/services +.if defined(NO_ROOT) && defined(METALOG) +	echo ".${DISTBASE}/var/db/services.db type=file mode=0644 uname=root gname=wheel" | \ +		cat -l >> ${METALOG} +.endif +.endif + +.include <bsd.prog.mk> diff --git a/usr.sbin/services_mkdb/Makefile.depend b/usr.sbin/services_mkdb/Makefile.depend new file mode 100644 index 000000000000..678747db6f2c --- /dev/null +++ b/usr.sbin/services_mkdb/Makefile.depend @@ -0,0 +1,16 @@ +# Autogenerated - do NOT edit! + +DIRDEPS = \ +	include \ +	include/xlocale \ +	lib/${CSU_DIR} \ +	lib/libc \ +	lib/libcompiler_rt \ +	lib/libutil \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.sbin/services_mkdb/extern.h b/usr.sbin/services_mkdb/extern.h new file mode 100644 index 000000000000..3fba548ab5e9 --- /dev/null +++ b/usr.sbin/services_mkdb/extern.h @@ -0,0 +1,34 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *    notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *    notice, this list of conditions and the following disclaimer in the + *    documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +extern HASHINFO hinfo; + +void uniq(const char *); diff --git a/usr.sbin/services_mkdb/services b/usr.sbin/services_mkdb/services new file mode 100644 index 000000000000..c5f950831767 --- /dev/null +++ b/usr.sbin/services_mkdb/services @@ -0,0 +1,2057 @@ +# +# Network services, Internet style +# +# Service names and port numbers are used to distinguish between different +# services that run over transport protocols such as TCP, UDP, DCCP, and +# SCTP. +# +# The latest IANA port assignments can be gotten from +# +#	https://www.iana.org/assignments/service-names-port-numbers/ +# +# System Ports are those from 0 through 1023. +# User Ports are those from 1024 through 49151. +# Dynamic and/or Private Ports are those from 49152 through 65535. +# +# Note that it is presently the policy of IANA to assign a single well-known +# port number for both TCP and UDP; hence, most entries here have two entries +# even if the protocol doesn't support UDP operations. +# WELL KNOWN PORT NUMBERS +# +tcpmux		  1/tcp	   #TCP Port Service Multiplexer +tcpmux		  1/udp	   #TCP Port Service Multiplexer +compressnet	  2/tcp	   #Management Utility +compressnet	  2/udp	   #Management Utility +compressnet	  3/tcp	   #Compression Process +compressnet	  3/udp	   #Compression Process +rje		  5/tcp	   #Remote Job Entry +rje		  5/udp	   #Remote Job Entry +echo		  7/tcp +echo		  7/udp +echo		  7/sctp +discard		  9/tcp	   sink null +discard		  9/udp	   sink null +discard		  9/sctp   sink null +systat		 11/tcp	   users	#Active Users +systat		 11/udp	   users	#Active Users +daytime		 13/tcp +daytime		 13/udp +daytime		 13/sctp +qotd		 17/tcp	   quote	#Quote of the Day +qotd		 17/udp	   quote	#Quote of the Day +msp		 18/tcp	   #Message Send Protocol +msp		 18/udp	   #Message Send Protocol +chargen		 19/tcp	   ttytst source	#Character Generator +chargen		 19/udp	   ttytst source	#Character Generator +chargen		 19/sctp   ttytst source	#Character Generator +ftp-data	 20/tcp	   #File Transfer [Default Data] +ftp-data	 20/udp	   #File Transfer [Default Data] +ftp-data	 20/sctp   #File Transfer [Default Data] +ftp		 21/tcp	   #File Transfer [Control] +ftp		 21/udp	   #File Transfer [Control] +ftp		 21/sctp   #File Transfer [Control] +ssh		 22/tcp	   #Secure Shell Login +ssh		 22/udp	   #Secure Shell Login +ssh		 22/sctp   #Secure Shell Login +telnet		 23/tcp +telnet		 23/udp +#		 24/tcp	   any private mail system +#		 24/udp	   any private mail system +smtp		 25/tcp	   mail		#Simple Mail Transfer +smtp		 25/udp	   mail		#Simple Mail Transfer +nsw-fe		 27/tcp	   #NSW User System FE +nsw-fe		 27/udp	   #NSW User System FE +msg-icp		 29/tcp	   #MSG ICP +msg-icp		 29/udp	   #MSG ICP +msg-auth	 31/tcp	   #MSG Authentication +msg-auth	 31/udp	   #MSG Authentication +dsp		 33/tcp	   #Display Support Protocol +dsp		 33/udp	   #Display Support Protocol +#		 35/tcp	   any private printer server +#		 35/udp	   any private printer server +time		 37/tcp	   timserver +time		 37/udp	   timserver +rap		 38/tcp	   #Route Access Protocol +rap		 38/udp	   #Route Access Protocol +rlp		 39/tcp	   resource	#Resource Location Protocol +rlp		 39/udp	   resource	#Resource Location Protocol +graphics	 41/tcp +graphics	 41/udp +nameserver	 42/tcp	   name		#Host Name Server +nameserver	 42/udp	   name		#Host Name Server +nicname		 43/tcp	   whois +nicname		 43/udp	   whois +mpm-flags	 44/tcp	   #MPM FLAGS Protocol +mpm-flags	 44/udp	   #MPM FLAGS Protocol +mpm		 45/tcp	   #Message Processing Module [recv] +mpm		 45/udp	   #Message Processing Module [recv] +mpm-snd		 46/tcp	   #MPM [default send] +mpm-snd		 46/udp	   #MPM [default send] +ni-ftp		 47/tcp	   #NI FTP +ni-ftp		 47/udp	   #NI FTP +auditd		 48/tcp	   #Digital Audit Daemon +auditd		 48/udp	   #Digital Audit Daemon +tacacs		 49/tcp	   #Login Host Protocol (TACACS) +tacacs		 49/udp	   #Login Host Protocol (TACACS) +re-mail-ck	 50/tcp	   #Remote Mail Checking Protocol +re-mail-ck	 50/udp	   #Remote Mail Checking Protocol +la-maint	 51/tcp	   #IMP Logical Address Maintenance +la-maint	 51/udp	   #IMP Logical Address Maintenance +xns-time	 52/tcp	   #XNS Time Protocol +xns-time	 52/udp	   #XNS Time Protocol +domain		 53/tcp	   #Domain Name Server +domain		 53/udp	   #Domain Name Server +xns-ch		 54/tcp	   #XNS Clearinghouse +xns-ch		 54/udp	   #XNS Clearinghouse +isi-gl		 55/tcp	   #ISI Graphics Language +isi-gl		 55/udp	   #ISI Graphics Language +xns-auth	 56/tcp	   #XNS Authentication +xns-auth	 56/udp	   #XNS Authentication +#		 57/tcp	   any private terminal access +#		 57/udp	   any private terminal access +xns-mail	 58/tcp	   #XNS Mail +xns-mail	 58/udp	   #XNS Mail +#		 59/tcp	   any private file service +#		 59/udp	   any private file service +acas		 62/tcp	   #ACA Services +acas		 62/udp	   #ACA Services +whoispp		 63/tcp	   whois++ +whoispp		 63/udp	   whois++ +covia		 64/tcp	   #Communications Integrator (CI) +covia		 64/udp	   #Communications Integrator (CI) +tacacs-ds	 65/tcp	   #TACACS-Database Service +tacacs-ds	 65/udp	   #TACACS-Database Service +sql-net		 66/tcp	   sql*net #Oracle SQL*NET / replacement +sql-net		 66/udp	   sql*net #Oracle SQL*NET replacement +bootps		 67/tcp	   dhcps	#Bootstrap Protocol Server +bootps		 67/udp	   dhcps	#Bootstrap Protocol Server +bootpc		 68/tcp	   dhcpc	#Bootstrap Protocol Client +bootpc		 68/udp	   dhcpc	#Bootstrap Protocol Client +tftp		 69/tcp	   #Trivial File Transfer +tftp		 69/udp	   #Trivial File Transfer +gopher		 70/tcp +gopher		 70/udp +netrjs-1	 71/tcp	   #Remote Job Service +netrjs-1	 71/udp	   #Remote Job Service +netrjs-2	 72/tcp	   #Remote Job Service +netrjs-2	 72/udp	   #Remote Job Service +netrjs-3	 73/tcp	   #Remote Job Service +netrjs-3	 73/udp	   #Remote Job Service +netrjs-4	 74/tcp	   #Remote Job Service +netrjs-4	 74/udp	   #Remote Job Service +#		 75/tcp	   any private dial out service +#		 75/udp	   any private dial out service +deos		 76/tcp	   #Distributed External Object Store +deos		 76/udp	   #Distributed External Object Store +#		 77/tcp	   any private RJE service +#		 77/udp	   any private RJE service +vettcp		 78/tcp +vettcp		 78/udp +finger		 79/tcp +finger		 79/udp +http		 80/tcp	   www www-http	#World Wide Web HTTP +http		 80/udp	   www www-http	#World Wide Web HTTP +http		 80/sctp   www www-http	#World Wide Web HTTP +xfer		 82/tcp	   #XFER Utility +xfer		 82/udp	   #XFER Utility +mit-ml-dev	 83/tcp	   #MIT ML Device +mit-ml-dev	 83/udp	   #MIT ML Device +ctf		 84/tcp	   #Common Trace Facility +ctf		 84/udp	   #Common Trace Facility +mit-ml-dev	 85/tcp	   #MIT ML Device +mit-ml-dev	 85/udp	   #MIT ML Device +mfcobol		 86/tcp	   #Micro Focus Cobol +mfcobol		 86/udp	   #Micro Focus Cobol +#		 87/tcp	   any private terminal link +#		 87/udp	   any private terminal link +kerberos-sec	 88/tcp	   kerberos	# krb5	# Kerberos (v5) +kerberos-sec	 88/udp	   kerberos	# krb5	# Kerberos (v5) +su-mit-tg	 89/tcp	   #SU/MIT Telnet Gateway +su-mit-tg	 89/udp	   #SU/MIT Telnet Gateway +dnsix		 90/tcp	   #DNSIX Securit Attribute Token Map +dnsix		 90/udp	   #DNSIX Securit Attribute Token Map +mit-dov		 91/tcp	   #MIT Dover Spooler +mit-dov		 91/udp	   #MIT Dover Spooler +npp		 92/tcp	   #Network Printing Protocol +npp		 92/udp	   #Network Printing Protocol +dcp		 93/tcp	   #Device Control Protocol +dcp		 93/udp	   #Device Control Protocol +objcall		 94/tcp	   #Tivoli Object Dispatcher +objcall		 94/udp	   #Tivoli Object Dispatcher +supdup		 95/tcp +supdup		 95/udp +dixie		 96/tcp	   #DIXIE Protocol Specification +dixie		 96/udp	   #DIXIE Protocol Specification +swift-rvf	 97/tcp	   #Swift Remote Virtural File Protocol +swift-rvf	 97/udp	   #Swift Remote Virtural File Protocol +tacnews		 98/tcp	   #TAC News +tacnews		 98/udp	   #TAC News +metagram	 99/tcp	   #Metagram Relay +metagram	 99/udp	   #Metagram Relay +newacct		100/tcp	   #[unauthorized use] +hostname	101/tcp	   hostnames	#NIC Host Name Server +hostname	101/udp	   hostnames	#NIC Host Name Server +iso-tsap	102/tcp	   tsap		#ISO-TSAP Class 0 +iso-tsap	102/udp	   tsap		#ISO-TSAP Class 0 +gppitnp		103/tcp	   #Genesis Point-to-Point Trans Net +gppitnp		103/udp	   #Genesis Point-to-Point Trans Net +acr-nema	104/tcp	   #ACR-NEMA Digital Imag. & Comm. 300 +acr-nema	104/udp	   #ACR-NEMA Digital Imag. & Comm. 300 +csnet-ns	105/tcp	   cso-ns cso	#Mailbox Name Nameserver +csnet-ns	105/udp	   cso-ns cso	#Mailbox Name Nameserver +pop3pw		106/tcp	   3com-tsmux	#Eudora compatible PW changer +3com-tsmux	106/udp +rtelnet		107/tcp	   #Remote Telnet Service +rtelnet		107/udp	   #Remote Telnet Service +snagas		108/tcp	   #SNA Gateway Access Server +snagas		108/udp	   #SNA Gateway Access Server +pop2		109/tcp	   postoffice	#Post Office Protocol - Version 2 +pop2		109/udp	   postoffice	#Post Office Protocol - Version 2 +pop3		110/tcp	   #Post Office Protocol - Version 3 +pop3		110/udp	   #Post Office Protocol - Version 3 +sunrpc		111/tcp	   rpcbind	#SUN Remote Procedure Call +sunrpc		111/udp	   rpcbind	#SUN Remote Procedure Call +mcidas		112/tcp	   #McIDAS Data Transmission Protocol +mcidas		112/udp	   #McIDAS Data Transmission Protocol +auth		113/tcp	   ident tap	#Authentication Service +auth		113/udp	   ident tap	#Authentication Service +sftp		115/tcp	   #Simple File Transfer Protocol +sftp		115/udp	   #Simple File Transfer Protocol +ansanotify	116/tcp	   #ANSA REX Notify +ansanotify	116/udp	   #ANSA REX Notify +uucp-path	117/tcp	   #UUCP Path Service +uucp-path	117/udp	   #UUCP Path Service +sqlserv		118/tcp	   #SQL Services +sqlserv		118/udp	   #SQL Services +nntp		119/tcp	   usenet	#Network News Transfer Protocol +nntp		119/udp	   usenet	#Network News Transfer Protocol +cfdptkt		120/tcp +cfdptkt		120/udp +erpc		121/tcp	   #Encore Expedited Remote Pro.Call +erpc		121/udp	   #Encore Expedited Remote Pro.Call +smakynet	122/tcp +smakynet	122/udp +ntp		123/tcp	   #Network Time Protocol +ntp		123/udp	   #Network Time Protocol +ansatrader	124/tcp	   #ANSA REX Trader +ansatrader	124/udp	   #ANSA REX Trader +locus-map	125/tcp	   #Locus PC-Interface Net Map Ser +locus-map	125/udp	   #Locus PC-Interface Net Map Ser +nxedit		126/tcp	   #NXEdit +nxedit		126/udp	   #NXEdit +locus-con	127/tcp	   #Locus PC-Interface Conn Server +locus-con	127/udp	   #Locus PC-Interface Conn Server +gss-xlicen	128/tcp	   #GSS X License Verification +gss-xlicen	128/udp	   #GSS X License Verification +pwdgen		129/tcp	   #Password Generator Protocol +pwdgen		129/udp	   #Password Generator Protocol +cisco-fna	130/tcp	   #cisco FNATIVE +cisco-fna	130/udp	   #cisco FNATIVE +cisco-tna	131/tcp	   #cisco TNATIVE +cisco-tna	131/udp	   #cisco TNATIVE +cisco-sys	132/tcp	   #cisco SYSMAINT +cisco-sys	132/udp	   #cisco SYSMAINT +statsrv		133/tcp	   #Statistics Service +statsrv		133/udp	   #Statistics Service +ingres-net	134/tcp	   #INGRES-NET Service +ingres-net	134/udp	   #INGRES-NET Service +epmap		135/tcp	   #DCE endpoint resolution +epmap		135/udp	   #DCE endpoint resolution +profile		136/tcp	   #PROFILE Naming System +profile		136/udp	   #PROFILE Naming System +netbios-ns	137/tcp	   #NETBIOS Name Service +netbios-ns	137/udp	   #NETBIOS Name Service +netbios-dgm	138/tcp	   #NETBIOS Datagram Service +netbios-dgm	138/udp	   #NETBIOS Datagram Service +netbios-ssn	139/tcp	   #NETBIOS Session Service +netbios-ssn	139/udp	   #NETBIOS Session Service +emfis-data	140/tcp	   #EMFIS Data Service +emfis-data	140/udp	   #EMFIS Data Service +emfis-cntl	141/tcp	   #EMFIS Control Service +emfis-cntl	141/udp	   #EMFIS Control Service +bl-idm		142/tcp	   #Britton-Lee IDM +bl-idm		142/udp	   #Britton-Lee IDM +imap		143/tcp	   imap2 imap4	#Interim Mail Access Protocol v2 +imap		143/udp	   imap2 imap4	#Interim Mail Access Protocol v2 +uma		144/tcp	   #Universal Management Architecture +uma		144/udp	   #Universal Management Architecture +uaac		145/tcp	   #UAAC Protocol +uaac		145/udp	   #UAAC Protocol +iso-tp0		146/tcp +iso-tp0		146/udp +iso-ip		147/tcp +iso-ip		147/udp +jargon		148/tcp	   #Jargon +jargon		148/udp	   #Jargon +aed-512		149/tcp	   #AED 512 Emulation Service +aed-512		149/udp	   #AED 512 Emulation Service +sql-net		150/tcp +sql-net		150/udp +hems		151/tcp +hems		151/udp +bftp		152/tcp	   #Background File Transfer Program +bftp		152/udp	   #Background File Transfer Program +sgmp		153/tcp +sgmp		153/udp +netsc-prod	154/tcp +netsc-prod	154/udp +netsc-dev	155/tcp +netsc-dev	155/udp +sqlsrv		156/tcp	   #SQL Service +sqlsrv		156/udp	   #SQL Service +knet-cmp	157/tcp	   #KNET/VM Command/Message Protocol +knet-cmp	157/udp	   #KNET/VM Command/Message Protocol +pcmail-srv	158/tcp	   #PCMail Server +pcmail-srv	158/udp	   #PCMail Server +nss-routing	159/tcp +nss-routing	159/udp +sgmp-traps	160/tcp +sgmp-traps	160/udp +snmp		161/tcp +snmp		161/udp +snmptrap	162/tcp	   snmp-trap +snmptrap	162/udp	   snmp-trap +cmip-man	163/tcp	   #CMIP/TCP Manager +cmip-man	163/udp	   #CMIP/TCP Manager +cmip-agent	164/tcp	   #CMIP/TCP Agent +smip-agent	164/udp	   #CMIP/TCP Agent +xns-courier	165/tcp	   #Xerox +xns-courier	165/udp	   #Xerox +s-net		166/tcp	   #Sirius Systems +s-net		166/udp	   #Sirius Systems +namp		167/tcp +namp		167/udp +rsvd		168/tcp +rsvd		168/udp +send		169/tcp +send		169/udp +print-srv	170/tcp	   #Network PostScript +print-srv	170/udp	   #Network PostScript +multiplex	171/tcp	   #Network Innovations Multiplex +multiplex	171/udp	   #Network Innovations Multiplex +cl/1		172/tcp	   #Network Innovations CL/1 +cl/1		172/udp	   #Network Innovations CL/1 +xyplex-mux	173/tcp +xyplex-mux	173/udp +mailq		174/tcp +mailq		174/udp +vmnet		175/tcp +vmnet		175/udp +genrad-mux	176/tcp +genrad-mux	176/udp +xdmcp		177/tcp	   #X Display Manager Control Protocol +xdmcp		177/udp	   #X Display Manager Control Protocol +nextstep	178/tcp	   #NextStep Window Server +nextstep	178/udp	   #NextStep Window Server +bgp		179/tcp	   #Border Gateway Protocol +bgp		179/udp	   #Border Gateway Protocol +bgp		179/sctp   #Border Gateway Protocol +ris		180/tcp	   #Intergraph +ris		180/udp	   #Intergraph +unify		181/tcp +unify		181/udp +audit		182/tcp	   #Unisys Audit SITP +audit		182/udp	   #Unisys Audit SITP +ocbinder	183/tcp +ocbinder	183/udp +ocserver	184/tcp +ocserver	184/udp +remote-kis	185/tcp +remote-kis	185/udp +kis		186/tcp	   #KIS Protocol +kis		186/udp	   #KIS Protocol +aci		187/tcp	   #Application Communication Interface +aci		187/udp	   #Application Communication Interface +mumps		188/tcp	   #Plus Five's MUMPS +mumps		188/udp	   #Plus Five's MUMPS +qft		189/tcp	   #Queued File Transport +qft		189/udp	   #Queued File Transport +gacp		190/tcp	   #Gateway Access Control Protocol +gacp		190/udp	   cacp		#Gateway Access Control Protocol +prospero	191/tcp	   #Prospero Directory Service +prospero	191/udp	   #Prospero Directory Service +osu-nms		192/tcp	   #OSU Network Monitoring System +osu-nms		192/udp	   #OSU Network Monitoring System +srmp		193/tcp	   #Spider Remote Monitoring Protocol +srmp		193/udp	   #Spider Remote Monitoring Protocol +irc		194/tcp	   #Internet Relay Chat Protocol +irc		194/udp	   #Internet Relay Chat Protocol +dn6-nlm-aud	195/tcp	   #DNSIX Network Level Module Audit +dn6-nlm-aud	195/udp	   #DNSIX Network Level Module Audit +dn6-smm-red	196/tcp	   #DNSIX Session Mgt Module Audit Redir +dn6-smm-red	196/udp	   #DNSIX Session Mgt Module Audit Redir +dls		197/tcp	   #Directory Location Service +dls		197/udp	   #Directory Location Service +dls-mon		198/tcp	   #Directory Location Service Monitor +dls-mon		198/udp	   #Directory Location Service Monitor +smux		199/tcp +smux		199/udp +src		200/tcp	   #IBM System Resource Controller +src		200/udp	   #IBM System Resource Controller +at-rtmp		201/tcp	   #AppleTalk Routing Maintenance +at-rtmp		201/udp	   #AppleTalk Routing Maintenance +at-nbp		202/tcp	   #AppleTalk Name Binding +at-nbp		202/udp	   #AppleTalk Name Binding +at-3		203/tcp	   #AppleTalk Unused +at-3		203/udp	   #AppleTalk Unused +at-echo		204/tcp	   #AppleTalk Echo +at-echo		204/udp	   #AppleTalk Echo +at-5		205/tcp	   #AppleTalk Unused +at-5		205/udp	   #AppleTalk Unused +at-zis		206/tcp	   #AppleTalk Zone Information +at-zis		206/udp	   #AppleTalk Zone Information +at-7		207/tcp	   #AppleTalk Unused +at-7		207/udp	   #AppleTalk Unused +at-8		208/tcp	   #AppleTalk Unused +at-8		208/udp	   #AppleTalk Unused +qmtp		209/tcp	   #The Quick Mail Transfer Protocol +qmtp		209/udp	   #The Quick Mail Transfer Protocol +z39-50		210/tcp	   z39.50 wais	#ANSI Z39.50 +z39-50		210/udp	   z39.50 wais	#ANSI Z39.50 +914c-g		211/tcp	   914c/g	#Texas Instruments 914C/G Terminal +914c-g		211/udp	   914c/g	#Texas Instruments 914C/G Terminal +anet		212/tcp	   #ATEXSSTR +anet		212/udp	   #ATEXSSTR +ipx		213/tcp +ipx		213/udp +vmpwscs		214/tcp +vmpwscs		214/udp +softpc		215/tcp	   #Insignia Solutions +softpc		215/udp	   #Insignia Solutions +CAIlic		216/tcp	   atls		#Computer Associates Int'l License Server +CAIlic		216/udp	   atls		#Computer Associates Int'l License Server +dbase		217/tcp	   #dBASE Unix +dbase		217/udp	   #dBASE Unix +mpp		218/tcp	   #Netix Message Posting Protocol +mpp		218/udp	   #Netix Message Posting Protocol +uarps		219/tcp	   #Unisys ARPs +uarps		219/udp	   #Unisys ARPs +imap3		220/tcp	   #Interactive Mail Access Protocol v3 +imap3		220/udp	   #Interactive Mail Access Protocol v3 +fln-spx		221/tcp	   #Berkeley rlogind with SPX auth +fln-spx		221/udp	   #Berkeley rlogind with SPX auth +rsh-spx		222/tcp	   #Berkeley rshd with SPX auth +rsh-spx		222/udp	   #Berkeley rshd with SPX auth +cdc		223/tcp	   #Certificate Distribution Center +cdc		223/udp	   #Certificate Distribution Center +masqdialer	224/tcp +masqdialer	224/udp +direct		242/tcp +direct		242/udp +sur-meas	243/tcp	   #Survey Measurement +sur-meas	243/udp	   #Survey Measurement +inbusiness	244/tcp +inbusiness	244/udp +link		245/tcp +link		245/udp +dsp3270		246/tcp	   #Display Systems Protocol +dsp3270		246/udp	   #Display Systems Protocol +subntbcst-tftp	247/tcp	   subntbcst_tftp #subntbcst_tftp +subntbcst-tftp	247/udp	   subntbcst_tftp #subntbcst_tftp +bhfhs		248/tcp +bhfhs		248/udp +#		249-255	   reserved +rap		256/tcp +rap		256/udp +set		257/tcp	   #secure electronic transaction +set		257/udp	   #secure electronic transaction +esro-gen	259/tcp	   #efficient short remote operations +esro-gen	259/udp	   #efficient short remote operations +openport	260/tcp +openport	260/udp +nsiiops		261/tcp	   #iiop name service over tls/ssl +nsiiops		261/udp	   #iiop name service over tls/ssl +arcisdms	262/tcp +arcisdms	262/udp +hdap		263/tcp +hdap		263/udp +bgmp		264/tcp +bgmp		264/udp +x-bone-ctl	265/tcp    #X-Bone CTL +x-bone-ctl	265/udp    #X-Bone CTL +sst		266/tcp    #SCSI on ST +sst		266/udp    #SCSI on ST +td-service	267/tcp    #Tobit David Service Layer +td-service	267/udp    #Tobit David Service Layer +td-replica	268/tcp    #Tobit David Replica +td-replica	268/udp    #Tobit David Replica +manet		269/tcp    #MANET Protocols [RFC5498] +manet		269/udp    #MANET Protocols [RFC5498] +gist		270/udp    #Q-mode encapsulation for [RFC5971] +pt-tls		271/tcp    #Assessment (NEA) Posture +#		272-279	   unassigned +http-mgmt	280/tcp +http-mgmt	280/udp +personal-link	281/tcp +personal-link	281/udp +cableport-ax	282/tcp	   #cable port a/x +cableport-ax	282/udp	   #cable port a/x +rescap		283/tcp +rescap		283/udp +corerjd		284/tcp +corerjd		284/udp +#		285        unassigned +fxp		286/tcp +fxp		286/udp +k-block		287/tcp +k-block		287/udp +#		288-307	   unassigned +novastorbakcup	308/tcp	   #novastor backup +novastorbakcup	308/udp	   #novastor backup +entrusttime	309/tcp +entrusttime	309/udp +bhmds		310/tcp +bhmds		310/udp +asip-webadmin	311/tcp	   #appleshare ip webadmin +asip-webadmin	311/udp	   #appleshare ip webadmin +vslmp		312/tcp +vslmp		312/udp +magenta-logic	313/tcp +magenta-logic	313/udp +opalis-robot	314/tcp +opalis-robot	314/udp +dpsi		315/tcp +dpsi		315/udp +decauth		316/tcp +decauth		316/udp +zannet		317/tcp +zannet		317/udp +pkix-timestamp	318/tcp    #PKIX TimeStamp +pkix-timestamp	318/udp    #PKIX TimeStamp +ptp-event	319/tcp    #PTP Event +ptp-event	319/udp    #PTP Event +ptp-general	320/tcp    #PTP General +ptp-general	320/udp    #PTP General +pip		321/tcp +pip		321/udp +rtsps		322/tcp +rtsps		322/udp +rpki-rtr	323/tcp	   #Resource PKI to Router Protocol +rpki-rtr-tls	324/tcp	   #Resource PKI to Router Protocol over TLS +#		325-332	   #unassigned +texar		333/tcp	   #Texar Security Port +texar		333/udp	   #Texar Security Port +#		334-343	   #unassigned +pdap		344/tcp	   #Prospero Data Access Protocol +pdap		344/udp	   #Prospero Data Access Protocol +pawserv		345/tcp	   #Perf Analysis Workbench +pawserv		345/udp	   #Perf Analysis Workbench +zserv		346/tcp	   #Zebra server +zserv		346/udp	   #Zebra server +fatserv		347/tcp	   #Fatmen Server +fatserv		347/udp	   #Fatmen Server +csi-sgwp	348/tcp	   #Cabletron Management Protocol +csi-sgwp	348/udp	   #Cabletron Management Protocol +mftp		349/tcp +mftp		349/udp +matip-type-a	350/tcp	   #MATIP Type A +matip-type-a	350/udp +matip-type-b	351/tcp	   #MATIP Type B +matip-type-b	351/udp +bhoetty		351/tcp	   #unassigned but widespread use +bhoetty		351/udp	   #unassigned but widespread use +dtag-ste-sb	352/tcp	   #DTAG +dtag-ste-sb	352/udp	   #DTAG +bhoedap4	352/tcp	   #unassigned but widespread use +bhoedap4	352/udp	   #unassigned but widespread use +ndsauth		353/tcp +ndsauth		353/udp +bh611		354/tcp +bh611		354/udp +datex-asn	355/tcp +datex-asn	355/udp +cloanto-net-1	356/tcp	   #Cloanto Net 1 +cloanto-net-1	356/udp +bhevent		357/tcp +bhevent		357/udp +shrinkwrap	358/tcp +shrinkwrap	358/udp +nsrmp		359/tcp	   #Network Security Risk Management Protocol +nsrmp		359/udp	   #Network Security Risk Management Protocol +scoi2odialog	360/tcp +scoi2odialog	360/udp +semantix	361/tcp +semantix	361/udp +srssend		362/tcp	   #SRS Send +srssend		362/udp	   #SRS Send +rsvp_tunnel	363/tcp +rsvp_tunnel	363/udp +aurora-cmgr	364/tcp +aurora-cmgr	364/udp +dtk		365/tcp	   #Deception Tool Kit - Fred Cohen <fc@all.net> +dtk		365/udp	   #Deception Tool Kit - Fred Cohen <fc@all.net> +odmr		366/tcp +odmr		366/udp +mortgageware	367/tcp +mortgageware	367/udp +qbikgdp		368/tcp	   #QbikGDP +qbikgdp		368/udp +rpc2portmap	369/tcp +rpc2portmap	369/udp +codaauth2	370/tcp +codaauth2	370/udp +clearcase	371/tcp +clearcase	371/udp +ulistserv	372/tcp	   ulistproc	#Unix Listserv +ulistserv	372/udp	   ulistproc	#Unix Listserv +legent-1	373/tcp	   #Legent Corporation (now Computer Associates Intl.) +legent-1	373/udp	   #Legent Corporation (now Computer Associates Intl.) +legent-2	374/tcp	   #Legent Corporation (now Computer Associates Intl.) +legent-2	374/udp	   #Legent Corporation (now Computer Associates Intl.) +hassle		375/tcp +hassle		375/udp +nip		376/tcp	   #Amiga Envoy Network Inquiry Proto +nip		376/udp	   #Amiga Envoy Network Inquiry Proto +tnETOS		377/tcp	   #NEC Corporation +tnETOS		377/udp	   #NEC Corporation +dsETOS		378/tcp	   #NEC Corporation +dsETOS		378/udp	   #NEC Corporation +is99c		379/tcp	   #TIA/EIA/IS-99 modem client +is99c		379/udp	   #TIA/EIA/IS-99 modem client +is99s		380/tcp	   #TIA/EIA/IS-99 modem server +is99s		380/udp	   #TIA/EIA/IS-99 modem server +hp-collector	381/tcp	   #hp performance data collector +hp-collector	381/udp	   #hp performance data collector +hp-managed-node	382/tcp	   #hp performance data managed node +hp-managed-node	382/udp	   #hp performance data managed node +hp-alarm-mgr	383/tcp	   #hp performance data alarm manager +hp-alarm-mgr	383/udp	   #hp performance data alarm manager +arns		384/tcp	   #A Remote Network Server System +arns		384/udp	   #A Remote Network Server System +ibm-app		385/tcp	   #IBM Application +ibm-app		385/udp	   #IBM Application +asa		386/tcp	   #ASA Message Router Object Def. +asa		386/udp	   #ASA Message Router Object Def. +aurp		387/tcp	   #Appletalk Update-Based Routing Pro. +aurp		387/udp	   #Appletalk Update-Based Routing Pro. +unidata-ldm	388/tcp	   #Unidata LDM Version 4 +unidata-ldm	388/udp	   #Unidata LDM Version 4 +ldap		389/tcp	   #Lightweight Directory Access Protocol +ldap		389/udp	   #Lightweight Directory Access Protocol +uis		390/tcp	   #UIS +uis		390/udp	   #UIS +synotics-relay	391/tcp	   #SynOptics SNMP Relay Port +synotics-relay	391/udp	   #SynOptics SNMP Relay Port +synotics-broker	392/tcp	   #SynOptics Port Broker Port +synotics-broker	392/udp	   #SynOptics Port Broker Port +meta5		393/tcp	   #Meta5 +meta5		393/udp	   #Meta5 +embl-ndt	394/tcp	   #EMBL Nucleic Data Transfer +embl-ndt	394/udp	   #EMBL Nucleic Data Transfer +netcp		395/tcp	   #NETscout Control Protocol +netcp		395/udp	   #NETscout Control Protocol +netware-ip	396/tcp	   #Novell Netware over IP +netware-ip	396/udp	   #Novell Netware over IP +mptn		397/tcp	   #Multi Protocol Trans. Net. +mptn		397/udp	   #Multi Protocol Trans. Net. +kryptolan	398/tcp +kryptolan	398/udp +iso-tsap-c2	399/tcp	   #ISO-TSAP Class 2 +iso-tsap-c2	399/udp	   #ISO-TSAP Class 2 +osb-sd		400/tcp	   #Oracle Secure Backup +osb-sd		400/udp	   #Oracle Secure Backup +ups		401/tcp	   #Uninterruptible Power Supply +ups		401/udp	   #Uninterruptible Power Supply +genie		402/tcp	   #Genie Protocol +genie		402/udp	   #Genie Protocol +decap		403/tcp +decap		403/udp +nced		404/tcp +nced		404/udp +ncld		405/tcp +ncld		405/udp +imsp		406/tcp	   #Interactive Mail Support Protocol +imsp		406/udp	   #Interactive Mail Support Protocol +timbuktu	407/tcp +timbuktu	407/udp +prm-sm		408/tcp	   #Prospero Resource Manager Sys. Man. +prm-sm		408/udp	   #Prospero Resource Manager Sys. Man. +prm-nm		409/tcp	   #Prospero Resource Manager Node Man. +prm-nm		409/udp	   #Prospero Resource Manager Node Man. +decladebug	410/tcp	   #DECLadebug Remote Debug Protocol +decladebug	410/udp	   #DECLadebug Remote Debug Protocol +rmt		411/tcp	   #Remote MT Protocol +rmt		411/udp	   #Remote MT Protocol +synoptics-trap	412/tcp	   #Trap Convention Port +synoptics-trap	412/udp	   #Trap Convention Port +smsp		413/tcp +smsp		413/udp +infoseek	414/tcp +infoseek	414/udp +bnet		415/tcp +bnet		415/udp +silverplatter	416/tcp +silverplatter	416/udp +onmux		417/tcp +onmux		417/udp +hyper-g		418/tcp +hyper-g		418/udp +ariel1		419/tcp +ariel1		419/udp +smpte		420/tcp +smpte		420/udp +ariel2		421/tcp +ariel2		421/udp +ariel3		422/tcp +ariel3		422/udp +opc-job-start	423/tcp	   #IBM Operations Planning and Control Start +opc-job-start	423/udp	   #IBM Operations Planning and Control Start +opc-job-track	424/tcp	   #IBM Operations Planning and Control Track +opc-job-track	424/udp	   #IBM Operations Planning and Control Track +icad-el		425/tcp +icad-el		425/udp +smartsdp	426/tcp +smartsdp	426/udp +svrloc		427/tcp	   #Server Location +svrloc		427/udp	   #Server Location +ocs_cmu		428/tcp +ocs_cmu		428/udp +ocs_amu		429/tcp +ocs_amu		429/udp +utmpsd		430/tcp +utmpsd		430/udp +utmpcd		431/tcp +utmpcd		431/udp +iasd		432/tcp +iasd		432/udp +nnsp		433/tcp +nnsp		433/udp +mobileip-agent	434/tcp +mobileip-agent	434/udp +mobilip-mn	435/tcp +mobilip-mn	435/udp +dna-cml		436/tcp +dna-cml		436/udp +comscm		437/tcp +comscm		437/udp +dsfgw		438/tcp +dsfgw		438/udp +dasp		439/tcp +dasp		439/udp +sgcp		440/tcp +sgcp		440/udp +decvms-sysmgt	441/tcp +decvms-sysmgt	441/udp +cvc_hostd	442/tcp +cvc_hostd	442/udp +https		443/tcp +https		443/udp +https		443/sctp +snpp		444/tcp	   #Simple Network Paging Protocol +snpp		444/udp	   #Simple Network Paging Protocol +#			   [RFC1568] +microsoft-ds	445/tcp +microsoft-ds	445/udp +ddm-rdb		446/tcp +ddm-rdb		446/udp +ddm-dfm		447/tcp +ddm-dfm		447/udp +ddm-ssl		448/tcp	   ddm-byte +ddm-ssl		448/udp	   ddm-byte +as-servermap	449/tcp	   #AS Server Mapper +as-servermap	449/udp	   #AS Server Mapper +tserver		450/tcp +tserver		450/udp +sfs-smp-net	451/tcp	   #Cray Network Semaphore server +sfs-smp-net	451/udp	   #Cray Network Semaphore server +sfs-config	452/tcp	   #Cray SFS config server +sfs-config	452/udp	   #Cray SFS config server +creativeserver	453/tcp	   #CreativeServer +creativeserver	453/udp	   #CreativeServer +contentserver	454/tcp	   #ContentServer +contentserver	454/udp	   #ContentServer +creativepartnr	455/tcp	   #CreativePartnr +creativepartnr	455/udp	   #CreativePartnr +macon-tcp	456/tcp +macon-udp	456/udp +scohelp		457/tcp +scohelp		457/udp +appleqtc	458/tcp	   #apple quick time +appleqtc	458/udp	   #apple quick time +ampr-rcmd	459/tcp +ampr-rcmd	459/udp +skronk		460/tcp +skronk		460/udp +datasurfsrv	461/tcp +datasurfsrv	461/udp +datasurfsrvsec	462/tcp +datasurfsrvsec	462/udp +alpes		463/tcp +alpes		463/udp +# +kpasswd		464/tcp	kpasswd5   # Kerberos (v5) +kpasswd		464/udp	kpasswd5   # Kerberos (v5) +#PROBLEMS!============================================================== +# IANA has officially assigned these two ports +smtps		465/tcp    #smtp protocol over TLS/SSL (was ssmtp) +smtps		465/udp    #smtp protocol over TLS/SSL (was ssmtp) +#PROBLEMS!============================================================== +urd		465/tcp	   #URL Rendezvous Directory for SSM +submissions	465/tcp	   #Message Submission over TLS +igmpv3lite	465/udp	   #IGMP over UDP for SSM +digital-vrc	466/tcp +digital-vrc	466/udp +mylex-mapd	467/tcp +mylex-mapd	467/udp +photuris	468/tcp +photuris	468/udp +rcp		469/tcp	   #Radio Control Protocol +rcp		469/udp	   #Radio Control Protocol +scx-proxy	470/tcp +scx-proxy	470/udp +mondex		471/tcp +mondex		471/udp +ljk-login	472/tcp +ljk-login	472/udp +hybrid-pop	473/tcp +hybrid-pop	473/udp +tn-tl-w1	474/tcp +tn-tl-w2	474/udp +tcpnethaspsrv	475/tcp +tcpnethaspsrv	475/udp +tn-tl-fd1	476/tcp +tn-tl-fd1	476/udp +ss7ns		477/tcp +ss7ns		477/udp +spsc		478/tcp +spsc		478/udp +iafserver	479/tcp +iafserver	479/udp +iafdbase	480/tcp +iafdbase	480/udp +ph		481/tcp +ph		481/udp +bgs-nsi		482/tcp +bgs-nsi		482/udp +ulpnet		483/tcp +ulpnet		483/udp +integra-sme	484/tcp	   #Integra Software Management Environment +integra-sme	484/udp	   #Integra Software Management Environment +powerburst	485/tcp	   #Air Soft Power Burst +powerburst	485/udp	   #Air Soft Power Burst +avian		486/tcp +avian		486/udp +saft		487/tcp	   #saft Simple Asynchronous File Transfer +saft		487/udp	   #saft Simple Asynchronous File Transfer +gss-http	488/tcp +gss-http	488/udp +nest-protocol	489/tcp +nest-protocol	489/udp +micom-pfs	490/tcp +micom-pfs	490/udp +go-login	491/tcp +go-login	491/udp +ticf-1		492/tcp	   #Transport Independent Convergence for FNA +ticf-1		492/udp	   #Transport Independent Convergence for FNA +ticf-2		493/tcp	   #Transport Independent Convergence for FNA +ticf-2		493/udp	   #Transport Independent Convergence for FNA +pov-ray		494/tcp	   #POV-Ray +pov-ray		494/udp	   #POV-Ray +intecourier	495/tcp +intecourier	495/udp +pim-rp-disc	496/tcp +pim-rp-disc	496/udp +retrospect	497/tcp	   #Retrospect backup and restore service +retrospect	497/udp	   #Retrospect backup and restore service +siam		498/tcp +siam		498/udp +iso-ill		499/tcp	   #ISO ILL Protocol +iso-ill		499/udp	   #ISO ILL Protocol +isakmp		500/tcp +isakmp		500/udp +stmf		501/tcp +stmf		501/udp +mbap		502/tcp    # Modbus Application Protocol +mbap		502/udp    # Modbus Application Protocol +intrinsa	503/tcp +intrinsa	503/udp +citadel		504/tcp +citadel		504/udp +mailbox-lm	505/tcp +mailbox-lm	505/udp +ohimsrv		506/tcp +ohimsrv		506/udp +crs		507/tcp +crs		507/udp +xvttp		508/tcp +xvttp		508/udp +snare		509/tcp +snare		509/udp +fcp		510/tcp	   #FirstClass Protocol +fcp		510/udp	   #FirstClass Protocol +passgo		511/tcp +passgo		511/udp +# +# Berkeley-specific services +# +exec		512/tcp	   #remote process execution; +#			   authentication performed using +#			   passwords and UNIX login names +biff		512/udp	   comsat	#used by mail system to notify users +#					of new mail received; currently +#					receives messages only from +#					processes on the same machine +login		513/tcp	   #remote login a la telnet; +#			   automatic authentication performed +#			   based on privileged port numbers +#			   and distributed data bases which +#			   identify "authentication domains" +who		513/udp	   whod		#maintains data bases showing who's +#					logged in to machines on a local +#					net and the load average of the +#					machine +shell		514/tcp	   cmd		#like exec, but automatic +#					authentication is performed as for +#					login server +syslog		514/udp +printer		515/tcp	   spooler +printer		515/udp	   spooler +videotex	516/tcp +videotex	516/udp +talk		517/tcp	   #like tenex link, but across +#			   machine - unfortunately, doesn't +#			   use link protocol (this is actually +#			   just a rendezvous port from which a +#			   tcp connection is established) +talk		517/udp	   #like tenex link, but across +#			   machine - unfortunately, doesn't +#			   use link protocol (this is actually +#			   just a rendezvous port from which a +#			   tcp connection is established) +ntalk		518/tcp +ntalk		518/udp +utime		519/tcp	   unixtime +utime		519/udp	   unixtime +efs		520/tcp	   #extended file name server +router		520/udp	   route routed	#local routing process (on site); +#					   uses variant of Xerox NS routing +#					   information protocol +ripng		521/tcp +ripng		521/udp +ulp		522/tcp +ulp		522/udp +ibm-db2		523/tcp +ibm-db2		523/udp +ncp		524/tcp +ncp		524/udp +timed		525/tcp	   timeserver +timed		525/udp	   timeserver +tempo		526/tcp	   newdate +tempo		526/udp	   newdate +stx		527/tcp	   #Stock IXChange +stx		527/udp	   #Stock IXChange +custix		528/tcp	   #Customer IXChange +custix		528/udp	   #Customer IXChange +irc-serv	529/tcp +irc-serv	529/udp +courier		530/tcp	   rpc +courier		530/udp	   rpc +conference	531/tcp	   chat +conference	531/udp	   chat +netnews		532/tcp	   readnews +netnews		532/udp	   readnews +netwall		533/tcp	   #for emergency broadcasts +netwall		533/udp	   #for emergency broadcasts +windream	534/tcp	   #windream Admin +windream	534/udp	   #windream Admin +iiop		535/tcp +iiop		535/udp +opalis-rdv	536/tcp +opalis-rdv	536/udp +nmsp		537/tcp	   #Networked Media Streaming Protocol +nmsp		537/udp	   #Networked Media Streaming Protocol +gdomap		538/tcp +gdomap		538/udp +apertus-ldp	539/tcp	   #Apertus Technologies Load Determination +apertus-ldp	539/udp	   #Apertus Technologies Load Determination +uucp		540/tcp	   uucpd +uucp		540/udp	   uucpd +uucp-rlogin	541/tcp +uucp-rlogin	541/udp +commerce	542/tcp +commerce	542/udp +klogin		543/tcp	   # Kerberos (v4/v5) +klogin		543/udp	   # Kerberos (v4/v5) +kshell		544/tcp	   krcmd	# Kerberos (v4/v5) +kshell		544/udp	   krcmd	# Kerberos (v4/v5) +appleqtcsrvr	545/tcp +appleqtcsrvr	545/udp +dhcpv6-client	546/tcp	   #DHCPv6 Client +dhcpv6-client	546/udp	   #DHCPv6 Client +dhcpv6-server	547/tcp	   #DHCPv6 Server +dhcpv6-server	547/udp	   #DHCPv6 Server +afpovertcp	548/tcp	   #AFP over TCP +afpovertcp	548/udp	   #AFP over TCP +idfp		549/tcp +idfp		549/udp +new-rwho	550/tcp	   new-who +new-rwho	550/udp	   new-who +cybercash	551/tcp +cybercash	551/udp +devshr-nts	552/tcp	   deviceshare +devshr-nts	552/udp	   deviceshare +pirp		553/tcp +pirp		553/udp +rtsp		554/tcp	   #Real Time Stream Control Protocol +rtsp		554/udp	   #Real Time Stream Control Protocol +dsf		555/tcp +dsf		555/udp +remotefs	556/tcp	   rfs rfs_server	# Brunhoff remote filesystem +remotefs	556/udp	   rfs rfs_server	# Brunhoff remote filesystem +openvms-sysipc	557/tcp +openvms-sysipc	557/udp +sdnskmp		558/tcp +sdnskmp		558/udp +teedtap		559/tcp +teedtap		559/udp +rmonitor	560/tcp	   rmonitord +rmonitor	560/udp	   rmonitord +monitor		561/tcp +monitor		561/udp +chshell		562/tcp	   chcmd +chshell		562/udp	   chcmd +nntps		563/tcp	   snntp	#nntp protocol over TLS/SSL +nntps		563/udp	   snntp	#nntp protocol over TLS/SSL +9pfs		564/tcp	   #plan 9 file service +9pfs		564/udp	   #plan 9 file service +whoami		565/tcp +whoami		565/udp +streettalk	566/tcp +streettalk	566/udp +banyan-rpc	567/tcp +banyan-rpc	567/udp +ms-shuttle	568/tcp	   #Microsoft shuttle +ms-shuttle	568/udp	   #Microsoft shuttle +ms-rome		569/tcp	   #Microsoft rome +ms-rome		569/udp	   #Microsoft rome +meter		570/tcp	   #demon +meter		570/udp	   #demon +umeter		571/tcp	   #udemon +umeter		571/udp	   #udemon +sonar		572/tcp +sonar		572/udp +banyan-vip	573/tcp +banyan-vip	573/udp +ftp-agent	574/tcp	   #FTP Software Agent System +ftp-agent	574/udp	   #FTP Software Agent System +vemmi		575/tcp +vemmi		575/udp +ipcd		576/tcp +ipcd		576/udp +vnas		577/tcp +vnas		577/udp +ipdd		578/tcp +ipdd		578/udp +decbsrv		579/tcp +decbsrv		579/udp +sntp-heartbeat	580/tcp +sntp-heartbeat	580/udp +bdp		581/tcp	   #Bundle Discovery Protocol +bdp		581/udp	   #Bundle Discovery Protocol +scc-security	582/tcp +scc-security	582/udp +philips-vc	583/tcp	   #Philips Video-Conferencing +philips-vc	583/udp	   #Philips Video-Conferencing +keyserver	584/tcp +keyserver	584/udp +password-chg	586/tcp +password-chg	586/udp +submission	587/tcp +submission	587/udp +cal		588/tcp +cal		588/udp +eyelink		589/tcp +eyelink		589/udp +tns-cml		590/tcp +tns-cml		590/udp +http-alt	591/tcp	   #FileMaker, Inc. - HTTP Alternate (see Port 80) +http-alt	591/udp	   #FileMaker, Inc. - HTTP Alternate (see Port 80) +eudora-set	592/tcp +eudora-set	592/udp +http-rpc-epmap	593/tcp	   #HTTP RPC Ep Map +http-rpc-epmap	593/udp	   #HTTP RPC Ep Map +tpip		594/tcp +tpip		594/udp +cab-protocol	595/tcp +cab-protocol	595/udp +smsd		596/tcp +smsd		596/udp +ptcnameservice	597/tcp	   #PTC Name Service +ptcnameservice	597/udp	   #PTC Name Service +sco-websrvrmg3	598/tcp	   #SCO Web Server Manager 3 +sco-websrvrmg3	598/udp	   #SCO Web Server Manager 3 +acp		599/tcp	   #Aeolon Core Protocol +acp		599/udp	   #Aeolon Core Protocol +ipcserver	600/tcp	   #Sun IPC server +ipcserver	600/udp	   #Sun IPC server +syslog-conn	601/tcp    #Reliable Syslog Service +syslog-conn	601/udp    #Reliable Syslog Service +xmlrpc-beep	602/tcp    #XML-RPC over BEEP +xmlrpc-beep	602/udp    #XML-RPC over BEEP +idxp		603/tcp +idxp		603/udp +tunnel		604/tcp +tunnel		604/udp +soap-beep	605/tcp    #SOAP over BEEP +soap-beep	605/udp    #SOAP over BEEP +urm		606/tcp	   #Cray Unified Resource Manager +urm		606/udp	   #Cray Unified Resource Manager +nqs		607/tcp +nqs		607/udp +sift-uft	608/tcp	   #Sender-Initiated/Unsolicited File Transfer +sift-uft	608/udp	   #Sender-Initiated/Unsolicited File Transfer +npmp-trap	609/tcp +npmp-trap	609/udp +npmp-local	610/tcp +npmp-local	610/udp +npmp-gui	611/tcp +npmp-gui	611/udp +hmmp-ind	612/tcp    #HMMP Indication +hmmp-ind	612/udp	   #HMMP Indication +hmmp-op		613/tcp    #HMMP Operation +hmmp-op		613/udp	   #HMMP Operation +sshell		614/tcp	   #SSLshell +sshell		614/udp +sco-inetmgr	615/tcp	   #Internet Configuration Manager +sco-inetmgr	615/udp    #Internet Configuration Manager +sco-sysmgr	616/tcp    #SCO System Administration Server +sco-sysmgr	616/udp    #SCO System Administration Server +sco-dtmgr	617/tcp    #SCO Desktop Administration Server +sco-dtmgr	617/udp    #SCO Desktop Administration Server +dei-icda	618/tcp +dei-icda	618/udp +compaq-evm	619/tcp    #Compaq EVM +compaq-evm	619/udp    #Compaq EVM +sco-websrvrmgr	620/tcp    #SCO WebServer Manager +sco-websrvrmgr	620/udp    #SCO WebServer Manager +escp-ip		621/tcp    #ESCP +escp-ip		621/udp    #ESCP +collaborator	622/tcp +collaborator	622/udp +asf-rmcp	623/tcp    #ASF Remote Management and Control Protocol +asf-rmcp	623/udp    #ASF Remote Management and Control Protocol +cryptoadmin	624/tcp    #Crypto Admin +cryptoadmin	624/udp    #Crypto Admin +dec-dlm		625/tcp    dec_dlm	#DEC DLM +dec-dlm		625/udp    dec_dlm	#DEC DLM +asia		626/tcp +asia		626/udp +passgo-tivoli	627/tcp    #PassGo Tivoli +passgo-tivoli	627/udp    #PassGo Tivoli +qmqp		628/tcp +qmqp		628/udp +3com-amp3	629/tcp    #3Com AMP3 +3com-amp3	629/udp    #3Com AMP3 +rda		630/tcp +rda		630/udp +ipp		631/tcp	   ipps	#IPP (Internet Printing Protocol) +ipp		631/udp	   ipps	#IPP (Internet Printing Protocol) +bmpp		632/tcp +bmpp		632/udp +servstat	633/tcp    #Service Status update (Sterling Software) +servstat	633/udp    #Service Status update (Sterling Software) +ginad		634/tcp +ginad		634/udp +rlzdbase	635/tcp    #RLZ DBase +rlzdbase	635/udp    #RLZ DBase +ldaps		636/tcp	   sldap	#ldap protocol over TLS/SSL +ldaps		636/udp	   sldap +lanserver	637/tcp +lanserver	637/udp +mcns-sec	638/tcp +mcns-sec	638/udp +msdp		639/tcp +msdp		639/udp +entrust-sps	640/tcp +entrust-sps	640/udp +repcmd		641/tcp +repcmd		641/udp +esro-emsdp	642/tcp    #ESRO-EMSDP V1.3 +esro-emsdp	642/udp    #ESRO-EMSDP V1.3 +sanity		643/tcp    #SANity +sanity		643/udp    #SANity +dwr		644/tcp +dwr		644/udp +pssc		645/tcp +pssc		645/udp +ldp		646/tcp +ldp		646/udp +dhcp-failover	647/tcp    #DHCP Failover +dhcp-failover	647/udp    #DHCP Failover +rrp		648/tcp    #Registry Registrar Protocol (RRP) +rrp		648/udp    #Registry Registrar Protocol (RRP) +cadview-3d	649/tcp    #Cadview-3d - streaming 3d models over the internet +cadview-3d	649/udp    #Cadview-3d - streaming 3d models over the internet +obex		650/tcp +obex		650/udp +ieee-mms	651/tcp    #IEEE MMS +ieee-mms	651/udp    #IEEE MMS +hello-port	652/tcp +hello-port	652/udp +repscmd		653/tcp +repscmd		653/udp +aodv		654/tcp	   #Ad-Hoc On-Demand Distance Vector Routing Protocol +aodv		654/udp	   #Ad-Hoc On-Demand Distance Vector Routing Protocol +tinc		655/tcp +tinc		655/udp +spmp		656/tcp +spmp		656/udp +rmc		657/tcp +rmc		657/udp +tenfold		658/tcp +tenfold		658/udp +mac-srvr-admin	660/tcp    #MacOS Server Admin +mac-srvr-admin	660/udp    #MacOS Server Admin +hap		661/tcp +hap		661/udp +pftp		662/tcp +pftp		662/udp +purenoise	663/tcp    #PureNoise +purenoise	663/udp    #PureNoise +asf-secure-rmcp	664/tcp    #ASF Secure Remote Management and Control Protocol +asf-secure-rmcp	664/udp    #ASF Secure Remote Management and Control Protocol +sun-dr		665/tcp    #Sun DR +sun-dr		665/udp    #Sun DR +mdqs		666/tcp +mdqs		666/udp +#PROBLEMS!=============================================== +doom		666/tcp	   #doom Id Software +doom		666/udp	   #doom Id Software +#PROBLEMS!=============================================== +disclose	667/tcp    #campaign contribution disclosures - SDR Technologies +disclose	667/udp    #campaign contribution disclosures - SDR Technologies +mecomm		668/tcp +mecomm		668/udp +meregister	669/tcp +meregister	669/udp +vacdsm-sws	670/tcp +vacdsm-sws	670/udp +vacdsm-app	671/tcp +vacdsm-app	671/udp +vpps-qua	672/tcp +vpps-qua	672/udp +cimplex		673/tcp +cimplex		673/udp +acap		674/tcp	   #Application Configuration Access Protocol +acap		674/udp	   #Application Configuration Access Protocol +dctp		675/tcp +dctp		675/udp +vpps-via	676/tcp    #VPPS Via +vpps-via	676/udp    #VPPS Via +vpp		677/tcp    #Virtual Presence Protocol +vpp		677/udp    #Virtual Presence Protocol +ggf-ncp		678/tcp    #GNU Generation Foundation NCP +ggf-ncp		678/udp    #GNU Generation Foundation NCP +mrm		679/tcp +mrm		679/udp +entrust-aaas	680/tcp +entrust-aaas	680/udp +entrust-aams	681/tcp +entrust-aams	681/udp +xfr		682/tcp +xfr		682/udp +corba-iiop	683/tcp    #CORBA IIOP +corba-iiop	683/udp    #CORBA IIOP +corba-iiop-ssl	684/tcp    #CORBA IIOP SSL +corba-iiop-ssl	684/udp    #CORBA IIOP SSL +mdc-portmapper	685/tcp    #MDC Port Mapper +mdc-portmapper	685/udp    #MDC Port Mapper +hcp-wismar	686/tcp    #Hardware Control Protocol Wismar +hcp-wismar	686/udp    #Hardware Control Protocol Wismar +asipregistry	687/tcp +asipregistry	687/udp +realm-rusd	688/tcp    #ApplianceWare management protocol +realm-rusd	688/udp    #ApplianceWare management protocol +nmap		689/tcp +nmap		689/udp +vatp		690/tcp    #Velazquez Application Transfer Protocol +vatp		690/udp    #Velazquez Application Transfer Protocol +msexch-routing	691/tcp    #MS Exchange Routing +msexch-routing	691/udp    #MS Exchange Routing +hyperwave-isp	692/tcp    #Hyperwave-ISP +hyperwave-isp	692/udp    #Hyperwave-ISP +connendp	693/tcp +connendp	693/udp +ha-cluster	694/tcp +ha-cluster	694/udp +ieee-mms-ssl	695/tcp +ieee-mms-ssl	695/udp +rushd		696/tcp +rushd		696/udp +uuidgen		697/tcp +uuidgen		697/udp +olsr		698/tcp +olsr		698/udp +accessnetwork	699/tcp    #Access Network +accessnetwork	699/udp    #Access Network +epp		700/tcp    #Extensible Provisioning Protocol +epp		700/udp    #Extensible Provisioning Protocol +lmp		701/tcp    #Link Management Protocol (LMP) +lmp		701/udp    #Link Management Protocol (LMP) +iris-beep	702/tcp    #IRIS over BEEP +iris-beep	702/udp    #IRIS over BEEP +elcsd		704/tcp	   #errlog copy/server daemon +elcsd		704/udp	   #errlog copy/server daemon +agentx		705/tcp    #AgentX +agentx		705/udp    #AgentX +silc		706/tcp +silc		706/udp +borland-dsj	707/tcp    #Borland DSJ +borland-dsj	707/udp	   #Borland DSJ +entrustmanager	709/tcp	   #EntrustManager +entrustmanager	709/udp	   #EntrustManager +entrust-ash	710/tcp    #Entrust Administration Service Handler +entrust-ash	710/udp    #Entrust Administration Service Handler +cisco-tdp	711/tcp    #Cisco TDP +cisco-tdp	711/udp    #Cisco TDP +tbrpf		712/tcp +tbrpf		712/udp +iris-xpc	713/tcp    #IRIS over XPC +iris-xpc	713/udp    #IRIS over XPC +iris-xpcs	714/tcp    #IRIS over XPCS +iris-xpcs	714/udp    #IRIS over XPCS +iris-lwz	715/tcp +iris-lwz	715/udp +pana		716/udp	   #PANA Messages +#		717-728	   #unassigned +netviewdm1	729/tcp	   #IBM NetView DM/6000 Server/Client +netviewdm1	729/udp	   #IBM NetView DM/6000 Server/Client +netviewdm2	730/tcp	   #IBM NetView DM/6000 send/tcp +netviewdm2	730/udp	   #IBM NetView DM/6000 send/tcp +netviewdm3	731/tcp	   #IBM NetView DM/6000 receive/tcp +netviewdm3	731/udp	   #IBM NetView DM/6000 receive/tcp +#		732-740	   #unassigned +netgw		741/tcp	   #netGW +netgw		741/udp	   #netGW +netrcs		742/tcp	   #Network based Rev. Cont. Sys. +netrcs		742/udp	   #Network based Rev. Cont. Sys. +flexlm		744/tcp	   #Flexible License Manager +flexlm		744/udp	   #Flexible License Manager +fujitsu-dev	747/tcp	   #Fujitsu Device Control +fujitsu-dev	747/udp	   #Fujitsu Device Control +ris-cm		748/tcp	   #Russell Info Sci Calendar Manager +ris-cm		748/udp	   #Russell Info Sci Calendar Manager +kerberos-adm	749/tcp	   #Kerberos administration (v5) +kerberos-adm	749/udp	   #Kerberos administration (v5) +rfile		750/tcp +loadav		750/udp +kerberos-iv	750/udp	   kdc		# Kerberos (v4) +pump		751/tcp +pump		751/udp +qrh		752/tcp +qrh		752/udp +rrh		753/tcp +rrh		753/udp +krb_prop	754/tcp	   krb5_prop	# kerberos/v5 server propagation +#PROBLEMS!======================================================== +tell		754/tcp	   #send +#PROBLEMS!======================================================== +tell		754/udp	   #send +#		755-757    #unassigned +nlogin		758/tcp +nlogin		758/udp +con		759/tcp +con		759/udp +ns		760/tcp +ns		760/udp +rxe		761/tcp +rxe		761/udp +quotad		762/tcp +quotad		762/udp +cycleserv	763/tcp +cycleserv	763/udp +omserv		764/tcp +omserv		764/udp +webster		765/tcp +webster		765/udp +phonebook	767/tcp	   #phone +phonebook	767/udp	   #phone +vid		769/tcp +vid		769/udp +cadlock		770/tcp +cadlock		770/udp +rtip		771/tcp +rtip		771/udp +cycleserv2	772/tcp +cycleserv2	772/udp +submit		773/tcp +notify		773/udp +rpasswd		774/tcp +acmaint-dbd	774/udp    acmaint_dbd +entomb		775/tcp +acmaint-transd	775/udp    acmaint_transd +wpages		776/tcp +wpages		776/udp +multiling-http	777/tcp    #Multiling HTTP +multiling-http	777/udp    #Multiling HTTP +wpgs		780/tcp +wpgs		780/udp +mdbs-daemon	800/tcp    mdbs_daemon +mdbs-daemon	800/udp    mdbs_daemon +device		801/tcp +device		801/udp +mbap-s		802/tcp    # Modbus Application Protocol Secure +mbap-s		802/udp    # Modbus Application Protocol Secure +fcp-udp		810/tcp    #FCP +fcp-udp		810/udp    #FCP Datagram +itm-mcell-s	828/tcp +itm-mcell-s	828/udp +pkix-3-ca-ra	829/tcp    #PKIX-3 CA/RA +pkix-3-ca-ra	829/udp    #PKIX-3 CA/RA +netconf-ssh	830/tcp    #NETCONF over SSH +netconf-ssh	830/udp    #NETCONF over SSH +netconf-beep	831/tcp    #NETCONF over BEEP +netconf-beep	831/udp    #NETCONF over BEEP +netconfsoaphttp	832/tcp    #NETCONF for SOAP over HTTPS +netconfsoaphttp	832/udp    #NETCONF for SOAP over HTTPS +netconfsoapbeep	833/tcp    #NETCONF for SOAP over BEEP +netconfsoapbeep	833/udp    #NETCONF for SOAP over BEEP +dhcp-failover2	847/tcp    #dhcp-failover 2 +dhcp-failover2	847/udp    #dhcp-failover 2 +gdoi		848/tcp +gdoi		848/udp +#		849-852    #unassigned +domain-s	853/tcp    #DNS query-response protocol +domain-s	853/udp    #DNS query-response protocol +#		855-859    #unassigned +iscsi		860/tcp +iscsi		860/udp +owamp-control	861/tcp +owamp-control	861/udp +twamp-control	862/tcp +twamp-control	862/udp +#		863-872    #unassigned +supfilesrv	871/tcp    # for SUP +rsync		873/tcp +rsync		873/udp +iclcnet-locate	886/tcp    #ICL coNETion locate server +iclcnet-locate	886/udp    #ICL coNETion locate server +iclcnet_svinfo	887/tcp    #ICL coNETion server info +iclcnet_svinfo	887/udp    #ICL coNETion server info +accessbuilder	888/tcp +accessbuilder	888/udp +omginitialrefs	900/tcp    #OMG Initial Refs +omginitialrefs	900/udp    #OMG Initial Refs +swat		901/tcp	   # samba web configuration tool +smpnameres	901/tcp +smpnameres	901/udp +ideafarm-chat	902/tcp +ideafarm-chat	902/udp +ideafarm-catch	903/tcp +ideafarm-catch	903/udp +kink		910/tcp    #Kerberized Internet Negotiation of Keys (KINK) +kink		910/udp    #Kerberized Internet Negotiation of Keys (KINK) +xact-backup	911/tcp +xact-backup	911/udp +apex-mesh	912/tcp    #APEX relay-relay service +apex-mesh	912/udp    #APEX relay-relay service +apex-edge	913/tcp    #APEX endpoint-relay service +apex-edge	913/udp    #APEX endpoint-relay service +rndc		953/tcp	   # named's rndc control socket +ftps-data	989/tcp	   # ftp protocol, data, over TLS/SSL +ftps-data	989/udp +ftps		990/tcp	   # ftp protocol, control, over TLS/SSL +ftps		990/udp +nas		991/tcp    #Netnews Administration System +nas		991/udp    #Netnews Administration System +telnets		992/tcp	   # telnet protocol over TLS/SSL +telnets		992/udp +imaps		993/tcp	   # imap4 protocol over TLS/SSL +imaps		993/udp +ircs		994/tcp	   # irc protocol over TLS/SSL +ircs		994/udp +pop3s		995/tcp	   spop3	# pop3 protocol over TLS/SSL +pop3s		995/udp	   spop3 +vsinet		996/tcp +vsinet		996/udp +maitrd		997/tcp +maitrd		997/udp +busboy		998/tcp +puparp		998/udp +garcon		999/tcp +applix		999/udp	   #Applix ac +puprouter	999/tcp +puprouter	999/udp +cadlock2	1000/tcp +cadlock2	1000/udp +webpush		1001/tcp   #HTTP Web Push +surf		1010/tcp +surf		1010/udp +exp1		1021/tcp   #RFC3692-style Experiment 1 (*)    [RFC4727] +exp1		1021/udp   #RFC3692-style Experiment 1 (*)    [RFC4727] +exp1		1021/sctp  #RFC3692-style Experiment 1 (*)    [RFC4727] +exp2		1022/tcp   #RFC3692-style Experiment 2 (*)    [RFC4727] +exp2		1022/udp   #RFC3692-style Experiment 2 (*)    [RFC4727] +exp2		1022/sctp  #RFC3692-style Experiment 2 (*)    [RFC4727] +# +# REGISTERED PORT NUMBERS +# +blackjack	1025/tcp   #network blackjack +blackjack	1025/udp   #network blackjack +cap		1026/tcp   #Calendar Access Protocol +cap		1026/udp   #Calendar Access Protocol +6a44		1027/udp   #IPv6 Behind NAT44 CPEs +boinc-client	1043/tcp   #BOINC Client Control +boinc-client	1043/udp   #BOINC Client Control +nim		1058/tcp +nim		1058/udp +nimreg		1059/tcp +nimreg		1059/udp +instl-boots	1067/tcp   instl_boots	#Installation Bootstrap Proto. Serv. +instl-boots	1067/udp   instl_boots	#Installation Bootstrap Proto. Serv. +instl-bootc	1068/tcp   instl_bootc	#Installation Bootstrap Proto. Cli. +instl-bootc	1068/udp   instl_bootc	#Installation Bootstrap Proto. Cli. +socks		1080/tcp +socks		1080/udp +webobjects	1085/tcp   #Web Objects +webobjects	1085/udp   #Web Objects +ff-annunc	1089/tcp   #FF Annunciation  +ff-annunc	1089/udp   #FF Annunciation  +ff-fms		1090/tcp   #FF Fieldbus Message Specification  +ff-fms		1090/udp   #FF Fieldbus Message Specification +ff-sm		1091/tcp   #FF System Management +ff-sm		1091/udp   #FF System Management +cnrprotocol	1096/tcp   #Common Name Resolution Protocol +cnrprotocol	1096/udp   #Common Name Resolution Protocol +rmiactivation	1098/tcp   #RMI Activation +rmiactivation	1098/udp   #RMI Activation +rmiregistry	1099/tcp   #RMI Registry +rmiregistry	1099/udp   #RMI Registry +mctp		1100/tcp   #MCTP  +mctp		1100/udp   #MCTP +kpop		1109/tcp   #Unofficial +kpop		1109/udp   #Unofficial +nfsd-status	1110/tcp   #Cluster status info +nfsd-keepalive	1110/udp   #Client status info +supfiledbg	1127/tcp   # for SUP +c1222-acse	1153/tcp   #ANSI C12.22 Port +c1222-acse	1153/udp   #ANSI C12.22 Port +nfa		1155/tcp   #Network File Access +nfa		1155/udp   #Network File Access +cisco-ipsla	1167/tcp   #Cisco IP SLAs Control Protocol +cisco-ipsla	1167/udp   #Cisco IP SLAs Control Protocol +cisco-ipsla	1167/sctp  #Cisco IP SLAs Control Protocol +tripwire	1169/tcp   #TRIPWIRE +tripwire	1169/udp   #TRIPWIRE +skkserv		1178/tcp   #SKK (kanji input) +mysql-cluster	1186/tcp   #MySQL Cluster Manager +mysql-cluster	1186/udp   #MySQL Cluster Manager +openvpn		1194/tcp   #OpenVPN +openvpn		1194/udp   #OpenVPN +rsf-1		1195/tcp   #RSF-1 clustering +rsf-1		1195/udp   #RSF-1 clustering +qt-serveradmin	1220/tcp   #QT SERVER ADMIN +qt-serveradmin	1220/udp   #QT SERVER ADMIN +healthd		1281/tcp   #healthd +healthd		1281/udp   #healthd +pkt-krb-ipsec	1293/tcp   #PKT-KRB-IPSec +pkt-krb-ipsec	1293/udp   #PKT-KRB-IPSec +h323hostcallsc	1300/tcp   #H323 Host Call Secure +h323hostcallsc	1300/udp   #H323 Host Call Secure +jtag-server	1309/tcp   #JTAG server +jtag-server	1309/udp   #JTAG server +hkrb5gatekeeper	1318/tcp   #krb5gatekeeper +krb5gatekeeper	1318/udp   #krb5gatekeeper +netdb-export	1329/tcp   #netdb-export +netdb-export	1329/udp   #netdb-export +digital-notary	1335/tcp   #Digital Notary Protocol +digital-notary	1335/udp   #Digital Notary Protocol +icap		1344/tcp   #ICAP +icap		1344/udp   #ICAP +ms-sql-s	1433/tcp   #Microsoft-SQL-Server +ms-sql-s	1433/udp   #Microsoft-SQL-Server +ms-sql-m	1434/tcp   #Microsoft-SQL-Monitor +ms-sql-m	1434/udp   #Microsoft-SQL-Monitor +ingreslock	1524/tcp   #ingres +ingreslock	1524/udp   #ingres +#PROBLEMS!======================================================== +orasrv		1525/tcp   #oracle +orasrv		1525/udp   #oracle +#PROBLEMS!======================================================== +prospero-np	1525/tcp   #Prospero Directory Service non-priv +prospero-np	1525/udp   #Prospero Directory Service non-priv +pdap-np		1526/tcp   #Prospero Data Access Prot non-priv +pdap-np		1526/udp   #Prospero Data Access Prot non-priv +tlisrv		1527/tcp   #oracle +tlisrv		1527/udp   #oracle +pciarray	1552/tcp +pciarray	1552/udp +issd		1600/tcp +issd		1600/udp +# IMPORTANT NOTE: Ports 1645/1646 are the traditional radius ports used by +# many vendors without obtaining official IANA assignment.  The official +# assignment is now ports 1812/1813 and users are encouraged to migrate +# when possible to these new ports. +#radius		1645/udp   #RADIUS authentication protocol (old) +#radacct	1646/udp   #RADIUS accounting protocol (old) +nkd		1650/tcp +nkd		1650/udp +shiva_confsrvr	1651/tcp +shiva_confsrvr	1651/udp +xnmp		1652/tcp +xnmp		1652/udp +l2f		1701/tcp   #l2f +l2f		1701/udp   #l2f +l2tp		1701/tcp   #Layer 2 Tunnelling Protocol +l2tp		1701/udp   #Layer 2 Tunnelling Protocol +pptp		1723/tcp   #Point-to-point tunnelling protocol +# IMPORTANT NOTE: See comments for ports 1645/1646 when using older equipment +radius		1812/udp   #RADIUS authentication protocol (IANA sanctioned) +radacct		1813/udp   #RADIUS accounting protocol (IANA sanctioned) +ssdp		1900/tcp   #Selective Service Discovery Protocol (UPnP) +ssdp		1900/udp   #Selective Service Discovery Protocol (UPnP) +licensedaemon	1986/tcp   #cisco license management +licensedaemon	1986/udp   #cisco license management +tr-rsrb-p1	1987/tcp   #cisco RSRB Priority 1 port +tr-rsrb-p1	1987/udp   #cisco RSRB Priority 1 port +tr-rsrb-p2	1988/tcp   #cisco RSRB Priority 2 port +tr-rsrb-p2	1988/udp   #cisco RSRB Priority 2 port +tr-rsrb-p3	1989/tcp   #cisco RSRB Priority 3 port +tr-rsrb-p3	1989/udp   #cisco RSRB Priority 3 port +#PROBLEMS!=================================================== +#mshnet		1989/tcp   #MHSnet system +#mshnet		1989/udp   #MHSnet system +#PROBLEMS!=================================================== +stun-p1		1990/tcp   #cisco STUN Priority 1 port +stun-p1		1990/udp   #cisco STUN Priority 1 port +stun-p2		1991/tcp   #cisco STUN Priority 2 port +stun-p2		1991/udp   #cisco STUN Priority 2 port +stun-p3		1992/tcp   #cisco STUN Priority 3 port +stun-p3		1992/udp   #cisco STUN Priority 3 port +#PROBLEMS!=================================================== +ipsendmsg	1992/tcp +ipsendmsg	1992/udp +#PROBLEMS!=================================================== +snmp-tcp-port	1993/tcp   #cisco SNMP TCP port +snmp-tcp-port	1993/udp   #cisco SNMP TCP port +stun-port	1994/tcp   #cisco serial tunnel port +stun-port	1994/udp   #cisco serial tunnel port +perf-port	1995/tcp   #cisco perf port +perf-port	1995/udp   #cisco perf port +tr-rsrb-port	1996/tcp   #cisco Remote SRB port +tr-rsrb-port	1996/udp   #cisco Remote SRB port +gdp-port	1997/tcp   #cisco Gateway Discovery Protocol +gdp-port	1997/udp   #cisco Gateway Discovery Protocol +x25-svc-port	1998/tcp   #cisco X.25 service (XOT) +x25-svc-port	1998/udp   #cisco X.25 service (XOT) +tcp-id-port	1999/tcp   #cisco identification port +tcp-id-port	1999/udp   #cisco identification port +cfingerd	2003/tcp   #GNU finger +mailbox		2004/tcp +oracle		2005/udp +raid-cc		2006/udp   #raid +raid-am		2007/udp +raid-cc		2011/tcp   #raid +lam		2040/tcp +lam		2040/udp +interbase	2041/tcp +interbase	2041/udp +#PROBLEMS!============================================================= +#shilp		2049/tcp +#shilp		2049/udp +#PROBLEMS!============================================================= +nfsd		2049/tcp   nfs		# NFS server daemon +nfsd		2049/udp   nfs		# NFS server daemon +nfsd		2049/sctp  nfs		# NFS server daemon +dlsrpn		2065/tcp   #Data Link Switch Read Port Number +dlsrpn		2065/udp   #Data Link Switch Read Port Number +dlswpn		2067/tcp   #Data Link Switch Write Port Number +dlswpn		2067/udp   #Data Link Switch Write Port Number +gnunet		2086/tcp   #GNUnet +gnunet		2086/udp   #GNUnet +descent3	2092/tcp   #Descent 3 +descent3	2092/udp   #Descent 3 +h2250-annex-g	2099/tcp   #H.225.0 Annex G +h2250-annex-g	2099/udp   #H.225.0 Annex G +rtcm-sc104	2101/tcp   #rtcm-sc104 +rtcm-sc104	2101/udp   #rtcm-sc104 +zephyr-srv	2102/tcp   #Zephyr server +zephyr-srv	2102/udp   #Zephyr server +zephyr-clt	2103/udp   #Zephyr serv-hm connection +zephyr-hm	2104/udp   #Zephyr hostmanager +minipay		2105/tcp   #MiniPay +minipay		2105/udp   #MiniPay +mzap		2106/tcp   #MZAP +mzap		2106/udp   #MZAP +#PROBLEMS!============================================================= +eklogin		2105/tcp   #Kerberos (v4) encrypted rlogin +eklogin		2105/udp   #Kerberos (v4) encrypted rlogin +ekshell		2106/tcp   #Kerberos (v4) encrypted rshell +ekshell		2106/udp   #Kerberos (v4) encrypted rshell +#PROBLEMS!============================================================= +gdbremote	2159/tcp   #GDB Remote Debug Port +gdbremote	2159/udp   #GDB Remote Debug Port +apc-2160	2160/tcp   #APC 2160 +apc-2160	2160/udp   #APC 2160 +apc-2161	2161/tcp   #APC 2161 +apc-2161	2161/udp   #APC 2161 +msfw-storage	2171/tcp   #MS Firewall Storage +msfw-storage	2171/udp   #MS Firewall Storage +msfw-s-storage	2172/tcp   #MS Firewall SecureStorage +msfw-s-storage	2172/udp   #MS Firewall SecureStorage +msfw-replica	2173/tcp   #MS Firewall Replication +msfw-replica	2173/udp   #MS Firewall Replication +msfw-array	2174/tcp   #MS Firewall Intra Array +msfw-array	2174/udp   #MS Firewall Intra Array +airsync		2175/tcp   #Microsoft Desktop AirSync Protocol +airsync		2175/udp   #Microsoft Desktop AirSync Protocol +rapi		2176/tcp   #Microsoft ActiveSync Remote API +rapi		2176/udp   #Microsoft ActiveSync Remote API +vmrdp		2179/tcp   #Microsoft RDP for virtual machines +vmrdp		2179/udp   #Microsoft RDP for virtual machines +jps		2205/tcp   #Java Presentation Server +jps		2205/udp   #Java Presentation Server +hpocbus		2206/tcp   #HP OpenCall bus +hpocbus		2206/udp   #HP OpenCall bus +hpssd		2207/tcp   #HP Status and Services +hpssd		2207/udp   #HP Status and Services +hpiod		2208/tcp   #HP I/O Backend +hpiod		2208/udp   #HP I/O Backend +rimf-ps		2209/tcp   #HP RIM for Files Portal Service +rimf-ps		2209/udp   #HP RIM for Files Portal Service +#		2210-2212	Unassigned +mysql-im	2273/tcp   #MySQL Instance Manager +mysql-im	2273/udp   #MySQL Instance Manager +dbm		2345/tcp   #dbm +dbm		2345/udp   #dbm +rsmtp		2390/tcp   #RSMTP +rsmtp		2390/udp   #RSMTP +cvspserver	2401/tcp   #CVS network server +cvspserver	2401/udp   #CVS network server +venus		2430/tcp   #venus +venus		2430/udp   #venus +venus-se	2431/tcp   #venus-se +venus-se	2431/udp   #venus-se +codasrv		2432/tcp   #codasrv +codasrv		2432/udp   #codasrv +codasrv-se	2433/tcp   #codasrv-se +codasrv-se	2433/udp   #codasrv-se +sybasedbsynch	2439/tcp   #SybaseDBSynch +sybasedbsynch	2439/udp   #SybaseDBSynch +citrixima	2512/tcp   #Citrix IMA +citrixima	2512/udp   #Citrix IMA +citrixadmin	2513/tcp   #Citrix ADMIN +citrixadmin	2513/udp   #Citrix ADMIN +hpstgmgr	2600/tcp   #HPSTGMGR +hpstgmgr	2600/udp   #HPSTGMGR +discp-client	2601/tcp   #discp client +discp-client	2601/udp   #discp client +discp-server	2602/tcp   #discp server +discp-server	2602/udp   #discp server +servicemeter	2603/tcp   #Service Meter +servicemeter	2603/udp   #Service Meter +nsc-ccs		2604/tcp   #NSC CCS	 +nsc-ccs		2604/udp   #NSC CCS	 +nsc-posa	2605/tcp   #NSC POSA +nsc-posa	2605/udp   #NSC POSA +netmon		2606/tcp   #Dell Netmon +netmon		2606/udp   #Dell Netmon +connection	2607/tcp   #Dell Connection +connection	2607/udp   #Dell Connection +wag-service	2608/tcp   #Wag Service +wag-service	2608/udp   #Wag Service +dict		2628/tcp   #RFC 2229 +dict		2628/udp   #RFC 2229 +smpp		2775/tcp   #SMPP +smpp		2775/udp   #SMPP +www-dev		2784/tcp   #world wide web - development +www-dev		2784/udp   #world wide web - development +citrix-rtmp	2897/tcp   #Citrix RTMP +citrix-rtmp	2897/udp   #Citrix RTMP +m2ua		2904/tcp   #M2UA +m2ua		2904/udp   #M2UA +m2ua		2904/sctp  #M2UA +m3ua		2905/tcp   #M3UA +m3ua		2905/sctp  #M3UA +megaco-h248	2944/tcp   #Megaco H-248 +megaco-h248	2944/udp   #Megaco H-248 +megaco-h248	2944/sctp  #Megaco-H.248 text +h248-binary	2945/tcp   #H248 Binary +h248-binary	2945/udp   #H248 Binary +h248-binary	2945/sctp  #Megaco/H.248 binary +netplan		2983/tcp   #NETPLAN +netplan		2983/udp   #NETPLAN +cifs		3020/tcp   #CIFS +cifs		3020/udp   #CIFS +eppc		3031/tcp   #Remote AppleEvents/PPC Toolbox +eppc		3031/udp   #Remote AppleEvents/PPC Toolbox +gds_db		3050/tcp   #InterBase Database Remote Protocol +gds_db		3050/udp   #InterBase Database Remote Protocol +itu-bicc-stc	3097/sctp  #ITU-T Q.1902.1/Q.2150.3 +grubd		3136/tcp   #Grub Server Port +grubd		3136/udp   #Grub Server Port +iscsi-target	3260/tcp   # iSCSI port +iscsi-target	3260/udp   # iSCSI port +mysql		3306/tcp   #MySQL +mysql		3306/udp   #MySQL +ms-wbt-server	3389/tcp   rdp #MS WBT Server +ms-wbt-server	3389/udp   #MS WBT Server +efi-lm		3392/tcp   #EFI License Management +efi-lm		3392/udp   #EFI License Management +prsvp		3455/tcp   #RSVP Port +prsvp		3455/udp   rsvp-encap	#RSVP Port +nppmp		3476/tcp   #NVIDIA Mgmt Protocol +nppmp		3476/udp   #NVIDIA Mgmt Protocol +nut		3493/tcp   #Network UPS Tools +nut		3493/udp   #Network UPS Tools +lsp-ping	3503/tcp   #MPLS LSP-echo Port +lsp-ping	3503/udp   #MPLS LSP-echo Port +802-11-iapp	3517/tcp   #IEEE 802.11 WLANs WG IAPP +802-11-iapp	3517/udp   #IEEE 802.11 WLANs WG IAPP +jboss-iiop	3528/tcp   #JBoss IIOP +jboss-iiop	3528/udp   #JBoss IIOP +jboss-iiop-ssl	3529/tcp   #JBoss IIOP/SSL +jboss-iiop-ssl	3529/udp   #JBoss IIOP/SSL +m2pa		3565/sctp  #M2PA +m2pa		3565/tcp   #M2PA +tsp		3653/tcp   #Tunnel Setup Protocol +tsp		3653/udp   #Tunnel Setup Protocol +daap		3689/tcp   #Digital Audio Access Protocol +daap		3689/udp   #Digital Audio Access Protocol +svn		3690/tcp   #Subversion +svn		3690/udp   #Subversion +bfd-control	3784/tcp   #BFD Control Protocol +bfd-control	3784/udp   #BFD Control Protocol +bfd-echo	3785/tcp   #BFD Echo Protocol  +bfd-echo	3785/udp   #BFD Echo Protocol +asap-tcp	3863/tcp   #asap tcp port +asap-udp	3863/udp   #asap udp port +asap-sctp	3863/sctp  #asap sctp +asap-tcp-tls	3864/tcp   #asap/tls tcp port +asap-sctp-tls	3864/sctp  #asap-sctp/tls  +diameter	3868/tcp   #DIAMETER +diameter	3868/sctp  #DIAMETER +mapper-nodemgr	3984/tcp   #MAPPER network node manager +mapper-nodemgr	3984/udp   #MAPPER network node manager +mapper-mapethd	3985/tcp   #MAPPER TCP/IP server +mapper-mapethd	3985/udp   #MAPPER TCP/IP server +mapper-ws_ethd	3986/tcp   #MAPPER workstation server +mapper-ws_ethd	3986/udp   #MAPPER workstation server +dnx		3998/tcp   #Distributed Nagios Executor Service +dnx		3998/udp   #Distributed Nagios Executor Service +#PROBLEM: Assigned to Network Paging Protocol ==================== +lockd		4045/udp   # NFS lock daemon/manager +lockd		4045/tcp +#PROBLEM ========================================================= +nuts_dem	4132/tcp   #NUTS Daemon +nuts_dem	4132/udp   #NUTS Daemon +nuts_bootp	4133/tcp   #NUTS Bootp Server +nuts_bootp	4133/udp   #NUTS Bootp Server +sieve		4190/tcp   #ManageSieve Protocol +sieve		4190/udp   #ManageSieve Protocol +nss		4159/tcp   #Network Security Service +nss		4159/udp   #Network Security Service +rwhois		4321/tcp   #Remote Who Is +rwhois		4321/udp   #Remote Who Is +epmd		4369/tcp   #Erlang Port Mapper Daemon +epmd		4369/udp   #Erlang Port Mapper Daemon +krb524		4444/tcp   #KRB524 +krb524		4444/udp   #KRB524 +# PROBLEM nv used it without an assignment +nv-video	4444/tcp   #NV Video default +nv-video	4444/udp   #NV Video default +# PROBLEM ======================================================== +ipsec-nat-t	4500/tcp   #IPsec NAT-Traversal +ipsec-nat-t	4500/udp   #IPsec NAT-Traversal +hylafax		4559/tcp   #HylaFAX +hylafax		4559/udp   #HylaFAX +ipfix		4739/tcp   #IP Flow Info Export +ipfix		4739/udp   #IP Flow Info Export +ipfix		4739/sctp  #IP Flow Info Export +ipfixs		4740/tcp   #ipfix protocol over TLS +ipfixs		4740/udp   #ipfix protocol over DTLS +ipfixs		4740/sctp  #ipfix protocol over DTLS +vxlan		4789/udp   #Virtual eXtensible Local Area Network (VXLAN) +derby-repli	4851/tcp   #Apache Derby Replication +derby-repli	4851/udp   #Apache Derby Replication +rfe		5002/tcp   #radio free ethernet +rfe		5002/udp   #radio free ethernet +mmcc		5050/tcp   #multimedia conference control tool +mmcc		5050/udp   #multimedia conference control tool +sip		5060/tcp   #Session Initialization Protocol (VoIP) +sip		5060/udp   #Session Initialization Protocol (VoIP) +sip-tls		5061/tcp   #SIP over TLS +sip-tls		5061/udp   #SIP over TLS +car		5090/sctp  #Candidate AR +cxtp		5091/sctp  #Context Transfer Protocol +xmpp-client	5222/tcp   #XMPP Client Connection +xmpp-client	5222/udp   #XMPP Client Connection +xmpp-server	5269/tcp   #XMPP Server Connection +xmpp-server	5269/udp   #XMPP Server Connection +presence	5298/tcp   #XMPP Link-Local Messaging +presence	5298/udp   #XMPP Link-Local Messaging +cfengine	5308/tcp   #CFengine +cfengine	5308/udp   #CFengine +mdns		5353/tcp   #Multicast DNS +mdns		5353/udp   #Multicast DNS +mdnsresponder	5354/tcp   #Multicast DNS Responder IPC  +mdnsresponder	5354/udp   #Multicast DNS Responder IPC +postgresql	5432/tcp   #PostgreSQL Database +postgresql	5432/udp   #PostgreSQL Database +vami		5480/tcp   #VMware Appliance Management Interface, HTTPS-like +vami		5480/udp   #VMware Appliance Management Interface, HTTPS-like +# PROBLEM Personal Agent assigned the port, but also used by HP Omniback +personal-agent	5555/tcp   #Personal Agent +rplay		5555/udp +# PROBLEM ======================================================== +amqps		5671/tcp   #AMQP protocol over TLS/SSL +amqps		5671/udp   #AMQP protocol over TLS/SSL +amqp		5672/tcp   #AMQP +amqp		5672/udp   #AMQP +amqp		5672/sctp  #AMQP +v5ua		5675/tcp   #V5UA application port +v5ua		5675/udp   #V5UA application port +v5ua		5675/sctp  #V5UA application port +# PROBLEM Auriga Router Service assigned the port ================ +canna		5680/tcp   #Canna (Japanese Input) +auriga-router	5680/udp   #Auriga Router Service +# PROBLEM ======================================================== +vnc-server	5900/tcp   #VNC Server +vnc-server	5900/udp   #VNC Server +couchdb		5984/tcp   #CouchDB +couchdb		5984/udp   #CouchDB +cvsup		5999/tcp   #CVSup file transfer/John Polstra/FreeBSD +x11		6000/tcp   #6000-6063 are assigned to X Window System +x11		6000/udp   #X Window System +x11-ssh		6010/tcp   #Unofficial name, for convenience +x11-ssh		6010/udp +sge_qmaster	6444/tcp   #Grid Engine Qmaster Service +sge_qmaster	6444/udp   #Grid Engine Qmaster Service +sge_execd	6445/tcp   #Grid Engine Execution Service +sge_execd	6445/udp   #Grid Engine Execution Service +sane-port	6566/tcp   #Scanner Access Now Easy (SANE) Control Port +sane-port	6566/udp   #Scanner Access Now Easy (SANE) Control Port +kftp-data	6620/tcp   #Kerberos V5 FTP Data +kftp-data	6620/udp   #Kerberos V5 FTP Data +kftp		6621/tcp   #Kerberos V5 FTP Control +kftp		6621/udp   #Kerberos V5 FTP Control +ktelnet		6623/tcp   #Kerberos V5 Telnet +ktelnet		6623/udp   #Kerberos V5 Telnet +afesc-mc	6628/udp   #AFE Stock Channel M/C +ircu		6665/tcp   #IRCU +ircu		6665/udp   #IRCU +ircd		6667/tcp   #Internet Relay Chat (unofficial) +ircs-u		6697/tcp   #Internet Relay Chat over TLS/SSL +frc-hp		6704/sctp  #ForCES HP (High Priority) channel +frc-mp		6705/sctp  #ForCES MP (Medium Priority) channel +frc-lp		6706/sctp  #ForCES LP (Low priority) channel +afs3-fileserver	7000/tcp   #file server itself +afs3-fileserver	7000/udp   #file server itself +afs3-callback	7001/tcp   #callbacks to cache managers +afs3-callback	7001/udp   #callbacks to cache managers +afs3-prserver	7002/tcp   #users & groups database +afs3-prserver	7002/udp   #users & groups database +afs3-vlserver	7003/tcp   #volume location database +afs3-vlserver	7003/udp   #volume location database +afs3-kaserver	7004/tcp   #AFS/Kerberos authentication service +afs3-kaserver	7004/udp   #AFS/Kerberos authentication service +afs3-volser	7005/tcp   #volume management server +afs3-volser	7005/udp   #volume management server +afs3-errors	7006/tcp   #error interpretation service +afs3-errors	7006/udp   #error interpretation service +afs3-bos	7007/tcp   #basic overseer process +afs3-bos	7007/udp   #basic overseer process +afs3-update	7008/tcp   #server-to-server updater +afs3-update	7008/udp   #server-to-server updater +afs3-rmtsys	7009/tcp   #remote cache manager service +afs3-rmtsys	7009/udp   #remote cache manager service +afs3-resserver	7010/tcp   #MR-AFS residence server +afs3-resserver	7010/udp   #MR-AFS residence server +ups-onlinet	7010/tcp   #onlinet uninterruptable power supplies +ups-onlinet	7010/udp   #onlinet uninterruptable power supplies +afs3-remio	7011/tcp   #MR-AFS remote IO server +afs3-remio	7011/udp   #MR-AFS remote IO server +font-service	7100/tcp   #X Font Service +font-service	7100/udp   #X Font Service +simco		7626/tcp   #SImple Middlebox COnfiguration (SIMCO) Server +simco		7626/sctp  #SImple Middlebox COnfiguration (SIMCO) +# Problem: Intuit Entitlement Client assigned the port =========== +ftp-proxy	8021/tcp   # FTP proxy +intu-ec-client	8021/udp   #Intuit Entitlement Client +# PROBLEM ======================================================== +http-alt	8080/tcp   #HTTP Alternate (see port 80) +http-alt	8080/udp   #HTTP Alternate (see port 80) +privoxy		8118/tcp   #Privoxy HTTP proxy +privoxy		8118/udp   #Privoxy HTTP proxy +puppet		8140/tcp   #The Puppet master service +pim		8471/tcp   #PIM over Reliable Transport +pim		8471/sctp  #PIM over Reliable Transport +asterix		8600/tcp   #Surveillance Data  +asterix		8600/udp   #Surveillance Data  +natd		8668/divert # Network Address Translation +ub-dns-control	8953/tcp   #unbound dns nameserver +lcs-ap		9082/sctp  #LCS Application Protocol +aurora		9084/sctp  #IBM AURORA Performance Visualizer +aurora		9084/tcp   #IBM AURORA Performance Visualizer +aurora		9084/udp   #IBM AURORA Performance Visualizer +jetdirect       9100/tcp   #HP JetDirect card +pdl-datastream	9100/tcp   #Printer PDL Data Stream +pdl-datastream	9100/udp   #Printer PDL Data Stream  +bacula-dir	9101/tcp   #Bacula Director +bacula-dir	9101/udp   #Bacula Director +bacula-fd	9102/tcp   #Bacula File Daemon	 +bacula-fd	9102/udp   #Bacula File Daemon +bacula-sd	9103/tcp   #Bacula Storage Daemon +bacula-sd	9103/udp   #Bacula Storage Daemon +prom-sysctl	9124/tcp   #prometheus_sysctl_exporter(8) +git		9418/tcp   #git pack transfer service +git		9418/udp   #git pack transfer service +prom-ctl	9572/tcp   #CTL prometheus +odbcpathway	9628/tcp   #ODBC Pathway Service +odbcpathway	9628/udp   #ODBC Pathway Service +davsrc		9800/tcp   #WebDav Source Port +davsrc		9800/udp   #WebDav Source Port +davsrcs		9802/tcp   #WebDAV Source TLS/SSL +davsrcs		9802/udp   #WebDAV Source TLS/SSL +sd		9876/tcp   #Session Director +sd		9876/udp   #Session Director +iua		9900/sctp  #IUA +iua		9900/tcp   #IUA +iua		9900/udp   #IUA +enrp		9901/sctp  #enrp server channel +enrp		9901/udp   #enrp server channel +enrp-sctp	9901/sctp  #enrp server channel +enrp-tls	9902/sctp  #enrp/tls server channel +zabbix-agent	10050/tcp  #Zabbix Agent +zabbix-agent	10050/udp  #Zabbix Agent +zabbix-trapper	10051/tcp  #Zabbix Trapper +zabbix-trapper	10051/udp  #Zabbix Trapper +amanda		10080/tcp  #Dump server control +amanda		10080/udp  #Dump server control +amandaidx	10082/tcp  #Amanda indexing +amidxtape	10083/tcp  #Amanda tape indexing +wmereceiving	11997/sctp #WorldMailExpress +wmedistribution	11998/sctp #WorldMailExpress +wmereporting	11999/sctp #WorldMailExpress +bpcd		13782/tcp  #VERITAS NetBackup +bpcd		13782/udp  #VERITAS NetBackup +sua		14001/tcp  #SUA +sua		14001/sctp #SUA +amt-soap-http	16992/tcp  #Intel(R) AMT SOAP/HTTP +amt-soap-http	16992/udp  #Intel(R) AMT SOAP/HTTP +amt-soap-https	16993/tcp  #Intel(R) AMT SOAP/HTTPS +amt-soap-https	16993/udp  #Intel(R) AMT SOAP/HTTPS +amt-redir-tcp	16994/tcp  #Intel(R) AMT Redirection/TCP +amt-redir-tcp	16994/udp  #Intel(R) AMT Redirection/TCP +amt-redir-tls	16995/tcp  #Intel(R) AMT Redirection/TLS +amt-redir-tls	16995/udp  #Intel(R) AMT Redirection/TLS +isode-dua	17007/tcp +isode-dua	17007/udp +biimenu		18000/tcp  #Beckman Instruments, Inc. +biimenu		18000/udp  #Beckman Instruments, Inc. +nfsrdma		20049/tcp  #Network File System (NFS) over RDMA +nfsrdma		20049/udp  #Network File System (NFS) over RDMA +nfsrdma		20049/sctp #Network File System (NFS) over RDMA +wnn6		22273/tcp  wnn4		#Wnn4 (Japanese input) +wnn6_Cn		22289/tcp  wnn4_Cn	#Wnn4 (Chinese input) +wnn6_Kr		22305/tcp  wnn4_Kr	#Wnn4 (Korean input) +wnn6_Tw		22321/tcp  wnn4_Tw	#Wnn4 (Taiwanse input) +wnn6-ds		26208/tcp  #Wnn6 (Dserver) +wnn6-ds		26208/udp  #wnn6-ds +sgsap		29118/sctp #SGsAP in 3GPP +sbcap		29168/sctp #SBcAP in 3GPP +iuhsctpassoc	29169/sctp #HNBAP and RUA Common Association +s1-control	36412/sctp #S1-Control Plane (3GPP) +x2-control	36422/sctp #X2-Control Plane (3GPP) +dbbrowse	47557/tcp  #Databeam Corporation +dbbrowse	47557/udp  #Databeam Corporation diff --git a/usr.sbin/services_mkdb/services_mkdb.8 b/usr.sbin/services_mkdb/services_mkdb.8 new file mode 100644 index 000000000000..0e0fac9e5280 --- /dev/null +++ b/usr.sbin/services_mkdb/services_mkdb.8 @@ -0,0 +1,109 @@ +.\"	$NetBSD: services_mkdb.8,v 1.9 2009/05/13 22:36:39 wiz Exp $ +.\" +.\" Copyright (c) 1999 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Luke Mewburn. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"    notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"    notice, this list of conditions and the following disclaimer in the +.\"    documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd April 4, 2010 +.Dt SERVICES_MKDB 8 +.Os +.Sh NAME +.Nm services_mkdb +.Nd generate the services database +.Sh SYNOPSIS +.Nm +.Op Fl b | l +.Op Fl q +.Op Fl o Ar database +.Op Ar file +.Nm +.Fl u +.Op Ar file +.Sh DESCRIPTION +The +.Nm +utility +creates a +.Xr db 3 +database for the specified +.Ar file . +If no file is specified, then +.Pa /etc/services +is used. +The database is installed into +.Pa /var/db/services.db . +The file must be in the correct format (see +.Xr services 5 ) . +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl b +Use big-endian byte order for database metadata. +.It Fl l +Use little-endian byte order for database metadata. +.It Fl o Ar database +Put the output databases in the named file. +.It Fl q +Do not warn about duplicate services. +.It Fl u +Print the services file to stdout, omitting duplicate entries and comments. +.El +.Pp +The databases are used by the C library services routines (see +.Xr getservent 3 ) . +.Pp +The +.Fl b +and +.Fl l +flags are mutually exclusive. +The default byte ordering is the current host order. +.Sh FILES +.Bl -tag -width ".Pa /var/db/services.db.tmp" -compact +.It Pa /var/db/services.db +The current services database. +.It Pa /var/db/services.db.tmp +A temporary file. +.It Pa /etc/services +The current services file. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr db 3 , +.Xr getservent 3 , +.Xr services 5 +.Sh BUGS +Because +.Nm +guarantees not to install a partial destination file it must +build a temporary file in the same file system and if successful use +.Xr rename 2 +to install over the destination file. +.Pp +If +.Nm +fails it will leave the previous version of the destination file intact. diff --git a/usr.sbin/services_mkdb/services_mkdb.c b/usr.sbin/services_mkdb/services_mkdb.c new file mode 100644 index 000000000000..5c6de31ba5e1 --- /dev/null +++ b/usr.sbin/services_mkdb/services_mkdb.c @@ -0,0 +1,461 @@ +/*	$NetBSD: services_mkdb.c,v 1.14 2008/04/28 20:24:17 martin Exp $	*/ + +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Luke Mewburn and Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *    notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *    notice, this list of conditions and the following disclaimer in the + *    documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/param.h> +#include <sys/stat.h> + +#include <assert.h> +#include <db.h> +#include <err.h> +#include <fcntl.h> +#include <netdb.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <libgen.h> +#include <ctype.h> +#include <errno.h> +#include <stringlist.h> + +#include "extern.h" + +static char tname[MAXPATHLEN]; + +#define	PMASK		0xffff +#define	PROTOMAX	6 + +static void	add(DB *, StringList *, size_t, const char *, size_t *, int); +static StringList ***parseservices(const char *, StringList *); +static void	cleanup(void); +static void	store(DB *, DBT *, DBT *, int); +static void	killproto(DBT *); +static char    *getstring(const char *, size_t, char **, const char *); +static size_t	getprotoindex(StringList *, const char *); +static const char *getprotostr(StringList *, size_t); +static const char *mkaliases(StringList *, char *, size_t); +static void	usage(void); + +HASHINFO hinfo = { +	.bsize = 256, +	.ffactor = 4, +	.nelem = 32768, +	.cachesize = 1024, +	.hash = NULL, +	.lorder = 0 +}; + + +int +main(int argc, char *argv[]) +{ +	DB	*db; +	int	 ch; +	const char *fname = _PATH_SERVICES; +	const char *dbname = _PATH_SERVICES_DB; +	int	 warndup = 1; +	int	 unique = 0; +	int	 otherflag = 0; +	int	 byteorder = 0; +	size_t	 cnt = 0; +	StringList *sl, ***svc; +	size_t port, proto; +	char *dbname_dir, *dbname_dirbuf; +	int dbname_dir_fd = -1; + +	setprogname(argv[0]); + +	while ((ch = getopt(argc, argv, "blo:qu")) != -1) +		switch (ch) { +		case 'b': +		case 'l': +			if (byteorder != 0) +				usage(); +			byteorder = ch == 'b' ? 4321 : 1234; +			break; +		case 'q': +			otherflag = 1; +			warndup = 0; +			break; +		case 'o': +			otherflag = 1; +			dbname = optarg; +			break; +		case 'u': +			unique++; +			break; +		case '?': +		default: +			usage(); +		} + +	argc -= optind; +	argv += optind; + +	if (argc > 1 || (unique && otherflag)) +		usage(); +	if (argc == 1) +		fname = argv[0]; + +	/* Set byte order. */ +	hinfo.lorder = byteorder; + +	if (unique) +		uniq(fname); + +	svc = parseservices(fname, sl = sl_init()); + +	if (atexit(cleanup)) +		err(1, "Cannot install exit handler"); + +	(void)snprintf(tname, sizeof(tname), "%s.tmp", dbname); +	db = dbopen(tname, O_RDWR | O_CREAT | O_EXCL, +	    (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), DB_HASH, &hinfo); +	if (!db) +		err(1, "Error opening temporary database `%s'", tname); + + +	for (port = 0; port < PMASK + 1; port++) { +		if (svc[port] == NULL) +			continue; + +		for (proto = 0; proto < PROTOMAX; proto++) { +			StringList *s; +			if ((s = svc[port][proto]) == NULL) +				continue; +			add(db, s, port, getprotostr(sl, proto), &cnt, warndup); +		} + +		free(svc[port]); +	} + +	free(svc); +	sl_free(sl, 1); + +	if ((db->close)(db)) +		err(1, "Error closing temporary database `%s'", tname); + +	/* +	 * Make sure file is safe on disk. To improve performance we will call +	 * fsync() to the directory where file lies +	 */ +	if (rename(tname, dbname) == -1 || +	    (dbname_dirbuf = strdup(dbname)) == NULL || +	    (dbname_dir = dirname(dbname_dirbuf)) == NULL || +	    (dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 || +	    fsync(dbname_dir_fd) != 0) { +		if (dbname_dir_fd != -1) +			close(dbname_dir_fd); +		err(1, "Cannot rename `%s' to `%s'", tname, dbname); +	} + +	if (dbname_dir_fd != -1) +		close(dbname_dir_fd); + +	return 0; +} + +static void +add(DB *db, StringList *sl, size_t port, const char *proto, size_t *cnt, +    int warndup) +{ +	size_t i; +	char	 keyb[BUFSIZ], datab[BUFSIZ], abuf[BUFSIZ]; +	DBT	 data, key; +	key.data = keyb; +	data.data = datab; + +#ifdef DEBUG +	(void)printf("add %s %zu %s [ ", sl->sl_str[0], port, proto); +	for (i = 1; i < sl->sl_cur; i++) +	    (void)printf("%s ", sl->sl_str[i]); +	(void)printf("]\n"); +#endif + +	/* key `indirect key', data `full line' */ +	data.size = snprintf(datab, sizeof(datab), "%zu", (*cnt)++) + 1; +	key.size = snprintf(keyb, sizeof(keyb), "%s %zu/%s %s", +	    sl->sl_str[0], port, proto, mkaliases(sl, abuf, sizeof(abuf))) + 1; +	store(db, &data, &key, warndup); + +	/* key `\377port/proto', data = `indirect key' */ +	key.size = snprintf(keyb, sizeof(keyb), "\377%zu/%s", +	    port, proto) + 1; +	store(db, &key, &data, warndup); + +	/* key `\377port', data = `indirect key' */ +	killproto(&key); +	store(db, &key, &data, warndup); + +	/* add references for service and all aliases */ +	for (i = 0; i < sl->sl_cur; i++) { +		/* key `\376service/proto', data = `indirect key' */ +		key.size = snprintf(keyb, sizeof(keyb), "\376%s/%s", +		    sl->sl_str[i], proto) + 1; +		store(db, &key, &data, warndup); + +		/* key `\376service', data = `indirect key' */ +		killproto(&key); +		store(db, &key, &data, warndup); +	} +	sl_free(sl, 1); +} + +static StringList *** +parseservices(const char *fname, StringList *sl) +{ +	ssize_t len; +	size_t linecap, line, pindex; +	FILE *fp; +	StringList ***svc, *s; +	char *p, *ep; + +	if ((fp = fopen(fname, "r")) == NULL) +		err(1, "Cannot open `%s'", fname); + +	line = linecap = 0; +	if ((svc = calloc(PMASK + 1, sizeof(StringList **))) == NULL) +		err(1, "Cannot allocate %zu bytes", (size_t)(PMASK + 1)); + +	p = NULL; +	while ((len = getline(&p, &linecap, fp)) != -1) { +		char	*name, *port, *proto, *aliases, *cp, *alias; +		unsigned long pnum; + +		line++; + +		if (len == 0) +			continue; + +		if (p[len - 1] == '\n') +			p[len - 1] = '\0'; + +		for (cp = p; *cp && isspace((unsigned char)*cp); cp++) +			continue; + +		if (*cp == '\0' || *cp == '#') +			continue; + +		if ((name = getstring(fname, line, &cp, "name")) == NULL) +			continue; + +		if ((port = getstring(fname, line, &cp, "port")) == NULL) +			continue; + +		if (cp) { +			for (aliases = cp; *cp && *cp != '#'; cp++) +				continue; + +			if (*cp) +				*cp = '\0'; +		} else +			aliases = NULL; + +		proto = strchr(port, '/'); +		if (proto == NULL || proto[1] == '\0') { +			warnx("%s, %zu: no protocol found", fname, line); +			continue; +		} +		*proto++ = '\0'; + +		errno = 0; +		pnum = strtoul(port, &ep, 0); +		if (*port == '\0' || *ep != '\0') { +			warnx("%s, %zu: invalid port `%s'", fname, line, port); +			continue; +		} +		if ((errno == ERANGE && pnum == ULONG_MAX) || pnum > PMASK) { +			warnx("%s, %zu: port too big `%s'", fname, line, port); +			continue; +		} + +		if (svc[pnum] == NULL) { +			svc[pnum] = calloc(PROTOMAX, sizeof(StringList *)); +			if (svc[pnum] == NULL) +				err(1, "Cannot allocate %zu bytes", +				    (size_t)PROTOMAX); +		} + +		pindex = getprotoindex(sl, proto); +		if (svc[pnum][pindex] == NULL) +			s = svc[pnum][pindex] = sl_init(); +		else +			s = svc[pnum][pindex]; + +		/* build list of aliases */ +		if (sl_find(s, name) == NULL) { +			char *p2; + +			if ((p2 = strdup(name)) == NULL) +				err(1, "Cannot copy string"); +			(void)sl_add(s, p2); +		} + +		if (aliases) { +			while ((alias = strsep(&aliases, " \t")) != NULL) { +				if (alias[0] == '\0') +					continue; +				if (sl_find(s, alias) == NULL) { +					char *p2; + +					if ((p2 = strdup(alias)) == NULL) +						err(1, "Cannot copy string"); +					(void)sl_add(s, p2); +				} +			} +		} +	} +	(void)fclose(fp); +	return svc; +} + +/* + * cleanup(): Remove temporary files upon exit + */ +static void +cleanup(void) +{ +	if (tname[0]) +		(void)unlink(tname); +} + +static char * +getstring(const char *fname, size_t line, char **cp, const char *tag) +{ +	char *str; + +	while ((str = strsep(cp, " \t")) != NULL && *str == '\0') +		continue; + +	if (str == NULL) +		warnx("%s, %zu: no %s found", fname, line, tag); + +	return str; +} + +static void +killproto(DBT *key) +{ +	char *p, *d = key->data; + +	if ((p = strchr(d, '/')) == NULL) +		abort(); +	*p++ = '\0'; +	key->size = p - d; +} + +static void +store(DB *db, DBT *key, DBT *data, int warndup) +{ +#ifdef DEBUG +	int k = key->size - 1; +	int d = data->size - 1; +	(void)printf("store [%*.*s] [%*.*s]\n", +		k, k, (char *)key->data + 1, +		d, d, (char *)data->data + 1); +#endif +	switch ((db->put)(db, key, data, R_NOOVERWRITE)) { +	case 0: +		break; +	case 1: +		if (warndup) +			warnx("duplicate service `%s'", +			    &((char *)key->data)[1]); +		break; +	case -1: +		err(1, "put"); +		break; +	default: +		abort(); +		break; +	} +} + +static size_t +getprotoindex(StringList *sl, const char *str) +{ +	size_t i; +	char *p; + +	for (i= 0; i < sl->sl_cur; i++) +		if (strcmp(sl->sl_str[i], str) == 0) +			return i; + +	if (i == PROTOMAX) +		errx(1, "Ran out of protocols adding `%s';" +		    " recompile with larger PROTOMAX", str); +	if ((p = strdup(str)) == NULL) +		err(1, "Cannot copy string"); +	(void)sl_add(sl, p); +	return i; +} + +static const char * +getprotostr(StringList *sl, size_t i) +{ +	assert(i < sl->sl_cur); +	return sl->sl_str[i]; +} + +static const char * +mkaliases(StringList *sl, char *buf, size_t len) +{ +	size_t nc, i, pos; + +	buf[0] = 0; +	for (i = 1, pos = 0; i < sl->sl_cur; i++) { +		nc = strlcpy(buf + pos, sl->sl_str[i], len); +		if (nc >= len) +			goto out; +		pos += nc; +		len -= nc; +		nc = strlcpy(buf + pos, " ", len); +		if (nc >= len) +			goto out; +		pos += nc; +		len -= nc; +	} +	return buf; +out: +	warn("aliases for `%s' truncated", sl->sl_str[0]); +	return buf; +} + +static void +usage(void) +{ +	(void)fprintf(stderr, +	    "Usage:\t%s [-b | -l] [-q] [-o <db>] [<servicefile>]\n" +	    "\t%s -u [<servicefile>]\n", getprogname(), getprogname()); +	exit(1); +} diff --git a/usr.sbin/services_mkdb/uniq.c b/usr.sbin/services_mkdb/uniq.c new file mode 100644 index 000000000000..e18d0e462c90 --- /dev/null +++ b/usr.sbin/services_mkdb/uniq.c @@ -0,0 +1,165 @@ +/*	$NetBSD: uniq.c,v 1.4 2008/04/28 20:24:17 martin Exp $	*/ + +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *    notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *    notice, this list of conditions and the following disclaimer in the + *    documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include <sys/cdefs.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <db.h> +#include <err.h> +#include <libutil.h> +#include <ctype.h> +#include <fcntl.h> + +#include "extern.h" + +static int comp(const char *, char **, size_t *); + +/* + * Preserve only unique content lines in a file. Input lines that have + * content [alphanumeric characters before a comment] are white-space + * normalized and have their comments removed. Then they are placed + * in a hash table, and only the first instance of them is printed. + * Comment lines without any alphanumeric content are always printed + * since they are there to make the file "pretty". Comment lines with + * alphanumeric content are also placed into the hash table and only + * printed once. + */ +void +uniq(const char *fname) +{ +	DB *db; +	DBT key; +	static const DBT data = { NULL, 0 }; +	FILE *fp; +	char *line; +	size_t len; + +	if ((db = dbopen(NULL, O_RDWR, 0, DB_HASH, &hinfo)) == NULL) +		err(1, "Cannot create in memory database"); + +	if ((fp = fopen(fname, "r")) == NULL) +		err(1, "Cannot open `%s'", fname); +	while ((line = fgetln(fp, &len)) != NULL) { +		size_t complen = len; +		char *compline; +		if (!comp(line, &compline, &complen)) { +			(void)fprintf(stdout, "%*.*s", (int)len, (int)len, +			    line); +			continue; +		} +		key.data = compline; +		key.size = complen; +		switch ((db->put)(db, &key, &data, R_NOOVERWRITE)) { +		case 0: +			(void)fprintf(stdout, "%*.*s", (int)len, (int)len, +			    line); +			break; +		case 1: +			break; +		case -1: +			err(1, "put"); +			/* NOTREACHED */ +		default: +			abort(); +			break; +		} +	} +	(void)fflush(stdout); +	exit(0); +} + +/* + * normalize whitespace in the original line and place a new string + * with whitespace converted to a single space in compline. If the line + * contains just comments, we preserve them. If it contains data and + * comments, we kill the comments. Return 1 if the line had actual + * contents, or 0 if it was just a comment without alphanumeric characters. + */ +static int +comp(const char *origline, char **compline, size_t *len) +{ +	const unsigned char *p; +	unsigned char *q; +	char *cline; +	size_t l = *len, complen; +	int hasalnum, iscomment; + +	/* Eat leading space */ +	for (p = (const unsigned char *)origline; l && *p && isspace(*p); +	    p++, l--) +		continue; +	if (*p == '\0' || l == 0) +		return 0; + +	if ((cline = malloc(l + 1)) == NULL) +		err(1, "Cannot allocate %zu bytes", l + 1); +	(void)memcpy(cline, p, l); +	cline[l] = '\0'; + +	complen = 0; +	hasalnum = 0; +	iscomment = 0; + +	for (q = (unsigned char *)cline; l && *p; p++, l--) { +		if (isspace(*p)) { +			if (complen && isspace(q[-1])) +				continue; +			*q++ = ' '; +			complen++; +		} else { +			if (!iscomment && *p == '#') { +				if (hasalnum) +					break; +				iscomment = 1; +			} else +				hasalnum |= isalnum(*p); +			*q++ = *p; +			complen++; +		} +	} + +	/* Eat trailing space */ +	while (complen && isspace(q[-1])) { +		--q; +		--complen; +	} +	*q = '\0'; +	if (!hasalnum) { +		free(cline); +		cline = NULL; +		complen = 0; +	} +	*compline = cline; +	*len = complen; +	return hasalnum; +} | 
