Next: , Previous: , Up: inetd: Internet super-server   [Contents][Index]


19.4 TCPMUX

The TCPMUX protocol.

A TCP client connects to a foreign host on TCP port 1. It sends the service name followed by a carriage-return line-feed <CRLF>. The service name is never case sensitive. The server replies with a single character indicating positive (+) or negative (-) acknowledgment, immediately followed by an optional message of explanation, terminated with a <CRLF>. If the reply was positive, the selected protocol begins; otherwise the connection is closed.” The program is passed the TCP connection as file descriptors 0 and 1.

If the TCPMUX service name begins with a “+”, inetd returns the positive reply for the program. This allows you to invoke programs that use stdin/stdout without putting any special server code in them.

The special service name ‘help’ causes inetd to list TCPMUX services in inetd.conf.

To define TCPMUX services, the configuration file must contain a ‘tcpmux internal’ definition.

Here are several example service entries for the various types of services:

ftp           stream  tcp   nowait root  /usr/libexec/ftpd     ftpd -l
ntalk         dgram   udp   wait   nobody:tty /usr/libexec/talkd talkd
tcpmux        stream  tcp   nowait root  internal
tcpmux/+date  stream  tcp   nowait guest /bin/date             date
tcpmux/phonebook stream tcp nowait guest /usr/bin/phonebook    phonebook