[unix-pc.sources] tstmodem, Part 1 of 4

vern@zebra.UUCP (Vernon C. Hoxie) (09/09/89)

This is a repost of a program I sent out a couple of weeks ago.  Several
reports which I have received indicate that it never appeared at their
sites.  Hopefully this edition will be more successful.

'Tstmodem' is a tool to aid in the care and feeding of Trailblazers but
may be used in part for other modems as well.  Included are suggestions
on setting HDB parameters as well as the control registers of the TB.
These suggestions should be helpful for any modem.

My apologies to those who are receiving this for the second time.  Let
me know who you are so that I can see for the sake of my own curiosity
how far the previous posting got.

Today's edition will have parts 1 and 2.  Tomorrow, I will post parts 3
and 4.

------------------------------ cut here ---------------------------------

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 4)."
# Contents:  MANIFEST README hackers makefile stgfilter.c tb.hints
#   tb.hints/lenny tb.hints/lenny/Devices.add
#   tb.hints/lenny/Dialers.add tb.hints/lenny/Dialers.cu.add
#   tb.hints/lenny/README tb.hints/lenny/Sysfiles
#   tb.hints/lenny/Systems.cu.add tb.hints/lenny/TB-S-REGS
#   tb.hints/lenny/crontab.add tb.hints/lenny/gettydefs.add
#   tb.hints/lenny/hfc_init tb.hints/lenny/inittab.add
#   tb.hints/lenny/modem tb.hints/lenny/modem-reset
#   tb.hints/lenny/orig.hdr tb.hints/lenny/uusched.sh tb.hints/vern.tb
#   termio.text tstmodem.h tstmodem.man
# Wrapped by vern@zebra on Mon Aug 21 22:11:09 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f MANIFEST -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"MANIFEST\"
else
echo shar: Extracting \"MANIFEST\" \(1589 characters\)
sed "s/^X//" >MANIFEST <<'END_OF_MANIFEST'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X MANIFEST                  1	This shipping list
X README                    1	Installation Instructions
X blazer.text               3	Support for MODEM mode.
X hackers                   1	Info for hackers.
X help.txt                  3	Support for 'Help' function.
X makefile                  1	Obvious.
X stgfilter.c               1	Auxilliary program to convert .text files
X tb.hints                  1	
X tb.hints/karl             2	Hints from Kart Swartz
X tb.hints/lenny            1	
X tb.hints/lenny/Devices.add 1	A series of suggestions from
X tb.hints/lenny/Dialers.add 1	Lenny Tropiano
X tb.hints/lenny/Dialers.cu.add 1	
X tb.hints/lenny/README     1	
X tb.hints/lenny/Sysfiles   1	
X tb.hints/lenny/Systems.cu.add 1	
X tb.hints/lenny/TB-S-REGS  1	
X tb.hints/lenny/crontab.add 1	
X tb.hints/lenny/gettydefs.add 1	
X tb.hints/lenny/hfc_init   1	
X tb.hints/lenny/inittab.add 1	
X tb.hints/lenny/modem      1	
X tb.hints/lenny/modem-reset 1	
X tb.hints/lenny/orig.hdr   1	
X tb.hints/lenny/uusched.sh 1	
X tb.hints/vern.hdb         2	Suggestion from me about HDB
X tb.hints/vern.tb          1	Sugestions from me about the TrailBlazer
X termio.text               1	Support for the TERMIO mode.
X tstmodem.1.c              2	Startup Procedures.
X tstmodem.2.c              3	The TERMIO mode.
X tstmodem.3.c              4	The MODEM mode.
X tstmodem.4.c              4	The COMMAND mode.
X tstmodem.h                1	Header file.
X tstmodem.man              1	Who knows.
X utils.c                   2	Common procedures.
END_OF_MANIFEST
if test 1589 -ne `wc -c <MANIFEST`; then
    echo shar: \"MANIFEST\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(3328 characters\)
sed "s/^X//" >README <<'END_OF_README'
X	To produce a functional program first run "make".  Then run
X"make stgfilter" to produce an auxiliary program which converts
Xthe '.strgs' files into something understood by 'tstmodem'.  The
Xfunctional program will be 'tstmodem'.  There are no command line
Xoptions as any variables are entered as responses to the prompts during
Xstartup.
X
X	It is intended to be an administrative tool for testing modems
Xand as such should be run in it's own directory rather than moved into
Xany of the standard 'bin' directories.  Also, it must have the support
Xfiles "help.txt", "blazer.strgs" and "termio.strgs" in the same
Xdirectory as "tstmodem".
X
X	In it's distributed incarnation, 'tstmodeem' must be run
Xas 'su'.  This is because of the procedure during startup which removes 
Xa 'getty' or 'uugetty' which might be running on the port to which the
Xmodem is connected.  If you don't run a 'getty', you can comment out
X"#define DUMPGETTY" in tstmodem.h and then run as any user.
X
X	When running 'tstmodem', incoming calls may interrupt the
Xoperation.  I recommend that either the telephone line be disconnected
Xor S0 set to zero if extensive operations are to be performed.
X
X	'Tstmodem' gives you the ability to interactively reprogram the
Xcontrol registers of a TrailBlazer modem.  This ability will work with
Xother modems which respond to the 'ATN?' command with a formatted
Xdisplay.  Modems which have only minor variations from the display
Xproduced by the TrailBlazer can be accommodated by editing the
X'blazer.strgs' file ( see 'stgfilter.c' for instructions ).  If the
Xdisplay is significantly different, 'tstmodem.3.c' will have to be
Xrewritten.  Contact me it you need some assistance.
X
X	Other features of this tool are:
X	    1.  The ability to interactively modify the
X		'termio( 7 )' control structure.
X	    2.  To test the communication link from your
X		computer to the modem.
X	    3.  To test the communication link from your
X		modem to another computer.  ( A strange
X		circumstance is that any instructions
X		to the other computer may have to be preceded
X		be an 'a'.  That is, to get the other
X		computer to do 'ls' you must send 'als'. )
X
X	The program was written with 'curses' to make use of the various
XFunction and Control keys on the UnixPC keyboard.  Two keys which have
Xbeen used extensively are the 'Exit' and 'Help' keys.  I hope that the
Xmessages included for the 'Help' will lead you through the program in
Xsuch a way that you fully utilize its various features.  If you want to
Xchange any of these 'Help' messages, refer to the comments in 'utils.c'.
X
X	The 'Exit' key will generally get you out of where you are to
Xwhere you came from.  If you get thoroughly confused, try the '<sh> Del'.
X
X	If your keyboard does not have the following keys, some revision
Xto the code will have to be made.
X
X	KEY_EXIT 	KEY_HELP 	KEY_OPTIOS 	KEY_CANCEL
X	KEY_NPAGE 	KEY_PPAGE 	KEY_UP		KEY_DOWN
X	KEY_RIGHT 	KEY_LEFT 	KEY_MARK 	KEY_HOME
X	KEY_SHOME 	KEY_SAVE
X	The Function keys KEY_F(1) through KEY_F(8).
X
X	I have included several postings to USENET which had suggestions
Xo how to set up and use a TrailBlazer.  These have been collected into
Xthe file 'tb.hints'.
X
XGood Luck!!
X
XVernon C. Hoxie		       {ncar,nbires,boulder,isis}!scicom!zebra!vern
X3975 W. 29th Ave.					voice: 303-477-1780
XDenver, Colo., 80212				  TB+	 uucp: 303-455-2670
END_OF_README
if test 3328 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f hackers -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"hackers\"
else
echo shar: Extracting \"hackers\" \(999 characters\)
sed "s/^X//" >hackers <<'END_OF_hackers'
X	This program started out to be a quick way to examine the
Xoperation of my new modem.  Since then, the program has grown and my
Xmodem is no longer new.
X
X	Since this was my first effort in 'C', there are many things
Xdone in a primitive fashion which might have been easier to accomplish
Xwith more references to the libraries.  Then again, this method might
Xrun quicker.
X
X	The general layout is:
X
X		tstmodem.1.c	startup procedures
X		tstmodem.2.c	termio mode
X		tstmodem.3.c	modem mode
X		tstmodem.4.c	command mode.
X		utils.c		procedures used by
X				more than one of the others
X
XThe glitches I know about are:
X
X	1. Failure to display the log when returning from modem mode to
Xcommand mode.  Two or three touches to the <shift> Home key are
Xnecessary to get the display to light up.
X
X	2. Possibility of getting the thing confused when changing
Xmodes.  The <shift> Del key is supposed to get you re-started in the
XCommand mode but it doesn't always do that.  The only other solution is
X<Ctrl> <shift> '\'.
END_OF_hackers
if test 999 -ne `wc -c <hackers`; then
    echo shar: \"hackers\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f makefile -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"makefile\"
else
echo shar: Extracting \"makefile\" \(526 characters\)
sed "s/^X//" >makefile <<'END_OF_makefile'
X#CFLAGS=-g
XCFLAGS=-O
XLDFLAGS=-o -s
X
XOBJS=utils.o tstmodem.1.o tstmodem.2.o tstmodem.3.o tstmodem.4.o
X
XTARGET=tstmodem
X
XLIBS=-lcurses -lc /lib/crt0.o
XSHAREDLIB=/lib/crt0s.o /lib/shlib.ifile
X
X$(TARGET): $(OBJS)
X	$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
X	chmod 4755 $(TARGET)
X
X$(OBJS): tstmodem.h makefile
X
XOBJSF=stgfilter.o
X
Xstgfilter: $(OBJSF)
X	$(LD) $(LDFLAGS) $(SHAREDLIB) -o $@ $(OBJSF)
X	if [ -f termio.text ]; \
X	then stgfilter termio.text; \
X	fi
X	if [ -f blazer.text ]; \
X	then stgfilter blazer.text; \
X	fi
X
Xclean:
X	rm *.o;
END_OF_makefile
if test 526 -ne `wc -c <makefile`; then
    echo shar: \"makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f stgfilter.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"stgfilter.c\"
else
echo shar: Extracting \"stgfilter.c\" \(3806 characters\)
sed "s/^X//" >stgfilter.c <<'END_OF_stgfilter.c'
X/* Version 0.9		July 11.1989	vch */
X
X/* The .strgs file work on the principle that each message group is    *
X * terminated with a NULL character.  Since these are difficult to     *
X * enter from most editors, this program converts two consecutive '\n' *
X * characters to a NULL when the object file ends in ".text".	       *
X * Vice-versa, when the object file ends with ".strgs", any NULL       *
X * character is converted to two '\n's so that existing .strgs files   *
X * can be edited.						       *
X *								       *
X * In other words, in order to edit a .strgs file, issue "stgfilter    *
X * blazer. strgs" from the shell.  Then edit the "blazer.text" file    *
X * which results.  Issue the shell command "stgfilter blazer.text" to  *
X * convert it back into a form usable by the prompts routines in       *
X * "tstmodem".  -- vern						       *
X*/ 
X
X/* When editing .text files, remember to leave space on the right for */
X/* the MORE signs */
X
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <fcntl.h>
X#include <malloc.h>
X
Xlong osize, nsize;
Xchar *obuf, *nbuf;
Xint nfd;
X
Xint setptrs(fd)
Xint fd;
X
X{
X	int k;
X	struct stat sbuf, *psbuf;
X	off_t t;		/* type off_t defined <sys/types.h> */
X	psbuf = &sbuf;
X	if ((t = fstat(fd, &sbuf)) < 0)
X	{
X		fprintf(stderr, "Unable to get file stats.\n");
X		fprintf(stderr,
X			"t = %d, fd = %x, sbuf = %x\n", t, fd, sbuf);
X		return(-1);
X	}
X	osize = psbuf->st_size;
X	obuf = malloc(osize);
X	if ((k = read(fd, obuf, osize)) != osize)
X	{
X		fprintf(stderr, "Error in reading data file\n");
X		fprintf(stderr,
X			"Requested size = %d, Returned size = %d\n",
X			 osize, k);
X		return(-1);
X	}
X	nsize = osize + 1000;
X	nbuf = malloc(nsize);
X	return(0);
X}
X
Xint stg2txt(base)
Xchar *base;
X
X{
X	char *optr, *nptr;
X	char *end;
X	char name[50];
X	strcat(strcpy(name,base), "text");	
X	nfd = open(name, O_WRONLY | O_CREAT, 0644);
X	for (nptr = nbuf; nptr < nbuf + nsize; *nptr++ = '\0');
X	optr = obuf;
X	nptr = nbuf;
X	end = obuf + osize;
X	while (optr < end)
X	{
X		while ((*nptr++ = *optr++) != '\0' && optr < end);
X		if (optr < end - 3)
X		{
X			*(--nptr) = '\n';
X			*(++nptr) = '\n';
X			nptr++;
X		}
X	}
X	while (*nptr == '\0' || *nptr == '\n') nptr--;
X	*(++nptr) = '\n';
X	return(++nptr - nbuf);
X}
X
Xint txt2stg(base)
Xchar *base;
X
X{
X	char *optr, *nptr, *test;
X	char name[50];
X	char *end;
X	int j;
X	strcat(strcpy(name,base), "strgs");	
X	nfd = open(name, O_WRONLY | O_CREAT, 0644);
X	for (nptr = nbuf; nptr < nbuf + nsize; *nptr++ = '\0');
X	optr = obuf;
X	nptr = nbuf;
X	end = obuf + osize;
X	while (optr < end)
X	{
X		while ((*nptr++ = *optr++) != '\n' && optr < end);
X		test = optr;
X 		if (*test == '\n')
X		{
X			*(--nptr) = '\0';
X			nptr++;
X			while (*(++optr) == '\n');
X		}
X	}
X	while (*nptr == '\0' || *nptr == '\n') nptr--;
X	for (j = 3; j; j--, *(++nptr) = '\0');
X	*(++nptr) = '\n';	
X	return(++nptr - nbuf);
X}
X
Xmain(argc, argv)
Xint argc;
Xchar *argv[];
X
X{
X	char *pt, *ps, *pv;
X	int fd, ok, j, k;
X	char base[50];
X	char fname[50];
X	char text[8];
X	char strg[9];
X	strcpy(text, "text");
X	strcpy(strg, "strgs");
X	pt = fname;
X	ps = argv[argc-1];
X	while (*pt++ = *ps++);
X	ok = 1;
X	if ((fd = open(fname, O_RDONLY)) == -1)
X	{
X		strcat(strcpy(base, "Error in opening "), fname);
X		perror(base);
X		exit(-1);
X	}
X	if ((j = setptrs(fd)) == -1) exit(-1);
X	for (pt = base; pt < (base + sizeof(base)); *pt++ = 0);
X	pt = base;
X	pv = fname;
X	while ((*pt++ = *pv++) != '.');
X	pt = text;
X	ps = strg;
X	for (; *pv != '\0'; pv++)
X	{
X		if (*ps == *pv) ps++;
X			else ps = strg;
X		if (*pt == *pv) pt++;
X			else pt = text;
X	}
X	if (*ps == '\0') k = stg2txt(base);
X	else if (*pt == '\0') k = txt2stg(base);
X	else
X	{
X		fprintf(stderr, "\nWe got a problem!\n");
X		fprintf(stderr, "The named file must be '.strgs' or '.text'\n");
X		ok = 0;
X	}
X	close(fd);
X	if (ok) unlink(fname);
X	write(nfd, nbuf, k);
X	exit(0);
X}
END_OF_stgfilter.c
if test 3806 -ne `wc -c <stgfilter.c`; then
    echo shar: \"stgfilter.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test ! -d tb.hints ; then
    echo shar: Creating directory \"tb.hints\"
    mkdir tb.hints
fi
if test ! -d tb.hints/lenny ; then
    echo shar: Creating directory \"tb.hints/lenny\"
    mkdir tb.hints/lenny
fi
if test -f tb.hints/lenny/Devices.add -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/Devices.add\"
else
echo shar: Extracting \"tb.hints/lenny/Devices.add\" \(617 characters\)
sed "s/^X//" >tb.hints/lenny/Devices.add <<'END_OF_tb.hints/lenny/Devices.add'
X#
X#  1200 baud Telebit Trailblazer modem
X#
XACU   tty001 - 1200 tb1200 \D
XACU12 tty001 - 1200 tb1200 \D
X#
X#  2400 baud Telebit Trailblazer modem
X#
XACU24 tty001 - 2400 tb2400 \D
X#
X#  19200 baud (fast) Telebit Trailblazer modem
X#
XACUTB tty001 - 19200 tbfast \D
XACU96 tty001 - 9600 tbfast \D
X#
X#  For sites with MNP modems
X#
XACUM24 tty001 - 2400 tb24mnp \D
XACUM12 tty001 - 1200 tb12mnp \D
X#
X# Direct entries for connecting to outbound modem
X#
XDirect tty001 - Any direct
Xmodem tty001 - 19200 tbfastd
Xmodem tty001 - 2400 tb2400d
Xmodem tty001 - 1200 tb1200d
Xmodem_mnp tty001 - 2400 tb24mnpd
Xmodem_mnp tty001 - 1200 tb12mnpd
END_OF_tb.hints/lenny/Devices.add
if test 617 -ne `wc -c <tb.hints/lenny/Devices.add`; then
    echo shar: \"tb.hints/lenny/Devices.add\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/Dialers.add -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/Dialers.add\"
else
echo shar: Extracting \"tb.hints/lenny/Dialers.add\" \(577 characters\)
sed "s/^X//" >tb.hints/lenny/Dialers.add <<'END_OF_tb.hints/lenny/Dialers.add'
X#
X#  Telebit 1200 baud
X#
Xtb1200	=W	"" A\pA\pA\pA\pT OK ATM0S95=0S50=2S111=30DT\T CONNECT 
X#
X#  Telebit 2400 baud
X#
Xtb2400	=W	"" A\pA\pA\pA\pT OK ATM0S95=0S50=3S111=30DT\T,,,,, CONNECT
X#
X#  Telebit 1200 baud forcing MNP reliable response only
X#
Xtb12mnp	=W	"" A\pA\pA\pA\pT OK ATM0S95=2S50=2S111=30DT\T CONNECT
X#
X#  Telebit 2400 baud forcing MNP reliable connections only
X#
Xtb24mnp	=W	"" A\pA\pA\pA\pT OK ATM0S95=2S50=3S111=30DT\T,,,, CONNECT
X#
X#  Telebit PEP connect (respond only to PEP tones)
X#
Xtbfast	=W	"" A\pA\pA\pA\pA\pT OK ATM0S95=0S50=255S111=30DT\T CONNECT-\c-CONNECT 
END_OF_tb.hints/lenny/Dialers.add
if test 577 -ne `wc -c <tb.hints/lenny/Dialers.add`; then
    echo shar: \"tb.hints/lenny/Dialers.add\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/Dialers.cu.add -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/Dialers.cu.add\"
else
echo shar: Extracting \"tb.hints/lenny/Dialers.cu.add\" \(510 characters\)
sed "s/^X//" >tb.hints/lenny/Dialers.cu.add <<'END_OF_tb.hints/lenny/Dialers.cu.add'
X#
X#  Telebit 1200 baud
X#
Xtb1200d	=W	"" A\pA\pA\pA\pT OK ATE1M1S0=0S95=0S50=2 OK
X#
X#  Telebit 2400 baud
X#
Xtb2400d	=W	"" A\pA\pA\pA\pT OK ATE1M1S0=0S95=0S50=3 OK
X#
X#  Telebit 1200 baud forcing MNP reliable response only
X#
Xtb12mnpd =W	"" A\pA\pA\pA\pT OK ATE1M1S0=0S95=2S50=2 OK
X#
X#  Telebit 2400 baud forcing MNP reliable connections only
X#
Xtb24mnpd =W	"" A\pA\pA\pA\pT OK ATE1M1S0=0S95=2S50=3 OK
X#
X#  Telebit PEP connect (respond only to PEP tones)
X#
Xtbfastd	=W	"" A\pA\pA\pA\pA\pT OK ATE1M1S0=0S95=0S50=255 OK
END_OF_tb.hints/lenny/Dialers.cu.add
if test 510 -ne `wc -c <tb.hints/lenny/Dialers.cu.add`; then
    echo shar: \"tb.hints/lenny/Dialers.cu.add\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/README\"
else
echo shar: Extracting \"tb.hints/lenny/README\" \(3582 characters\)
sed "s/^X//" >tb.hints/lenny/README <<'END_OF_tb.hints/lenny/README'
X     --------------------------------------------------------------------
X     Telebit Trailblazer setup files for use with HDB UUCP on the UNIX pc
X     --------------------------------------------------------------------
X	By Lenny Tropiano   -- ICUS Software Systems,   March, 29, 1989
X
XFollowing is a list of files that will aid you in setting up your Telebit 
XTrailblazer on your UNIX pc, with HoneyDanBer UUCP (HDB).
X
XSysfiles		# This sets up the Systems, Systems.cu, Dialers, and
X			  Dialers.cu files to be read by UUCP
XDevices.add		# Add these lines to /usr/lib/uucp/Devices
XDialers.add		# Add these lines to /usr/lib/uucp/Dialers
XDialers.cu.add		# Add these lines to /usr/lib/uucp/Dialers.cu
XSystems.cu.add		# Add these lines to /usr/lib/uucp/Systems.cu
Xcrontab.add		# Add these lines to /usr/lib/crontab
Xgettydefs.add		# Add these lines to /etc/gettydefs
Xinittab.add		# Add these lines to /etc/inittab
Xhfc_init		# Put this file in /etc/daemons/
Xmodem			# Put this file in /usr/lib/uucp/
Xmodem-reset		# Put this file in /usr/lib/uucp/
Xuusched.sh		# Put this file in /usr/lib/uucp/
XTB-S-REGS		# Use these S-registers to set up your Trailblazer.
X
XWhat I have here is a basic setup, note that this is NOT the only way it can
Xbe, or should be set up.  It should be used as an outline on how you can
Xset up your Trailblazer.  Many thanks to Robert Granvin (rjg@sialis) since
Xhe was instrumental in developing these setup files initially.  I've "tweaked"
Xthem form the best usage at icus, but he initially pointed me in the right
Xdirection when I got my Trailblazer (way back when...)
X
XFor those unfamiliar with the Sysfiles convention of HDB, it allows you
Xto set up a special Systems and Dialers file for use by the different
Xservices, "uucico and cu".  Basically you can have special Dialer scripts
Xwhen using cu (eg. I turn on the speaker during cu's to the modem, I also
Xturn on echo "E1", and both are off during uucico sessions.
X
XNote my inittab, modem, modem-reset files are setup for a Trailblazer plugged
Xinto /dev/tty001, this will HAVE to be changed if you have a different
Xport for your setup.
X
XThe "modem-reset" script turns off the uugetty and turns it back on before
Xit starts the uusched (this is called from uusched.sh which is called 
Xfrom the crontab) which makes sure DTR is dropped and the modem is reset.
XPrevents the old comatose mode, when DTR doesn't get properly dropped
Xafter a call terminates in some abnormal state (seemingly a bug in dial(3C))
X
X/etc/hfc_init is called from /etc/rc when your system is booted, it will
Xturn on hardware flow control (HFC), instead of using the x-on/x-off (^S/^Q)
Xmethod of flow control.  This seems to work better but do to a bug in
Xthe kernel routines somewhere (it's being worked on now) clists buffers aren't
Xproperly being flushed, and it has been known to cause your UNIX PC slow down
Xand die when clists aren't available anymore.
X
XIn the Systems.cu file, I set up the following "systems" that can be
Xcu'd to:
X	$ cu DFAST		# will connect to the modem ready to dialout
X				# interactively to a PEP site, just start
X				# typing with the "ATDT###-####" command, as
X				# the modem has detected the autobauding
X				# baud rate.
X	$ cu D2400  		# Ready to dialout to a 2400 baud site
X	$ cu D1200  		# Ready to dialout to a 1200 baud site
X	$ cu D2400mnp 		# Ready to dialout to a 2400 baud reliable MNP
X	$ cu D1200mnp 		# Ready to dialout to a 1200 baud reliable MNP
X
XThis seemed better than just doing a:
X
X	$ cu -s19200 -l/dev/tty001
X		And then having to issue all the "AAAAAATE1M1S50=..." 
X		commands to the modem.
X
END_OF_tb.hints/lenny/README
if test 3582 -ne `wc -c <tb.hints/lenny/README`; then
    echo shar: \"tb.hints/lenny/README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/Sysfiles -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/Sysfiles\"
else
echo shar: Extracting \"tb.hints/lenny/Sysfiles\" \(1858 characters\)
sed "s/^X//" >tb.hints/lenny/Sysfiles <<'END_OF_tb.hints/lenny/Sysfiles'
X#ident	"@(#)uucp:Sysfiles	1.1"
X#
X#	Sysfiles provides a means of specifying different Systems,
X#	Devices and Dialers files for uucico and cu.  This is useful
X#	for certain networks where, for example, requests for login
X#	service might be accepted on a different address than requests
X#	for uucico service (hence different Systems files), or where
X#	there are different chat scripts to request each service 
X#	(hence different Dialers files).
X#
X#	Another use of Sysfiles is to split large Systems files into
X#	smaller, more manageable files (e.g., local and global Systems 
X#	files).
X#
X#	FORMAT:
X#
X#	service=<service name>	systems=<systems file list> \
X#				devices=<devices file list> \
X#				dialers=<dialers file list>
X#
X#	Where service name is "uucico" or "cu".  Each file list is a list
X#	of colon-separated file names.  File names are relative to 
X#	/usr/lib/uucp unless a full path name is given.  Files are searched
X#	in the order that they appear in the file list.
X#
X#	The defaults are the usual uucp files: /usr/lib/uucp/Systems,
X#	/usr/lib/uucp/Devices and /usr/lib/uucp/Dialers.
X#
X#	EXAMPLE 1:  
X#	This example uses different systems and dialers file to separate
X#	the uucico- and cu-specific info, with information that they
X#	use in common still in the "usual" Systems and Dialers files.
X#
X#	service=uucico	systems=Systems.cico:Systems \
X#			dialers=Dialers.cico:Dialers
X#	service=cu	systems=Systems.cu:Systems \
X#			dialers=Dialers.cu:Dialers
X#
X#	EXAMPLE 2:  
X#	This example uses the same systems files for uucico and cu,
X#	but has split the Systems file into local, company-wide,
X#	and global files.
X#
X#	service=uucico	systems=Systems.local:Systems.company:Systems
X#	service=cu	systems=Systems.local:Systems.company:Systems
X
Xservice=uucico	systems=Sys.priv:Systems
Xservice=cu	systems=Sys.priv:Systems:Systems.cu \
X		dialers=Dialers:Dialers.cu
X
END_OF_tb.hints/lenny/Sysfiles
if test 1858 -ne `wc -c <tb.hints/lenny/Sysfiles`; then
    echo shar: \"tb.hints/lenny/Sysfiles\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/Systems.cu.add -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/Systems.cu.add\"
else
echo shar: Extracting \"tb.hints/lenny/Systems.cu.add\" \(285 characters\)
sed "s/^X//" >tb.hints/lenny/Systems.cu.add <<'END_OF_tb.hints/lenny/Systems.cu.add'
X# Connections to outdial modem.
X
X# Reliable connection MNP with 2400 or 1200
XD2400mnp  Any modem_mnp 2400 direct
XD1200mnp  Any modem_mnp 1200 direct
X
X# Plain old connections at FAST, 2400 and 1200
XDFAST  Any modem 19200 direct
XD2400  Any modem 2400 direct
XD1200  Any modem 1200 direct
END_OF_tb.hints/lenny/Systems.cu.add
if test 285 -ne `wc -c <tb.hints/lenny/Systems.cu.add`; then
    echo shar: \"tb.hints/lenny/Systems.cu.add\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/TB-S-REGS -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/TB-S-REGS\"
else
echo shar: Extracting \"tb.hints/lenny/TB-S-REGS\" \(480 characters\)
sed "s/^X//" >tb.hints/lenny/TB-S-REGS <<'END_OF_tb.hints/lenny/TB-S-REGS'
XE0 F1 M0 Q6 T V1 X3     Version BA4.00
XS00=001 S01=000 S02=255 S03=013 S04=010 S05=008 S06=002 S07=060 S08=002 S09=006
XS10=007 S11=050 S12=050 
XS45=000 S47=004 S48=000 S49=000
XS50=000 S51=254 S52=002 S53=004 S54=003 S55=000 S56=017 S57=019 S58=002 S59=000
XS60=000 S61=090 S62=003 S63=001 S64=001 S65=000 S66=000 S67=000 S68=255 
XS90=000 S91=000 S92=001 S95=000 
XS100=000 S101=000 S102=000 S104=000 
XS110=001 S111=030 S112=001 
XS121=000 
XN0:
XN1:
XN2:
XN3:
XN4:
XN5:
XN6:
XN7:
XN8:
XN9:
XOK
END_OF_tb.hints/lenny/TB-S-REGS
if test 480 -ne `wc -c <tb.hints/lenny/TB-S-REGS`; then
    echo shar: \"tb.hints/lenny/TB-S-REGS\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/crontab.add -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/crontab.add\"
else
echo shar: Extracting \"tb.hints/lenny/crontab.add\" \(96 characters\)
sed "s/^X//" >tb.hints/lenny/crontab.add <<'END_OF_tb.hints/lenny/crontab.add'
X6,21,36,51 * * * * /bin/su uucpadm -c "/usr/lbin/setpgrp /usr/lib/uucp/uusched.sh > /dev/null" 
END_OF_tb.hints/lenny/crontab.add
if test 96 -ne `wc -c <tb.hints/lenny/crontab.add`; then
    echo shar: \"tb.hints/lenny/crontab.add\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/gettydefs.add -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/gettydefs.add\"
else
echo shar: Extracting \"tb.hints/lenny/gettydefs.add\" \(496 characters\)
sed "s/^X//" >tb.hints/lenny/gettydefs.add <<'END_OF_tb.hints/lenny/gettydefs.add'
XT19200# B19200 CLOCAL BRKINT IGNPAR ISTRIP ECHO OPOST ONLCR # HUPCL BRKINT ISTRIP ICRNL OPOST ONLCR B19200 CS8 CREAD ISIG ICANON ECHO ECHOE ECHOK TAB3 #login: #T2400
X
XT2400# B2400 CLOCAL BRKINT IGNPAR ISTRIP ECHO OPOST ONLCR # HUPCL BRKINT ISTRIP ICRNL OPOST ONLCR B2400 CS8 CREAD ISIG ICANON ECHO ECHOE ECHOK TAB3 #login: #T1200
X
XT1200# B1200 CLOCAL BRKINT IGNPAR ISTRIP ECHO OPOST ONLCR # HUPCL BRKINT ISTRIP ICRNL OPOST ONLCR B1200 CS8 CREAD ISIG ICANON ECHO ECHOE ECHOK TAB3 #login: #T19200
X
END_OF_tb.hints/lenny/gettydefs.add
if test 496 -ne `wc -c <tb.hints/lenny/gettydefs.add`; then
    echo shar: \"tb.hints/lenny/gettydefs.add\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/hfc_init -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/hfc_init\"
else
echo shar: Extracting \"tb.hints/lenny/hfc_init\" \(26 characters\)
sed "s/^X//" >tb.hints/lenny/hfc_init <<'END_OF_tb.hints/lenny/hfc_init'
X/etc/hfc_ctl +/dev/tty001
END_OF_tb.hints/lenny/hfc_init
if test 26 -ne `wc -c <tb.hints/lenny/hfc_init`; then
    echo shar: \"tb.hints/lenny/hfc_init\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/inittab.add -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/inittab.add\"
else
echo shar: Extracting \"tb.hints/lenny/inittab.add\" \(57 characters\)
sed "s/^X//" >tb.hints/lenny/inittab.add <<'END_OF_tb.hints/lenny/inittab.add'
X 001:2:respawn:/usr/lib/uucp/modem # Telebit Trailblazer
END_OF_tb.hints/lenny/inittab.add
if test 57 -ne `wc -c <tb.hints/lenny/inittab.add`; then
    echo shar: \"tb.hints/lenny/inittab.add\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/modem -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/modem\"
else
echo shar: Extracting \"tb.hints/lenny/modem\" \(81 characters\)
sed "s/^X//" >tb.hints/lenny/modem <<'END_OF_tb.hints/lenny/modem'
Xsleep 2 ; exec /usr/lib/uucp/uugetty -r -t30 tty001 T19200 # Telebit Trailblazer
END_OF_tb.hints/lenny/modem
if test 81 -ne `wc -c <tb.hints/lenny/modem`; then
    echo shar: \"tb.hints/lenny/modem\" unpacked with wrong size!
fi
chmod +x tb.hints/lenny/modem
# end of overwriting check
fi
if test -f tb.hints/lenny/modem-reset -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/modem-reset\"
else
echo shar: Extracting \"tb.hints/lenny/modem-reset\" \(54 characters\)
sed "s/^X//" >tb.hints/lenny/modem-reset <<'END_OF_tb.hints/lenny/modem-reset'
X/usr/bin/getoff.sh 001 
Xsleep 2
X/usr/bin/geton.sh 001
END_OF_tb.hints/lenny/modem-reset
if test 54 -ne `wc -c <tb.hints/lenny/modem-reset`; then
    echo shar: \"tb.hints/lenny/modem-reset\" unpacked with wrong size!
fi
chmod +x tb.hints/lenny/modem-reset
# end of overwriting check
fi
if test -f tb.hints/lenny/orig.hdr -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/orig.hdr\"
else
echo shar: Extracting \"tb.hints/lenny/orig.hdr\" \(1033 characters\)
sed "s/^X//" >tb.hints/lenny/orig.hdr <<'END_OF_tb.hints/lenny/orig.hdr'
XNewsgroups: comp.sys.att,unix-pc.uucp,comp.dcom.modems
XSubject: Telebit Trailblazer Setup Distribution for HDB for the UNIX PC
XSummary: A possible setup ...
XMessage-ID: <649@icus.islp.ny.us>
XDate: 30 Mar 89 02:11:50 GMT
XReferences: <175@orac.pgh.pa.us>
XReply-To: lenny@icus.islp.ny.us (Lenny Tropiano)
XOrganization: ICUS Software Systems, Islip, New York
XLines: 438
X
XIn article <175@orac.pgh.pa.us> pat@orac.pgh.pa.us (Pat Barron) writes:
X|>Can someone send me a list of the proper S-register settings for a
X|>TrailBlazer Plus on a Unix-PC?  I've tried a set of "intuitive" settings,
X|>but uucico gets as far as the startup handshake, and locks up after that.
X|>
X|>I need to talk to a number of different machines at all different
X|>baud rates, so settings that either handle autobaud on the modem,
X|>or locked interface speed, would be most useful.
X|>
X...
X
XThis is in reply to this article ... I've shar'd up a possible setup for
Xthe UNIX PC using HDB...
X
X-Lenny
X
X--- cut here --- --- cut here --- --- cut here --- --- cut here ---
END_OF_tb.hints/lenny/orig.hdr
if test 1033 -ne `wc -c <tb.hints/lenny/orig.hdr`; then
    echo shar: \"tb.hints/lenny/orig.hdr\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tb.hints/lenny/uusched.sh -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/lenny/uusched.sh\"
else
echo shar: Extracting \"tb.hints/lenny/uusched.sh\" \(191 characters\)
sed "s/^X//" >tb.hints/lenny/uusched.sh <<'END_OF_tb.hints/lenny/uusched.sh'
X#
X# Check the async emulator before rudely hanging up on user.
X#
Xif [ -z "`ps -e | fgrep 'async
Xuusched
Xkermit
Xterm'`" ]
Xthen
X	/usr/lib/uucp/modem-reset
X	exec /usr/lib/uucp/uusched
Xfi
Xexit 1
END_OF_tb.hints/lenny/uusched.sh
if test 191 -ne `wc -c <tb.hints/lenny/uusched.sh`; then
    echo shar: \"tb.hints/lenny/uusched.sh\" unpacked with wrong size!
fi
chmod +x tb.hints/lenny/uusched.sh
# end of overwriting check
fi
if test -f tb.hints/vern.tb -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tb.hints/vern.tb\"
else
echo shar: Extracting \"tb.hints/vern.tb\" \(7987 characters\)
sed "s/^X//" >tb.hints/vern.tb <<'END_OF_tb.hints/vern.tb'
X	There two major shortcomings of the TrailBlazer model T18SA.
XThey are:
X
X     1. Auto-bauding between the modem and the computer is a
X	one way street.  It will automatically change to lower
X	speeds, but not back up to higher speeds.
X
X     2. You can't call into another TB which is set to receive
X	PEP tones first.  After sensing the speed tones, your
X	modem will hang up without connecting.
X
X	Here are some hints and problems which I have encountered while
Xtrying to get my modem to work.  To give you a perspective on how I
Xfound some of them, I have two 3B1 computers and two phone lines.  After
Xfinding what appeared to be a problem, Telebit loaned me a second modem.
XTesting was done using 'Uutry' to call back and forth between the
Xset-ups many many times.
X
XQ(n), Quiet Enable:
X
X	The TrailBlazer gives eight options to select the reporting of
Xresult codes.  My experience has shown that Remote Quiet is necessary on
XUnix.
X
X	If remote reporting is enabled and someone calls in to your
Xmachine, the modem reports the local result as "CONNECT 1200" when the
Xconnection is first established.  This goes into the login process.
XWhen the remote also reports, "CONNECT 1200", this sequence of all
Xuppercase ASCII characters, makes "uugetty" think that it is connected
Xto a primitive terminal that operates only in uppercase.
X
X	To be compatible, "uugetty" sets the OLCUC bit in the 'c_oflag'
Xword of the termio(7) structure .  This causes everything sent out of
Xthe receiving machine to be mapped to uppercase.  Consequently,
X"Please login:" becomes "PLEASE LOGIN:".  However, the calling machine
Xis still looking for "ogin:--ogin" in lower case.  Result -- no connection.
X
X	My recommendation -- Q6.
X
XS48, Eight Bit Comparison.
X
X	The factory default is to set the eighth bit to zero thus
Xreducing the bandwidth of the connection.  This could also cause
Xproblems when transferring binaries or compressed ASCII.
X
X	I think that the protocol which is being used should do the
Xstripping or else set the ISTRIP bit in termio(7).  This is easier than
Xresetting the modem register all the time.
X
X	My recommendation -- S48=001.
X
XS50, Transmission Mode.
X
X	This is the speed of transmission between modems.  I have found
Xno problems with this feature when set to Automatic in the answer mode.
XWhen calling out, this can be set with the chat script in 'Dialers' to
Xmatch the speed of the modem you are calling.
X
X	My recommendation -- S50=000.
X
XS51, Interface speed:
X
X	The manual doesn't list 254 as an option, but it sets the
Xbeginning interface speed to 19200 rather than the default 9600 as when
XS51=255.  Because the modem will auto baud only to lesser speeds, the
X'/etc/gettydefs' for 19200 should call back to itself ( see 'vern.hdb' ).
X
X	If you have S92=1 so that your modem will answer first in slow
Xmode, the modem and computer will step down to the slower speeds but
Xcannot return to 19200 when finally the PEP mode is connected.  Not good.
X
X	My recommendation -- S51=254 and S66=001 ( locked interface ).
X
XS52, DTR Interpretation.
X
X	The reset feature of option 2 works fine.  That is if your
X'uugetty' is working.  After each call, DTR drops and restores the
Xsettings in the EEPROM to the working registers so that the modem will
Xbe configured for auto answer when 'uugetty' starts up and sets DTR on.
X
X	My recommendation -- S52=000.
X
XS53, Data Carrier Detect and Data Set Ready interpretation:
X
X	Lenny Tropiano shows that he sets this to '4'.  To me, this is
Xthe ideal setting, but I haven't been able to get it to work on the
X7300/3B1 machine.  Whenever I set this to anything other 'zero', the
Xmodem just sits there with the DTR light black.  Apparently, the UNIX-PC
Xdoesn't interpret the DSR signal from the modem.
X
X	On one of my machines, I moved the wire from CD to DSR at the
Xmodem end of the cable.  I don't really know if it helped anything but
Xit hasn't hurt ( so far ).  If you try this, be sure to mark the cable
Xas modified, it could cause problems if used elsewhere.  Also, be
Xcareful to always connect the modified end to the modem.
X
X	Reportedly, other machines correctly interpret this bit and
Xother settings to S53 can be used.
X
X	My recommendation -- S53=000.
X
XS54, Break Signal Interpretation.
X
X	I have some modems I call out to which are supposed to change
Xspeeds if they receive a "break" immediately after connect.  When
Xcalling these machines, I set S54=004 during the Dialers chat sequence.
XOtherwise, I leave S54=000, this allows the BREAK command to work
Xin 'tstmodem'.
X
X	My recommendation -- S54=000.
X
XS58, Flow control Used by DCE:
X
X	Use of hardware flow control on the 7300/3B1 requires that the
Xhardware flow control option in the User Agent be set on.  See Lenny's
Xdiscussion of this subject ( I use both ).
X
X	When testing with S58=002, I found little difference with
XS58=002 or S58=004.  In both instances, incoming data would sometimes
Xblock during login resulting in a LOGIN FAILED result from 'uucico'.
XThis is assumed to be a problem with the 7300/3B1 device driver ( or HDB
X'uucico' ).
X
X	My recommendation -- S58=002.
X
XS60, Data Format.
X
X	The general configuration in the UNIX world is to use 8 bits of
Xdata, no parity and one stop bit.  These can be changed with chat script
Xentries when calling to machines using other formats.
X
X	My recommendation -- S60=000.
X
XS64, Dial/Answer Sequence Abort
X
X	I have had enough problems getting connections established that
XI don't need to have them dumped because of some extraneous character
Xleaking out of the computer.  There may be a good reason for having this
Xabort feature but I have had no problems traceable to the fact that I
Xignore them.
X
X	My recommendation -- S64=001.
X
XS66, Lock Interface Speed.
X
X	Because of the inability of the modem to autobaud to higher
Xspeeds, I set this register to one and set S51 to 254.  That way, the
Xinterface speed for incoming calls is locked to 19200.  Hardware flow
Xcontrol ( S58 and S68 ) are used to control the data to match the line
Xspeed.
X
X	With the modem set up this way. the last field of
Xthe 'gettydefs' used for 19200 should call back to itself rather than to
Xthe next ower speed.  See my 'gettdefs' in 'vern.hdb'.
X
X	My recommendation -- S66=001.
X
XS67, CTS Interpretation.
X
X	Because we are locking the interface speed to 19200 for incoming
Xcalls, we should use CTS for flow control.  See Lenny's suggestion for
Xsetting up your 7300/3B1 for hardware flow control.  'Uugetty' doesn't
Xgroc the CTSCD bit in termio(7).
X
X	My recommendation -- S67=001.
X
XS68, Flow Control By DCE.
X
X	Unless you have some very unusual set up, you might as well keep
Xdata flow in both directions under the same type of control.  Besides,
Xif you have to change the method of flow control, you only need to
Xchange one register ( S58 ) if option 255 is used here.
X
X	My recommendation -- S68=255.
X
XS92, Answering Sequence:
X
X	If the answering modem is set with S92=0 for answering in PEP
Xmode first, no other sites except TB modems will be able to call in.
XEven then, somehow the data is munged and login's consistently fail.
X
X	My recommendation -- S92=001.
X
XS95, MNP Operating Mode.
X
X	Option 2 appears to be the ideal setup.  This allows your modem
Xto determine if MNP is wanted or not.  When calling out, you should put
XS95=1 into the chat script.
X
X	My recommendation -- S95=002.
X
XS111 Asyncronous Protocol Support.
X
X	Since this used only in PEP mode, I leave mine set to support
Xthe UUCP 'g' protocol.
X
X	My recommendation -- S92=001.
X
X--------------------------- My latest settings ---------------------------
X
XE0 F1 M1 Q6 T V1 X1     Version BA4.00
XS00=001 S01=000 S02=043 S03=013 S04=010 S05=008 S06=002 S07=040 S08=002 S09=006
XS10=007 S11=070 S12=050 
XS45=000 S47=004 S48=001 S49=000
XS50=000 S51=254 S52=002 S53=000 S54=000 S55=000 S56=017 S57=019 S58=002 S59=000
XS60=000 S61=045 S62=003 S63=001 S64=000 S65=000 S66=001 S67=000 S68=255 
XS90=000 S91=000 S92=001 S95=002 
XS100=000 S101=000 S102=000 S104=000 
XS110=000 S111=030 S112=001 
XS121=000 
XN0:
XN1:
XN2:
XN3:
XN4:
XN5:
XN6:
XN7:
XN8:
XN9:
XOK
END_OF_tb.hints/vern.tb
if test 7987 -ne `wc -c <tb.hints/vern.tb`; then
    echo shar: \"tb.hints/vern.tb\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f termio.text -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"termio.text\"
else
echo shar: Extracting \"termio.text\" \(5297 characters\)
sed "s/^X//" >termio.text <<'END_OF_termio.text'
XIGNBRK:  Ignore Break, data framing errors with data all zeros is not put
X	 on the input queue.
X
XBRKINT: Break Interrupt, generates an interrupt signal and flushes both
X        input and output queues.  Irrelevant if IGNBRK is set.
X
XIGNPAR: Ignore Parity, characters with parity or framing errors are ignored.
X
XPARMRK: Parity Mark, framing or parity errors are converted to:
X        0377, 0000, xxxx.  Otherwise errors are read as 0000.
X
XINPCK: Input Parity Check, enables parity checking of input.
X
XISTRIP:  Input Strip, strip input to seven bits, eight bits are read in
X         if unset.
X
XINLCR:  Input New Line to Carriage Return, translates NL characters to
X        CR when set.  Irrelevant if IGNCR is set.
X
XIGNCR:  Ignore Carriage Return, ignores CR characters on input.
X
XICRNL:  Input Carriage Return and New Line, adds after NL character
X        after each CR received.  Irrelevant if IGNCR is set.
X
XIUCLC:  Input Upper Case to Lower Case, translates each upper case
X        alphabetic character to corresponding lower case letter.
X
XIXON:  Input start/stop, when set, the output will be suspended until
X       a start character is received.
X
XIXANY:  Input start/stop, when set, any input character will restart the
X        output if suspended.  Otherwise, a ^Q is required to restart.
X
XIXOFF:  If set, the system will transmit start/stop characters when the
X        input queue is nearly full/empty.
X
XOPOST:  Output Post-processing as determined by remaining flags.
X        When unset, the other flags are meaningless.
X
XOLCUC:  Output Lower Case to Upper Case, translates lower case
X        alphabetic characters to corresponding upper case characters.
X
XONLCR:  Output New Line and Carriage Return, an NL character is
X        translated to a NL-CR pair.
X
XOCRNL:  Output Carriage Return to New Line, translates a CR to an NL.
X
XONOCR:  Output No Carriage Return, will not transmit a CR from column 0.
X        (Inhibits two or more CR's in a row).
X
XONLRET  Output New Line Return, assumes that NL performs a carriage return
X        and sets the column counter to zero.  Uses delays for CR.
X
XOFILL:  Output Fill, sends fill characters for timing purposes instead
X        of a timed delay.
X
XOFDEL:  Output Delay, fill characters are DEL when set otherwise NULL is
X        used for filling.
X
XNLDLY:  New Line Delay, provides about 0.10 seconds delay for new lines.
X        If ONLRET is set, the <cr> values are used.
X
XCRDLY:  Carriage Return Delay. CR0: zero delay.  CR1 delays are dependent
X        upon carriage position.  CR2: 0.10 sec.  CR3: 0.15 sec.
X
XTABDLY: Tabulator Delay.  TAB0: zero delay. TAB1: dependant upon carriage
X        position.  TAB2: about 0.10 sec.  TAB3: tabs converted to spaces.
X
XBSDLY:  Back Space Delay, about 0.05 seconds.
X
XVTDLY:  Vertical Tab Delay.
X
XFFDLY:  Form Feed Delay.
X
XCBAUD:  Baud Rate. When B0 is selected, Data Terminal Ready (DTR) will
X        inhibited.  Impossible speeds are ignored.
X
XCSIZE:  Character Size. CS5: 5 bits. CS6: 6 bits. CS7: 7 bits. CS8: 8 bits.
X If CS6 and CS7 are both unset, then 5 bits.
X
XCSTOPB:  Control Stop Bits, two stop bits if set or one stop bit if unset.
X
XCREAD:  Control Read, enable the receiver.  Otherwise no characters will
X        be received.
X
XPARENB:  Parity Enable, enable parity bit transmission.
X
XPARODD:  Parity Odd, sends odd parity is set else even.  Irrelevant if
X         PARENB is unset.
X
XHUPCL:  Hang Up on Close, disconnects the line upon termination of process.
X        Data-Terminal-Ready (DTR) is inhibited when disconnected.
X
XCLOCAL:  Control Local, assumes a local connection when set else a modem
X         (dialup) connection is assumed.
X
XCTSCD:  Clear-To-Send Control, flow control is performed by hardware
X        signals. 
X
XHDX:  Half Duplex, requires an 'ioctl' command to raise the
X      RTS signal.
X
XISIG:  Enable input signals, checks each character for INTR and QUIT. 
X       See "line disipline".
X
XICANNON:  Input Cannonical. Performs editing of input: delimits lines with 
X          NL, EOL and EOF characters.  Uses MIN and TIME when unset.
X
XXCASE:  If ICANNON is also set, upper-case letters are preceded by '\'.
X        See TERMIO(7) for additional substitution list.
X
XECHO: Characters are echoed as received.
X
XECHOE:  Echo erase as BS-SP-BS.
X
XECHOK:  Echo NL after kill character.
X
XECHONL:  Echo NL.
X
XNOFLSH:  Disable flush after interupt or quit.
X
XLine Disipline: This is always zero on the Unix-PC.
X
X 
XINTR: Interupt, default is DEL(0x7f).
X
XQUIT: Quit, default is FS (^\).
X
XERASE:  Default is BS (^H).
X
XKILL: Default is @.
X
XEOF: Default is EOT (^D).
X
XEOL: Default is NUL (^@).
X
XMIN: Minimum number of characters.
X
XTIME:  Time to wait for more characters. (0.1 sec.)
X
XTCGETA:  Get parameter associated with terminal and store in *arg.
X
XTCSETA:  Set parameters associated with terminal referenced by *arg.
X
XTCSETAW: Wait for output to drain before setting new parameters.
X
XTCSETAF:  Wait for output to drain then flush input before setting new
X          parameters.
X
XTCBRK:  Wait for the out to drain. If arg = 0, send break. (^@ for 0.25
X        seconds).
X
XTCXONC:  Start/Stop control.  Stop if arg = 0, start if arg = 1.
X
XTCFLSH:  If arg = 0, flush input, arg = 1 flush output, arg = 2 then
X         flush both.
X
XTCSRTS:  Turn off RTS if arg =0, turn on if arg = 1.  Half duplex.
END_OF_termio.text
if test 5297 -ne `wc -c <termio.text`; then
    echo shar: \"termio.text\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tstmodem.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tstmodem.h\"
else
echo shar: Extracting \"tstmodem.h\" \(2253 characters\)
sed "s/^X//" >tstmodem.h <<'END_OF_tstmodem.h'
X/* Version 1.0		Aug 21, 1989 */
X
X/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
X *									 *
X *		Copyright (c) Aug 21, 1989 by Vernon C. Hoxie		 *
X *									 *
X *	This source code may be freely distributed as long as this	 *
X *	copyright notice is included.  No monetary charges should	 *
X *	be made in excess of the cost of copying and distribution.	 *
X *									 *
X *	Any profits which might be derived from the sale of this	 *
X *	work must be shared with me.  Other monetary contributions	 *
X *	will be gratefully accepted.					 *
X *									 *
X *		Vernon C. Hoxie						 *
X *									 *
X * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
X
X/* This is a program to interactively configure the registers */
X/* on a Telebit Trailblazer modem */
X
X#include <ctype.h>
X#include <curses.h>
X#include <errno.h>
X#include <fcntl.h>
X#include <malloc.h>
X#include <setjmp.h>
X#include <signal.h>
X#include <stdio.h>
X#include <string.h>
X#include <sys/dir.h>
X#include <sys/param.h>
X#include <sys/termio.h>
X#include <sys/times.h>
X#include <sys/types.h>
X
X#define NUMLINES 23		/* The number of screen display lines */
X#define LOGSZ NUMLINES-6	/* Leave 4 lines at top, 2 at bottom */
X#define HELPSZ NUMLINES-2	/* Leave 2 lines at bottom */
X#define DELAY 1			/* seconds when sending '\d' */
X#define PAUSE 500		/* milli-seconds when sending '\p' */
X#define DEF_TTY "tty000"	/* The default tty driver */
X#define DEF_MOD "blazer"	/* The default .strgs file */
X#define VERS "1.0"		/* Version number */
X#define INITTAB "/etc/inittab"	/* Used to dump getty */
X#define DUMPGETTY		/* If you comment this out, your getty */
X				/* will remain active but you won't    */
X				/* need to be 'su' to run 'tstmodem'.  */
X
Xint tiofd;			/* fildes for I/O port */
Xint hfd;			/* fildes for help file */
Xint new_nls;			/* tracking number for displaying log */
X
Xchar modem[800];
Xint hlp_ray[20];
X
Xjmp_buf place;			/* long jump buffer for 'sig_timeout' */
Xjmp_buf place2;			/* long jump buffer for 'sig_int' */
X
Xstruct termio oldgetty;
Xstruct termio newgetty;
Xchar modprmpt[20];		/* name of .strgs file */
X
Xextern void edit_tio();
Xextern void do_registers();
Xextern void cmd_disp();
X
XFILE  *log;			/* stream pointer to logfile */
XWINDOW *w9;
END_OF_tstmodem.h
if test 2253 -ne `wc -c <tstmodem.h`; then
    echo shar: \"tstmodem.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tstmodem.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tstmodem.man\"
else
echo shar: Extracting \"tstmodem.man\" \(8608 characters\)
sed "s/^X//" >tstmodem.man <<'END_OF_tstmodem.man'
X	This is an interactive program to aid in the set-up of "smart
Xmodems".  It was designed around the "TELEBIT Trailblazer Plus".  How it
Xinteracts with other modems is unknown.
X
X	One of the features of the "Trailblazer" is that all the
Xsettings are under software control.  This is accomplished by sending
Xthe pair "AT", followed by a command, to the modem.  One such command is
X"ATF?".  This causes the modem to respond with a read-out of the current
Xsettings of all its registers.  The read-out is formatted in lines of 80
Xcharacters or less.  If the modem you are testing does not respond in
Xlike manner, the "MODEM" mode of this test program will not function.
X
X	This program is fully interactive. This means that there are no
Xcommand line options.  When first invoked, the program goes through a
Xseries of routines to set the interface between the modem and the
Xcomputer.  One of the these routines queries the user for the name of
Xthe device driver to which the modem is connected.  The default is
X"tty000" and may be entered with a <cr>.  That is, if your modem is
Xconnected to this device, you need only enter <cr> (carriage return) and
Xthe path name "/dev/tty000" will be generated.  In any case, the "/dev/"
Xneed not be entered as it is generated internally.
X
X	Other set-up routines involve opening the device file and saving
Xthe old termio(7) data structure and replacing it with one which was known
Xto work here.  If there is a "uugetty" open on the device, it is removed
Xprovided that a you are running as 'su'.
X
X	Upon completion of the set-up routines, you are transferred to
Xthe COMMAND mode.
X
XCOMMAND Mode:
X
X	This mode permits single commands to be issued to the modem.  If
Xthe modem requires that each command be preceded with the "AT" or "at"
Xcharacters, you must enter them yourself.  Each line to be sent to the
Xmodem must be entered with a <cr>.
X
X	It is sometimes necessary to issue several 'at's before you will
Xget and 'OK' from the modem.  This particularly true if you have the
Xinteractive speed ( S51 ) set to 254.  You will probably find that the
XMODEM mode will work better if you issue enough 'at's to get an 'OK' in
Xthe COMMAND mode before trying the MODEM mode.
X
X	The center portion of the display is a readout of 'tst.log'.
XEach action entered or received is logged.  Suitable indicators are also
Xlogged so that during a later review the reader may follow the sequence
Xof events.  These indicators are Send:, Receive: etc.
X
X	The options as displayed at the bottom of the screen are: "RAW",
X"CHAT", "SYNC", "STATS, "CONTROL", "RETURN", "TERMIO" and "MODEM".
X
XRAW:
X
X	This works just the same as the "normal" mode for input but
Xdisplays the data received from the modem in 'raw' fashion.  That is,
Xall the control characters are translated to '^X' counterparts for
Xdisplay purposes.  This is a 'toggle' option, meaning that each time the
Xfirst function key is pressed, you toggle from "normal" to "raw" then
Xfrom "raw" to "normal".
X
XCHAT:
X
X	This differs from the normal input in that each command is not
Xerased after it is transmitted.  Also, send/expect sequences are
Xsupported in a manner similar to 'uucp' chat scripts.  Send/expect
Xgroups are delimited by a space.  If the group contains a space,
Xthe '\s' escape format must be used.
X
XSYNC:
X
X	This causes the computer to cycle through the different baud
Xrates until it receives an 'OK' response from the modem.  If the modem is
Xoperating with S51=254 or 255, this operation fails.
X
XSTATS:
X
X	This is a quick method of reading the statistical data by the
Xmodem concerning its operating environment.
X
XCONTROL:
X
X	This is a sub-mode which permits you to send various special
Xcharacters to the modem.  The first five, "XON", "XOFF", "ACK", "NAK"
Xand "Other" enter the characters on the "Enter data: " line.  "Other"
Xrequires you to first enter a '^' then the alpha equivalent of the
Xcontrol character you wish to enter.  "Break", and "Escape" sends these
Xspecial functions to the modem using an appropriate command.
X
X	Each entry in this sub-mode is a one time only option.  Upon
Xcompletion of the option, you are returned to the regular "COMMANDS"
Xscreen.
X
XTERMIO:
X
X	This mode displays the contents of the termio(7) data structure
Xin mnuemonic form.  The mnuemonics in upper case letters are "set" while
Xthose displayed in lower case are "unset".  You can move the highlighted
Xarea around the screen with the vector or "arrow" keyes on your
Xkeyboard.  As each parameter is highlighted, a terse interpretation of
Xthe usage of that parameter is displayed at the bottom of the screen.
X
X	To change the setting of any parameter, you need only press the
X<Mark> key.  Most parameters are toggled "ON" or "off" as indicated by
Xthe change in case of the display.  Certain parameters, such as "baud
Xrate", are toggled sequentially through the available options.  Other
Xparameters require a character to be entered.  Most manifestations of
Xthe character may be used.  That is, you may enter the character in
Xhexadecimal, octal, mnuemonic, ^X or decimal.  The values for "min" and
X"time" must be in decimal.
X
XOLD I/O:
X	This option displays the termio(7) data structure which was last
Xused by the port when you entered the "tstmodem" program.
X
XNEW I/O:
X	This is the default display when you entered "TERMIO" mode.  It
Xis also the data structure in use for this this program.
X
XNote!!
X	When leaving "TERMIO" mode, the parameters last displayed will
Xbe written to the 'newgetty' data structure and will be used for the
Xother tests.  If you leave with "OLD I/O" on the screen this will be the
Xstructure in use and will also be the "NEW I/O" when you return to
X"TERMIO".
X
XMODEM:
X	This mode displays the modems response to the "AT N?" command. 
XThe highlighted area may be moved around the screen in the same manner
Xas in the "TERMIO" mode.  As each register is displayed, an explanation
Xof that registers settings is displayed at the bottom of the screen.
X
XOPT:
X	When the length of the explanation is greater than the space
Xavailable on the screen, an "OPT" block is shown in the lower display area.
XBy pressing the "Opts" or "Page" key you may scroll the explanation
Xportion of the screen up or down by using the "Up" or "Down" vector key.
XA "MORE" block is presented on the right of the lower window if you are
Xnot at either the top or bottom of the explanation.
X
X	To leave this activity you may use any of the following keys:
X"Exit", "Opts", "Cancl", "Right Arrow" or "Left Arrow".  The flashing
Xcursor will be in the highlighted register area when you are again in
Xthe "normal" mode.
X
XREAD:
X	This function key causes the "AT N?" command to be re-issued to
Xthe modem and the working registers of the modem are again displayed. 
XThe word "Fresh" is displayed at the upper left of the main screen.
X
XSEND:
X	This option sends the changes entered since the last READ to be
Xsent to the working registers of the modem and then they are read back
Xto the dislay with the "AT N?" command.
X
XWRITE:
X	This issues the "AT&W" command to the modem.  The contents of
Xthe working registers are then written to the EEPROM.
X
XEEPROM:
X	This issues the "AT&E" command to set the working registers of
Xthe modem to the parameters stored in the EEPROM.  The display is again
Xupdated as in READ.
X
XFACTORY:
X	This issues the "AT&F" command which sets the working registers
Xto the factory configuration.  The display is updated as in a READ.
X
XRETURN:
XExit:
X	This sends you back to the COMMAND mode.
X
XTERMIO:
X	Moves to the TERMIO mode for viewing or making changes to the
Xstructure 'termio(7).
X
XTo Change Register Setting:
X	As you move the highlighted area about the screen, the flashing
Xcursor is shown on the high order numeral of the registers value.  This
Xvalue can be changed by pressing any numeric key.  As each numeric value
Xis entered, the cursor will move to the next position.  You can
Xreposition the cursor with the right or left vector key.  To leave this
Xdata entry mode, a <cr> or <Enter> will save the value in the display
Xand in a change buffer.  If after entering a numeric value you wish not
Xto have the changes made, press <Cancl> or <Exit>.
X
X	After entering a change, the change is only in the display and
Xthe change buffer.  To have the modem recognize these changes, you must
Xuse the "SEND" and "WRITE" functions explained above.  When SENDing or
XWRITEing, several caution notices are displayed and you can abort the
Xaction with the <Exit> or <Cancl> key as indicated in the notice.
X
X	Good Luck??
X
X
XVernon C. Hoxie		       {ncar,nbires,boulder,isis}!scicom!zebra!vern
X3975 W. 29th Ave.					voice: 303-477-1780
XDenver, Colo., 80212					 uucp: 303-455-2670
END_OF_tstmodem.man
if test 8608 -ne `wc -c <tstmodem.man`; then
    echo shar: \"tstmodem.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 1 \(of 4\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Vernon C. Hoxie		       {ncar,nbires,boulder,isis}!scicom!zebra!vern
3975 W. 29th Ave.					voice: 303-477-1780
Denver, Colo., 80212				  TB+	 uucp: 303-455-2670