SERVICES(5) | Linux Programmer's Manual | SERVICES(5) |
NAME
services - Internet network services listDESCRIPTION
services is a plain ASCII file providing a mapping between human-friendly textual names for internet services, and their underlying assigned port numbers and protocol types. Every networking program should look into this file to get the port number (and protocol) for its service. The C library routines getservent(3), getservbyname(3), getservbyport(3), setservent(3), and endservent(3) support querying this file from programs.- service-name port / protocol [ aliases ...]
- where:
- service-name
- is the friendly name the service is known by and looked up under. It is case sensitive. Often, the client program is named after the service-name.
- port
- is the port number (in decimal) to use for this service.
- protocol
- is the type of protocol to be used. This field should match an entry in the protocols(5) file. Typical values include tcp and udp.
- aliases
- is an optional space or tab separated list of other names for this service. Again, the names are case sensitive.
Either spaces or tabs may be used to separate the fields.
Comments are started by the hash sign (#) and continue until the end of the line. Blank lines are skipped.
The service-name should begin in the first column of the file, since leading spaces are not stripped. service-names can be any printable characters excluding space and tab. However, a conservative choice of characters should be used to minimize compatibility problems. E.g., a-z, 0-9, and hyphen (-) would seem a sensible choice.
Lines not matching this format should not be present in the file. (Currently, they are silently skipped by getservent(3), getservbyname(3), and getservbyport(3). However, this behavior should not be relied on.)
This file might be distributed over a network using a network-wide naming service like Yellow Pages/NIS or BIND/Hesiod.
A sample services file might look like this:
netstat 15/tcp
qotd 17/tcp quote
msp 18/tcp # message send protocol
msp 18/udp # message send protocol
chargen 19/tcp ttytst source
chargen 19/udp ttytst source
ftp 21/tcp
# 22 - unassigned
telnet 23/tcp
FILES
- /etc/services
- The Internet network services list
- <netdb.h>
- Definition of _PATH_SERVICES
SEE ALSO
listen(2), endservent(3), getservbyname(3), getservbyport(3), getservent(3), setservent(3), inetd.conf(5), protocols(5), inetd(8)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.2010-05-22 | Linux |