virtmodem
---------

This program produces a virtual modem on a pseudo-tty which
allows calls to be made over a TCP/IP network as if they were over a
serial line. It has been written to allow programs which historically
make use of a serial port and modem to communicate over the internet
without any modification.

When run the program will fork and print the terminal which is being used to 
simulate the modem. If a -s argument is given to the program this is
disabled and the code does not fork. Instead information and statistics about
the calls made are kept and reported to the controlling terminal. This is
designed to aid in the debugging of connections as it allows individual
packets to be seen as they are sent and received. The idea is to give a
textual equivalent of the transmit and receive lights on a modem.

Using a program such as kermit the terminal given can now be opened and
connected to as if it were a normal serial line. The program
supports a minimum of Hayes commands; AT and ATZ both do nothing and will
simply cause OK to be echoed back. ATH hangs up the line and causes
virtmodem to quit. ATD is used to make a call.

Rather than a phone number ATD takes either a machine name or a dotted quad
numeric address. e.g. ATDvax.york.ac.uk and ATD144.32.128.1 are both valid.
Extra arguments are allowed between the ATD and the hostname as long as they
are terminated by a space. e.g. ATDT vax.york.ac.uk is also valid, this is
to maintain compatibility with existing dialler software. A successful ATD
command will result in the program attempting to contact the remote host
using a TCP/IP connection. The call is normally made to the telnet service
port number. Should another service be required then this can be specified
with a colon after the hostname. e.g. ATDvax.york.ac.uk:smtp will make
a call to port 25.

If successful the message CONNECT TCP is reported, else NO DIALTONE is
reported. Upon completion of a call the far end will drop the connection and
NO CARRIER will be reported. Whatever the result of ATD virtmodem will
always quit afterwards in order not to hog the pseudo-tty. The idea is
that virtmodem is started once per call, possibly from an automated script.
It should be noted that virtmodem passes raw bytes and thus  refuses any
of the local functions which telnet normally performs. This may cause
surprising results when contacting such things as SMTP ports where a telnet
program would normally perform local echo and CR/LF translation.

The latest version of virtmodem has many modifications from the original, the
most noticeable being the vastly improved performance. The program
now works in large blocks rather than single characters and this has had the
effect of increasing performance by several orders of magnitude. Running
kermit over the link has comparable performance to running kermit on a direct
TCP/IP connection. The supplied pty_bsd.c source file should work in most
cases, but for machines such as Silicon Graphics which do not have actual
tty/pty pairs then the file pty_sgi.c should be used. This has only
been tested on Silicon Graphics machines so far, and a Makefile for SGI
machines is supplied. This code was developed under NeXTStep, but should
be easy enough to port to most other flavours of UNIX - the supplied BSD
Makefile has been shown to work on all other flavours of BSD so far
tested including NetBSD, SUNOS and Linux.


-Pete French. 30/6/95
pete@ohm.york.ac.uk
