The previous panel mentioned that inetd classifies
incoming connections based on type. Each incoming connection includes
some identification fields in the TCP/IP header. The fields that interest
us the most are source address, destination address, protocol, and port
number. Incoming connections are classified by inetd based
on port number and protocol (usually TCP or UDP, see /etc/protocols for
the complete list of services that can be serviced by inetd).
Each line has the format:
service-name port-number/protocol-name aliases # comment
For example, let's investigate the top few entries:
# grep ^[^#] /etc/services | head -5
tcpmux 1/tcp # TCP port service multiplexer
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
In general, /etc/services already contains all the useful service names
and ports. If you wish to add your own, you should first consult the list
of assigned port
numbers.