termnetd

Langue: en

Version: 265360 (debian - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

termnetd - Terminal Server daemon

SYNOPSIS

termnetd [-s port] [-c configfile] [-d level] [-n] [-p] [-v]

DESCRIPTION

This man page documents the termnetd terminal daemon. This command allows telnet sessions to be established with a unit's serial ports.

The following features are available:

A Control port for viewing and modifying the status of the ports
Telnet compatible.
Full device configuration.
Round robin port selection.
Multiple port configurations for each device.
Logs status & connection information to the system logs.
Live setting of a device's baud rate and port configuration using the termnet program.
Device locking. If a device is not available for a given TCP/IP port, the connection will be closed with no error message after the connection is made. Under no circumstances will 2 simultaneous connections be made to a single device.

The devices are not opened until a connection is established to them. Therefore, it is possible to still run Getty on the device. The drawback to this is that another program can open a device and there is no way for the daemon to tell that it is presently in use.

OPTIONS

-c config-file
Set the configuration file to one other than the default of /etc/termnetd.conf
-d level
Set the debug message level. Current levels are 1 - 5
-n
Stops the daemon from forking and detaching from the controlling terminal. This is most useful for debugging purposes.
-p
Set the promiscuous mode (Currently does nothing).
-s port
Sets the IP port to listen to for the control port.
-v
Sets the system logging to verbose.

CONTROL PORT

The control port provides a simple interface for controlling the ports and viewing their status. To accomplish this, it has 7 commands. They are as follows:
enable port <TCP port expr>
Enable data transfer a port or device. This command is only valid for ports with active network connections.
disable port <TCP port expr>
Disable data transfer a port or device. This command is only valid for ports with active network connections.
disconnect port <TCP port expr>
Disconnects an existing network connection to a port or device. This command is only valid for ports with active network connections.
show port <TCP port expr>
Show the status of an individual port or all of the ports.
verbose
Toggle the displaying of a prompt and making the output a more user friendly. Because this interface was primarily built for a another program to use. The default condition is to not have a prompt shown.
help
Display a short list and summary of commands.

The TCP port expressions are expected to be regular expressions to match the ports with. For individual ports, their service name or the IP port number may be given. To deal with multiple ports in one command, a regular expression should be used. To see or effect all ports, use the expression '.*'.

Bug:

Sadly the the Control Port does not work with termnet! Use telnet to connect to it instead. The termnet program will just hang if you attempt to connect to the control port using it.

CONFIGURATION

Configuration is accomplished through the file /etc/termnetd.conf. A file with another name or path may be specified using the -c option. This file consists of one or more entries with the following format:
<IP port>:<state>:<device>:<termios options>;

FIELDS

IP port
Name or number of the TCP/IP port to accept connections from for this device.
state
Either on or off. This effectively enables or disables the port / device from accepting connections.
device
The name of the device to connect to. This must be in the form of /dev/<device>.
termios options
A list of names corresponding to the termios options to be enabled when the device is opened. These names must be capitalized and use the same spelling as those specified in the termios man page.

Each entry can use as many lines as needed to fit all of the required termios options. Be sure not to forget the semi-colon at the end of the entry.

The configuration file is read once at startup. The SIGHUP signal will force the daemon to close any connections and re-scan the configuration file.

CONFIGURATION EXAMPLES

Example 1

3000:on:/dev/cua1:B300 CLOCAL IGNBRK CRTSCTS CS8;
3001:on:/dev/cua2:B300 CLOCAL IGNBRK CRTSCTS CS8;
3002:on:/dev/cua3:B300 CLOCAL IGNBRK CRTSCTS CS8;

4000:on:/dev/cua1:B2400 CLOCAL IGNBRK CRTSCTS CS8;
4001:on:/dev/cua2:B2400 CLOCAL IGNBRK CRTSCTS CS8;
4002:on:/dev/cua3:B2400 CLOCAL IGNBRK CRTSCTS CS8;

5000:on:/dev/cua1:B9600 CLOCAL IGNBRK CRTSCTS CS8;
5001:on:/dev/cua2:B9600 CLOCAL IGNBRK CRTSCTS CS8;
5002:on:/dev/cua3:B9600 CLOCAL IGNBRK CRTSCTS CS8;

6000:on:/dev/cua1:B19200 CLOCAL IGNBRK CRTSCTS CS8;
6001:on:/dev/cua2:B19200 CLOCAL IGNBRK CRTSCTS CS8;
6002:on:/dev/cua3:B19200 CLOCAL IGNBRK CRTSCTS CS8;

This configuration allows you to connect to three different modems, /dev/cua1, /dev/cua2 and /dev/cua3, at three different baud rates. If you connect to the TCP/IP socket at port 300X, you will connect at 300 baud, while ports 400X, 500X and 500X will set the baud rate to 2400, 9600 and 19200 respectively.

The CLOCAL option allows you to communicate with a modem without carrier being present. The CRTSCTS option causes the CTS and RTS lines to be used for flow control. Note that as far as I can tell, SCO, AIX and OSF do not support this option.

Example 2

3000:on:/dev/cua3:B300 CLOCAL IGNBRK CRTSCTS CS8;
3000:on:/dev/cua2:B300 CLOCAL IGNBRK CRTSCTS CS8;
3000:on:/dev/cua1:B300 CLOCAL IGNBRK CRTSCTS CS8;

3001:on:/dev/cua3:B2400 CLOCAL IGNBRK CRTSCTS CS8;
3001:on:/dev/cua2:B2400 CLOCAL IGNBRK CRTSCTS CS8;
3001:on:/dev/cua1:B2400 CLOCAL IGNBRK CRTSCTS CS8;

3002:on:/dev/cua3:B9600 CLOCAL IGNBRK CRTSCTS CS8;
3002:on:/dev/cua2:B9600 CLOCAL IGNBRK CRTSCTS CS8;
3002:on:/dev/cua1:B9600 CLOCAL IGNBRK CRTSCTS CS8;

3003:on:/dev/cua3:B19200 CLOCAL IGNBRK CRTSCTS CS8;
3003:on:/dev/cua2:B19200 CLOCAL IGNBRK CRTSCTS CS8;
3003:on:/dev/cua1:B19200 CLOCAL IGNBRK CRTSCTS CS8;

This configuration sets the ports up to be connected in a round robin fashion. If multiple connections are made to the same socket, Ei. port 3000, the connection will be made to the first available device specified for the port number. Note that the devices are listed in reverse order. This is because the internal lists to termnetd are built backwards. Therefore, the first device to be connected to will be /dev/cua1.

FILES

/etc/termnetd.conf

SEE ALSO

termnet(1), ttyd(1), termios(2)

KNOWN PROBLEMS

Connections from telnet program that do no option negotiation may cause problems. This has been experienced using telnet from AIX where the destination port is not 'telnet'. The AIX telnet program only sends telnet negotiation to connections to the port 'telnet'.

AUTHOR

Joe Croft <joe@croftj.net>