Manpage of tcptty

tcptty

Section: User Commands (1)
Index  

NAME

tcptty - create tcp socket and connect to pseudo terminal

 

SYNOPSIS

tcptty [option...] cmdline...

 

DESCRIPTION

tcptty is a utility for connecting a tcp connection to a pseudo terminal. tcptty listens for connections on a specified port (default 6416) and forks a copy of itself for each connection it accepts. It allocates a pseudo terminal pair (master and slave) for each connection and forks again with the child process exec'ing the cmdline. The child process first remaps the slave side of the pseudo terminal to stdin, stdout, and stderr. The parent process reads from the TCP connections and writes to the master side of the pseudo terminal and vice versa. The tcptty utility can be run in daemon mode.

The tcptty program is most often used with pppd to support PPP over TCP.

 

GENERAL OPERATION

The behavior of tcptty is controlled by command-line options. To facilitate the use of tcptty in scripts and pipelines, it returns an appropriate exit code upon termination -- see EXIT CODES below.

The following options modify the behavior of tcptty.

 

General Options

-V, --version
Displays the version information for your copy of tcptty. No connections are accepted and nothing is launched.
-s, --silent
Silent mode. Suppresses all progress/status messages that are normally echoed to standard error during operation (but does not suppress actual error messages). The --verbose option overrides this.
-v, --verbose
Verbose mode. tcptty reports all information about its communications. Overrides --silent. Doubling this option (-v -v) causes extra diagnostic information to be printed.
 

Protocol Options

-i, --interface <ifname>
The interface option lets you specify a network interface to use, such as eth0, dc0, xl0.
-h, --host <hostname>
The host option permits you to specify an a hostname or dotted quad IP address to use.
-P, --port <portnumber>
The port option permits you to specify a TCP/IP port to listen on.
-b, --bufsize <buffer size>
This option allows you to specify how much data to transmit during each transmission interval.
-I, --interval <milliseconds>
This option specifies the time to wait between transmissions. The default is 4 ms. This is useful if you need to slow down the rate that either side of the tcp connection receives data.

 

DAEMON MODE

The --daemon or -d option runs tcptty in daemon mode. In daemon mode, tcptty puts itself in background and runs forever.

The -L <filename> or --logfile <filename> option (keyword: set logfile) allows you to redirect status messages emitted while detached into a specified logfile (follow the option with the logfile name). The logfile is opened for append, so previous messages aren't deleted. This is primarily useful for debugging configurations.

The --syslog option (keyword: set syslog) allows you to redirect status and error messages emitted to the system daemon if available. Messages are logged with an id of tcptty, the facility LOG_DAEMON, and priorities LOG_ERR, LOG_ALERT or LOG_INFO. This option is intended for logging status and error messages which indicate the status of the daemon and the results while handling connections. Error messages for command line options are still written to stderr, or to the specified log file. The

The -N or --nodetach option suppresses backgrounding and detachment of the daemon process from its control terminal. This is primarily useful for debugging. Note that this also causes the logfile option to be ignored (though perhaps it shouldn't).

 

EXIT CODES

To facilitate the use of tcptty in shell scripts, an exit code is returned to give an indication of what occurred during a given connection.

The exit codes returned by tcptty are as follows:

0
tcptty was successful.
1
tcptty had problems with some of its sockets.
2
tcptty had problems with one of its pseudo terminals.
3
tcptty had problems with parsing command line options.
4
tcptty had problems while going into daemon mode.
20
tcptty had an internal error.

 

SIGNALS

tcptty will exit on SIGHUP, SIGTERM, SIGQUIT , and SIGINT.

 

BUGS AND KNOWN PROBLEMS

Still waiting for the first bug report( I am sure there will be many).

 

AUTHOR

Stuart C. Eichert <tcptty@copera.com>. This code was heavily influenced by Richard Stevens, Eric S. Raymond, and others. Please review their projects and writings.

 

SEE ALSO


 

Index

NAME
SYNOPSIS
DESCRIPTION
GENERAL OPERATION
General Options
Protocol Options
DAEMON MODE
EXIT CODES
SIGNALS
BUGS AND KNOWN PROBLEMS
AUTHOR
SEE ALSO

This document was created by using the manual pages.
Time: 00:48:40 GMT, March 28, 2003
all rights reserved
copyright © copera 1999-2008