dan@i10s7.ira.uka.de (Dan Mosedale) (05/17/91)
#! /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 2 (of 9)."
# Contents: pf-bootstrap-v1.1a/README
# pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue
# pf-bootstrap-v1.1a/tipx-p1/Makefile
# pf-bootstrap-v1.1a/tipx-p1/acu.c
# pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c
# pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c
# pf-bootstrap-v1.1a/tipx-p1/remote.c
# pf-bootstrap-v1.1a/tipx-p1/tipout.c
# pf-bootstrap-v1.1a/tipx-p1/vars.c
# pf-bootstrap-v1.1a/xmodem-3.9/misc.c
# pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h
# Wrapped by dan@nostromo on Fri May 17 02:31:41 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'pf-bootstrap-v1.1a/README' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/README'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/README'\" \(4697 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/README' <<'END_OF_FILE'
Xpf-bootstrap v1.1a
X------------------
XThis is a short package that I have put together so that one can do
Xeffective file-transfers between a Sun and an Atari Portfolio palmtop
Xcomputer using the serial interface. To create this I have combined
Xparts of the following packages:
X
X xmodem 3.9 -- from comp.sources.unix, I think
X tipx -- patches to extend 4.3BSD tip for 8 bit xfers,
X from comp.sys.misc
X tip -- from uunet.uu.net:/communications/tip.tar.Z
X slip -- Rayan Zachariassen's SunOS 4.0 SLIP package;
X I actually just took a single include from this.
X pfboot -- the MSDOS Portfolio bootstrapping package
X xterm2 -- the newest version I know of
X
XThis can probably be considered an alpha version, as I have only tried
Xit out with the following configuration: Sun SPARCstation SLC, SunOS
X4.1. It will probably run on most Suns with SunOS 4.0 and up, and
Xshouldn't be too tough to get working with other BSD based systems.
X
XThere are two phases to communication with the Portfolio:
X
X 1) Bootstrapping the PF to get a terminal program on it. If
X you have a RAM card drive, or a parallel interface you can
X just copy xterm2.com over and forget about the various
X other stuff that is otherwise done at this step.
X
X 2) Day to day file transfers using xmodem.
X
X---
XAttach the Portfolio and Sun using a null modem cable (RECV and XMIT lines
Xcrossed).
X---
X1) Bootstrapping XTERM2.COM onto the Portfolio.
X
X1a) The first thing to do is to compile tipx. This is necessary
X because the SunOS tip (for ~> file transfers) doesn't support 8
X bit file transfers, and IBM binaries, of course, can have any bit
X characters in it. Tipx supports the 8 bit characters, and as such
X is useful for the bootstrapping process.
X
X A typical c-shell set of commands for the install...
X
X % cd tipx-p1
X % vi Makefile # edit the makefile
X % make
X % cp tip ~/bin/tipx # put the tipx binary in your path
X % rehash # let the shell know about it
X
X Go read the (short) section about Transparent Pass-Through in the
X README.TIPX file.
X
X1b) Next step: get a terminal going on the Portfolio. First, in the
X Portfolio RS232 setup menu, set the baud rate to 110: we will be
X working with the builtin DOS serial driver, which is almost
X guaranteed to mess up if you push it at all. Other settings: 8 bits,
X no parity, 1 stop bit. (Hint- 110 baud is off the bottom of the menu;
X you have to use the cursor keys to scroll down to it).
X Be sure to select Initialize before leaving the program.
X
X On the sun:
X
X % cd pf-cmds
X % setenv REMOTE `PWD`/../remote # use this instead of /etc/remote
X % tipx pf-boot # set for 110 baud
X
X Then go into tipx's Transparent Pass Through mode, and send a
X couple of files:
X
X ~R
X ~~~>hexbin.com
X
X At this point, move over to the PF and type:
X
X copy aux: hexbin.com
X
X After this finishes, you might compare the lengths of the two
X hexbin.com files to be sure that they are the same. Then move on
X and send xterm2.hex:
X
X (SUN): ~~~>xterm2.hex
X (PF): copy aux: xterm2.hex
X
X After this happens, you will want to decode xterm2:
X
X (PF): binhex xterm2.hex
X ren result.out xterm2.com
X
X After testing out xterm2 to make sure that it works, you can
X delete binhex.com and xterm2.hex.
X
X1c) Time to set up an xmodem client on the sun. I tried using the
X xmodem clients that were originally included with tipx, however
X the send client crashed whenever I tried to use it, so I tossed
X them out and went with xmodem3.9 which was posted on
X comp.sources.misc a while back.
X
X % cd xmodem-3.9
X % vi Makefile # Make any appropriate changes
X % make
X % cp xmodem ~/bin ; rehash # put it where it will be found
X
X1d) Change the Portfolio's baud rate to 9600 baud and Initialize the
X RS232 port.
X
X2) You can now communicate between the PF and the Sun! To send a file
X from the Sun to the PF:
X
X (PF): xterm
X (SUN): tip pf # use /bin/tip, not tipx, and call @ 9600 baud
X (PF): <F2> file.nam
X (SUN): ~C xmodem sbp file.nam
X
XLet me know how things work out!
X
X-Dan Mosedale
Xdmose@bright.math.uoregon.edu
X
XNotes:
X
X-If you problems, you may find it useful to copy chksum.com to the pf
X as the first thing you do. Things should chksum as follows:
X
X chksum.com: 309A
X hexbin.com: 4080
X xterm2.hex: EBCB
X xterm2.com: 9A0D
X
X-The only thing I've taken from the Sun slip implementation is an include
X files, as tipx requires it to compile. In order for the compile to work,
X however, I had to modify the file a bit, so this version of tipx will
X almost certainly not work over slip.
X
XHISTORY:
X
Xv1.0 - initial release
Xv1.1 - a bit of info added to the README file.
END_OF_FILE
if test 4697 -ne `wc -c <'pf-bootstrap-v1.1a/README'`; then
echo shar: \"'pf-bootstrap-v1.1a/README'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/README'
fi
if test -f 'pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue'\" \(4083 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue' <<'END_OF_FILE'
Xbegin 644 xterm2.com
XMM$J[8 ZY! #3Z\TA<PRT";I< <TA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0V]R<"X-"E!R;V=R86T@:6X@<'5B;&EC(&1O;6%I;BX@
XM($YO="!F;W(@<V%L90T*57-E("(M:"(@;VX@=&AE(&-O;6UA;F0@;&EN92!F
XM;W(@:&5L<"X-"B0Q+GAT;0
X2
X
Xend
END_OF_FILE
if test 4083 -ne `wc -c <'pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue'`; then
echo shar: \"'pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/pf-cmds/xterm2.com.uue'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/Makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/Makefile'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/Makefile'\" \(3617 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/Makefile' <<'END_OF_FILE'
X#
X# Copyright (c) 1988 The Regents of the University of California.
X# All rights reserved.
X#
X# Redistribution and use in source and binary forms are permitted
X# provided that the above copyright notice and this paragraph are
X# duplicated in all such forms and that any documentation,
X# advertising materials, and other materials related to such
X# distribution and use acknowledge that the software was developed
X# by the University of California, Berkeley. The name of the
X# University may not be used to endorse or promote products derived
X# from this software without specific prior written permission.
X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X#
X# This makefile is for tip2, an enhanced tip based on the Berkeley
X# 4.3 tip available from uunet's ftp communications directory.
X#
X# @(#)Makefile 5.6 (Berkeley) 9/28/88
X#
X# make file for intermachine communications package
X#
X# Files are:
X# /etc/remote remote host description file
X# /etc/phones phone number file, owned by ${OWNER} and
X# mode 6??
X# ${ADM}/aculog ACU accounting file, owned by ${OWNER} and
X# mode 6?? {if ACULOG defined}
X# Presently supports:
X# BIZCOMP
X# DEC DF02-AC, DF03-AC
X# DEC DN-11/Able Quadracall
X# HAYES and Hayes emulators
X# USR COURIER (2400 baud)
X# VENTEL 212+
X# VADIC 831 RS232 adaptor
X# VADIC 3451
X# Hayes Smartmodem 2400
X# Telebit Trailblazer
X# (drivers are located in libacu.a)
X#
X# Configuration defines:
X# DF02, DF03, DN11 ACU's supported
X# BIZ1031, BIZ1022, VENTEL, V831, V3451, HAYES, COURIER
X# SM2400, TELEBIT
X# ACULOG turn on tip logging of ACU use
X# PRISTINE no phone #'s put in ACU log file
X# CONNECT worthless command
X# DEFBR default baud rate to make connection at
X# DEFFS default frame size for FTP buffering of
X# writes on local side
X# BUFSIZ buffer sizing from stdio, must be fed
X# explicitly to remcap.c if not 1024
X# STREAMS system has streams tty interface (SunOS 4.0)
X# CC=gcc -traditional
XADM= usr/adm
XCONFIG= -DSM2400 -DTELEBIT
XCFLAGS= -O -DDEFBR=9600 -DDEFFS=BUFSIZ -DCONNECT -DTIPX -DSTREAMS
XLIBC= /lib/libc.a
XSRCS= acu.c acutab.c cmds.c cmdtab.c cu.c hunt.c log.c login.c partab.c \
X remcap.c remote.c tip.c tipout.c uucplock.c value.c vars.c \
X page.c slip.c
XOBJS= acu.o acutab.o cmds.o cmdtab.o cu.o hunt.o log.o login.o partab.o \
X remcap.o remote.o tip.o tipout.o uucplock.o value.o vars.o \
X page.o slip.o
XMAN= tip.1
X
Xall: libacu/libacu.a tipx
X
Xtipx: ${OBJS} ${LIBC}
X ${CC} -o $@ ${OBJS} libacu/libacu.a
X
X# acutab is configuration dependent, and so depends on the makefile
Xacutab.o: Makefile
Xacutab.o: acutab.c
X ${CC} -c ${CFLAGS} ${CONFIG} acutab.c
X
X# remote.o depends on the makefile because of DEFBR and DEFFS
X# log.o depends on the makefile because of ACULOG
Xlog.o remote.o: Makefile
X
Xlibacu/libacu.a: FRC
X cd libacu; make ${MFLAGS}
X
Xclean:
X rm -f ${OBJS} core tip
X cd libacu; make ${MFLAGS} clean
X
Xcleandir: clean
X rm -f ${MAN} tags .depend
X cd libacu; make ${MFLAGS} cleandir
X
Xdepend:
X mkdep ${CFLAGS} ${SRCS}
X cd libacu; make ${MFLAGS} depend
X
Xinstall: ${MAN}
X cd libacu; make ${MFLAGS} install
X install -s -o root -g daemon -m 6711 tip ${DESTDIR}/usr/bin/tip
X rm -f ${DESTDIR}/usr/bin/cu
X ln ${DESTDIR}/usr/bin/tip ${DESTDIR}/usr/bin/cu
X install -c -o bin -g bin -m 444 tip.1 ${DESTDIR}/usr/man/man1
X rm -f ${DESTDIR}/usr/man/man1/cu.1
X ln ${DESTDIR}/usr/man/tip1/tip.1 ${DESTDIR}/usr/man/cat1/cu.1
X
Xlint: ${SRCS}
X lint ${CFLAGS} ${SRCS}
X
Xtags: ${SRCS}
X ctags ${SRCS}
X cd libacu; make ${MFLAGS} tags
X
XFRC:
END_OF_FILE
if test 3617 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/Makefile'`; then
echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/Makefile'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/Makefile'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/acu.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/acu.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/acu.c'\" \(4455 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/acu.c' <<'END_OF_FILE'
X/*
X * Copyright (c) 1983 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley. The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)acu.c 5.6 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X
Xstatic acu_t *acu = NOACU;
Xstatic int conflag;
Xstatic sigfunc_t acuabort();
Xstatic acu_t *acutype();
Xstatic jmp_buf jmpbuf;
X/*
X * Establish connection for tip
X *
X * If DU is true, we should dial an ACU whose type is AT.
X * The phone numbers are in PN, and the call unit is in CU.
X *
X * If the PN is an '@', then we consult the PHONES file for
X * the phone numbers. This file is /etc/phones, unless overriden
X * by an exported shell variable.
X *
X * The data base files must be in the format:
X * host-name[ \t]*phone-number
X * with the possibility of multiple phone numbers
X * for a single host acting as a rotary (in the order
X * found in the file).
X */
Xchar *
Xlconnect()
X{
X register char *cp = PN;
X char *phnum, string[256];
X FILE *fd;
X int tried = 0;
X
X if (!DU) { /* regular connect message */
X if (CM != NOSTR)
X pwrite(FD, CM, size(CM));
X logent(value(HOST), "", DV, "call completed");
X return (NOSTR);
X }
X /*
X * @ =>'s use data base in PHONES environment variable
X * otherwise, use /etc/phones
X */
X signal(SIGINT, acuabort);
X signal(SIGQUIT, acuabort);
X if (setjmp(jmpbuf)) {
X signal(SIGINT, SIG_IGN);
X signal(SIGQUIT, SIG_IGN);
X printf("\ncall aborted\n");
X logent(value(HOST), "", "", "call aborted");
X if (slip)
X abort_slip();
X if (acu != NOACU) {
X boolean(value(VERBOSE)) = FALSE;
X if (conflag)
X disconnect(NOSTR);
X else
X (*acu->acu_abort)();
X }
X return ("interrupt");
X }
X if ((acu = acutype(AT)) == NOACU)
X return ("unknown ACU type");
X if (*cp != '@') {
X while (*cp) {
X for (phnum = cp; *cp && *cp != ','; cp++)
X ;
X if (*cp)
X *cp++ = '\0';
X
X if (conflag = (*acu->acu_dialer)(phnum, CU)) {
X logent(value(HOST), phnum, acu->acu_name,
X "call completed");
X return (NOSTR);
X } else
X logent(value(HOST), phnum, acu->acu_name,
X "call failed");
X tried++;
X }
X } else {
X if ((fd = fopen(PH, "r")) == NOFILE) {
X printf("%s: ", PH);
X return ("can't open phone number file");
X }
X while (fgets(string, sizeof(string), fd) != NOSTR) {
X for (cp = string; !any(*cp, " \t\n"); cp++)
X ;
X if (*cp == '\n') {
X fclose(fd);
X return ("unrecognizable host name");
X }
X *cp++ = '\0';
X if (strcmp(string, value(HOST)))
X continue;
X while (any(*cp, " \t"))
X cp++;
X if (*cp == '\n') {
X fclose(fd);
X return ("missing phone number");
X }
X for (phnum = cp; *cp && *cp != ',' && *cp != '\n'; cp++)
X ;
X if (*cp)
X *cp++ = '\0';
X
X if (conflag = (*acu->acu_dialer)(phnum, CU)) {
X fclose(fd);
X logent(value(HOST), phnum, acu->acu_name,
X "call completed");
X return (NOSTR);
X } else
X logent(value(HOST), phnum, acu->acu_name,
X "call failed");
X tried++;
X }
X fclose(fd);
X }
X if (!tried)
X logent(value(HOST), "", acu->acu_name, "missing phone number");
X else
X (*acu->acu_abort)();
X return (tried ? "call failed" : "missing phone number");
X}
X
Xdisconnect(reason)
X char *reason;
X{
X if (!conflag) {
X logent(value(HOST), "", DV, "call terminated");
X return;
X }
X if (reason == NOSTR) {
X logent(value(HOST), "", acu->acu_name, "call terminated");
X if (boolean(value(VERBOSE)))
X printf("\r\ndisconnecting...");
X } else
X logent(value(HOST), "", acu->acu_name, reason);
X (*acu->acu_disconnect)();
X}
X
Xstatic sigfunc_t
Xacuabort(s)
X{
X signal(s, SIG_IGN);
X longjmp(jmpbuf, 1);
X}
X
Xstatic acu_t *
Xacutype(s)
X register char *s;
X{
X register acu_t *p;
X extern acu_t acutable[];
X
X for (p = acutable; p->acu_name != '\0'; p++)
X if (!strcmp(s, p->acu_name))
X return (p);
X return (NOACU);
X}
END_OF_FILE
if test 4455 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/acu.c'`; then
echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/acu.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/acu.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c'\" \(4460 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c' <<'END_OF_FILE'
X/*
X * Copyright (c) 1983 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley. The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)biz31.c 5.2 (Berkeley) 9/13/88";
X#endif /* not lint */
X
X#include "tip.h"
X
X#define MAXRETRY 3 /* sync up retry count */
X#define DISCONNECT_CMD "\21\25\11\24" /* disconnection string */
X
Xstatic int sigALRM();
Xstatic int timeout = 0;
Xstatic jmp_buf timeoutbuf;
X
X/*
X * Dial up on a BIZCOMP Model 1031 with either
X * tone dialing (mod = "f")
X * pulse dialing (mod = "w")
X */
Xstatic int
Xbiz_dialer(num, mod)
X char *num, *mod;
X{
X register int connected = 0;
X
X if (!bizsync(FD)) {
X logent(value(HOST), "", "biz", "out of sync");
X printf("bizcomp out of sync\n");
X delock(uucplock);
X exit(0);
X }
X if (boolean(value(VERBOSE)))
X printf("\nstarting call...");
X echo("#\rk$\r$\n"); /* disable auto-answer */
X echo("$>$.$ #\r"); /* tone/pulse dialing */
X echo(mod);
X echo("$\r$\n");
X echo("$>$.$ #\re$ "); /* disconnection sequence */
X echo(DISCONNECT_CMD);
X echo("\r$\n$\r$\n");
X echo("$>$.$ #\rr$ "); /* repeat dial */
X echo(num);
X echo("\r$\n");
X if (boolean(value(VERBOSE)))
X printf("ringing...");
X /*
X * The reply from the BIZCOMP should be:
X * `^G NO CONNECTION\r\n^G\r\n' failure
X * ` CONNECTION\r\n^G' success
X */
X connected = detect(" ");
X#ifdef ACULOG
X if (timeout) {
X char line[80];
X
X sprintf(line, "%d second dial timeout",
X number(value(DIALTIMEOUT)));
X logent(value(HOST), num, "biz", line);
X }
X#endif
X if (!connected)
X flush(" NO CONNECTION\r\n\07\r\n");
X else
X flush("CONNECTION\r\n\07");
X if (timeout)
X biz31_disconnect(); /* insurance */
X return (connected);
X}
X
Xbiz31w_dialer(num, acu)
X char *num, *acu;
X{
X
X return (biz_dialer(num, "w"));
X}
X
Xbiz31f_dialer(num, acu)
X char *num, *acu;
X{
X
X return (biz_dialer(num, "f"));
X}
X
Xbiz31_disconnect()
X{
X
X write(FD, DISCONNECT_CMD, 4);
X sleep(2);
X ioctl(FD, TIOCFLUSH);
X}
X
Xbiz31_abort()
X{
X
X write(FD, "\33", 1);
X}
X
Xstatic int
Xecho(s)
X register char *s;
X{
X char c;
X
X while (c = *s++) switch (c) {
X
X case '$':
X read(FD, &c, 1);
X s++;
X break;
X
X case '#':
X c = *s++;
X write(FD, &c, 1);
X break;
X
X default:
X write(FD, &c, 1);
X read(FD, &c, 1);
X }
X}
X
Xstatic int
XsigALRM()
X{
X
X timeout = 1;
X longjmp(timeoutbuf, 1);
X}
X
Xstatic int
Xdetect(s)
X register char *s;
X{
X char c;
X sigfunc_t (*f)();
X
X f = signal(SIGALRM, sigALRM);
X timeout = 0;
X while (*s) {
X if (setjmp(timeoutbuf)) {
X printf("\07timeout waiting for reply\n");
X biz31_abort();
X break;
X }
X alarm(number(value(DIALTIMEOUT)));
X read(FD, &c, 1);
X alarm(0);
X if (c != *s++)
X break;
X }
X signal(SIGALRM, f);
X return (timeout == 0);
X}
X
Xstatic int
Xflush(s)
X register char *s;
X{
X char c;
X sigfunc_t (*f)();
X
X f = signal(SIGALRM, sigALRM);
X while (*s++) {
X if (setjmp(timeoutbuf))
X break;
X alarm(10);
X read(FD, &c, 1);
X alarm(0);
X }
X signal(SIGALRM, f);
X timeout = 0; /* guard against disconnection */
X}
X
X/*
X * This convoluted piece of code attempts to get
X * the bizcomp in sync. If you don't have the capacity or nread
X * call there are gory ways to simulate this.
X */
Xstatic int
Xbizsync(fd)
X{
X#ifdef FIOCAPACITY
X struct capacity b;
X# define chars(b) ((b).cp_nbytes)
X# define IOCTL FIOCAPACITY
X#endif
X#ifdef FIONREAD
X long b;
X# define chars(b) (b)
X# define IOCTL FIONREAD
X#endif
X register int already = 0;
X char buf[10];
X
Xretry:
X if (ioctl(fd, IOCTL, (caddr_t)&b) >= 0 && chars(b) > 0)
X ioctl(fd, TIOCFLUSH);
X write(fd, "\rp>\r", 4);
X sleep(1);
X if (ioctl(fd, IOCTL, (caddr_t)&b) >= 0) {
X if (chars(b) != 10) {
X nono:
X if (already > MAXRETRY)
X return (0);
X write(fd, DISCONNECT_CMD, 4);
X sleep(2);
X already++;
X goto retry;
X } else {
X read(fd, buf, 10);
X if (strncmp(buf, "p >\r\n\r\n>", 8))
X goto nono;
X }
X }
X return (1);
X}
END_OF_FILE
if test 4460 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c'`; then
echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/libacu/biz31.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c'\" \(3947 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c' <<'END_OF_FILE'
X/*
X * Copyright (c) 1983 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley. The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)v3451.c 5.2 (Berkeley) 9/13/88";
X#endif /* not lint */
X
X/*
X * Routines for calling up on a Vadic 3451 Modem
X */
X#include "tip.h"
X
Xstatic jmp_buf Sjbuf;
X
Xv3451_dialer(num, acu)
X register char *num;
X char *acu;
X{
X int ok;
X sigfunc_t (*func)();
X int slow = number(value(BAUDRATE)) < 1200, rw = 2;
X char phone[50];
X#ifdef ACULOG
X char line[80];
X#endif
X
X /*
X * Get in synch
X */
X vawrite("I\r", 1 + slow);
X vawrite("I\r", 1 + slow);
X vawrite("I\r", 1 + slow);
X vawrite("\005\r", 2 + slow);
X if (!expect("READY")) {
X printf("can't synchronize with vadic 3451\n");
X#ifdef ACULOG
X logent(value(HOST), num, "vadic", "can't synch up");
X#endif
X return (0);
X }
X ioctl(FD, TIOCHPCL, 0);
X sleep(1);
X vawrite("D\r", 2 + slow);
X if (!expect("NUMBER?")) {
X printf("Vadic will not accept dial command\n");
X#ifdef ACULOG
X logent(value(HOST), num, "vadic", "will not accept dial");
X#endif
X return (0);
X }
X strcpy(phone, num);
X strcat(phone, "\r");
X vawrite(phone, 1 + slow);
X if (!expect(phone)) {
X printf("Vadic will not accept phone number\n");
X#ifdef ACULOG
X logent(value(HOST), num, "vadic", "will not accept number");
X#endif
X return (0);
X }
X func = signal(SIGINT,SIG_IGN);
X /*
X * You cannot interrupt the Vadic when its dialing;
X * even dropping DTR does not work (definitely a
X * brain damaged design).
X */
X vawrite("\r", 1 + slow);
X vawrite("\r", 1 + slow);
X if (!expect("DIALING:")) {
X printf("Vadic failed to dial\n");
X#ifdef ACULOG
X logent(value(HOST), num, "vadic", "failed to dial");
X#endif
X return (0);
X }
X if (boolean(value(VERBOSE)))
X printf("\ndialing...");
X ok = expect("ON LINE");
X signal(SIGINT, func);
X if (!ok) {
X printf("call failed\n");
X#ifdef ACULOG
X logent(value(HOST), num, "vadic", "call failed");
X#endif
X return (0);
X }
X ioctl(FD, TIOCFLUSH, &rw);
X return (1);
X}
X
Xv3451_disconnect()
X{
X
X close(FD);
X}
X
Xv3451_abort()
X{
X
X close(FD);
X}
X
Xstatic
Xvawrite(cp, delay)
X register char *cp;
X int delay;
X{
X
X for (; *cp; sleep(delay), cp++)
X write(FD, cp, 1);
X}
X
Xstatic
Xexpect(cp)
X register char *cp;
X{
X char buf[300];
X register char *rp = buf;
X int alarmtr(), timeout = 30, online = 0;
X
X if (strcmp(cp, "\"\"") == 0)
X return (1);
X *rp = 0;
X /*
X * If we are waiting for the Vadic to complete
X * dialing and get a connection, allow more time
X * Unfortunately, the Vadic times out 24 seconds after
X * the last digit is dialed
X */
X online = strcmp(cp, "ON LINE") == 0;
X if (online)
X timeout = number(value(DIALTIMEOUT));
X signal(SIGALRM, alarmtr);
X if (setjmp(Sjbuf))
X return (0);
X alarm(timeout);
X while (notin(cp, buf) && rp < buf + sizeof (buf) - 1) {
X if (online && notin("FAILED CALL", buf) == 0)
X return (0);
X if (read(FD, rp, 1) < 0) {
X alarm(0);
X return (0);
X }
X if (*rp &= 0177)
X rp++;
X *rp = '\0';
X }
X alarm(0);
X return (1);
X}
X
Xstatic
Xalarmtr()
X{
X
X longjmp(Sjbuf, 1);
X}
X
Xstatic
Xnotin(sh, lg)
X char *sh, *lg;
X{
X
X for (; *lg; lg++)
X if (prefix(sh, lg))
X return (0);
X return (1);
X}
X
Xstatic
Xprefix(s1, s2)
X register char *s1, *s2;
X{
X register char c;
X
X while ((c = *s1++) == *s2++)
X if (c == '\0')
X return (1);
X return (c == '\0');
X}
END_OF_FILE
if test 3947 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c'`; then
echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/libacu/v3451.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/remote.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/remote.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/remote.c'\" \(4312 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/remote.c' <<'END_OF_FILE'
X/*
X * Copyright (c) 1983 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley. The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)remote.c 5.4 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X# include "tip.h"
X
X/*
X * Attributes to be gleened from remote host description
X * data base.
X */
Xstatic char **caps[] = {
X &AT, &DV, &CM, &CU, &EL, &IE, &OE, &PN, &PR,
X &DI, &ES, &EX, &FO, &RC, &RE, &PA, &SA, &DA,
X &SM, &ST, &LS
X};
X
Xstatic char *capstrings[] = {
X "at", "dv", "cm", "cu", "el", "ie", "oe", "pn", "pr",
X "di", "es", "ex", "fo", "rc", "re", "pa", "sa", "da",
X "sm", "st", "ls", 0
X};
X
Xchar *rgetstr();
X
Xstatic
Xgetremcap(host)
X register char *host;
X{
X int stat;
X char tbuf[BUFSIZ];
X static char buf[BUFSIZ/2];
X char *bp = buf;
X register char **p, ***q;
X
X if ((stat = rgetent(tbuf, host)) <= 0) {
X if (DV ||
X host[0] == '/' && access(DV = host, R_OK | W_OK) == 0) {
X CU = DV;
X HO = host;
X HW = 1;
X DU = 0;
X if (!BR)
X BR = DEFBR;
X FS = DEFFS;
X return;
X }
X fprintf(stderr, stat == 0 ?
X "tip: unknown host %s\n" :
X "tip: can't open host description file\n", host);
X exit(3);
X }
X
X for (p = capstrings, q = caps; *p != NULL; p++, q++)
X if (**q == NULL)
X **q = rgetstr(*p, &bp);
X if (!BR && (BR = rgetnum("br")) < 0)
X BR = DEFBR;
X if ((FS = rgetnum("fs")) < 0)
X FS = DEFFS;
X if (DU < 0)
X DU = 0;
X else
X DU = rgetflag("du");
X if (DV == NOSTR) {
X fprintf(stderr, "%s: missing device spec\n", host);
X exit(3);
X }
X if (DU && CU == NOSTR)
X CU = DV;
X if (DU && PN == NOSTR) {
X fprintf(stderr, "%s: missing phone number\n", host);
X exit(3);
X }
X
X HD = rgetflag("hd");
X
X /*
X * This effectively eliminates the "hw" attribute
X * from the description file
X */
X if (!HW)
X HW = (CU == NOSTR) || (DU && equal(DV, CU));
X HO = host;
X /*
X * see if uppercase mode should be turned on initially
X */
X if (rgetflag("ra"))
X boolean(value(RAISE)) = 1;
X if (rgetflag("ec"))
X boolean(value(ECHOCHECK)) = 1;
X if (rgetflag("be"))
X boolean(value(BEAUTIFY)) = 1;
X if (rgetflag("nb"))
X boolean(value(BEAUTIFY)) = 0;
X if (rgetflag("sc"))
X boolean(value(SCRIPT)) = 1;
X if (rgetflag("tb"))
X boolean(value(TABEXPAND)) = 1;
X if (rgetflag("vb"))
X boolean(value(VERBOSE)) = 1;
X if (rgetflag("nv"))
X boolean(value(VERBOSE)) = 0;
X if (rgetflag("ta"))
X boolean(value(TAND)) = 1;
X if (rgetflag("nt"))
X boolean(value(TAND)) = 0;
X if (rgetflag("rw"))
X boolean(value(RAWFTP)) = 1;
X if (rgetflag("hd"))
X boolean(value(HALFDUPLEX)) = 1;
X if (rgetflag("rt"))
X boolean(value(SETROUTE)) = 1;
X if (rgetflag("li"))
X boolean(value(LINESYNC)) = 1;
X if (rgetflag("dt"))
X boolean(value(DTRHUP)) =1;
X if (RE == NOSTR)
X RE = (char *)"tip.record";
X if (EX == NOSTR)
X EX = (char *)"\t\n\b\f";
X if (ES != NOSTR)
X vstring("es", ES);
X if (FO != NOSTR)
X vstring("fo", FO);
X if (PR != NOSTR)
X vstring("pr", PR);
X if (RC != NOSTR)
X vstring("rc", RC);
X if ((DL = rgetnum("dl")) < 0)
X DL = 0;
X if ((CL = rgetnum("cl")) < 0)
X CL = 0;
X if ((ET = rgetnum("et")) < 0)
X ET = 10;
X}
X
Xchar *
Xgetremote(host)
X char *host;
X{
X register char *cp;
X static char *next;
X static int lookedup = 0;
X
X if (!lookedup) {
X if (host == NOSTR && (host = getenv("HOST")) == NOSTR) {
X fprintf(stderr, "tip: no host specified\n");
X exit(3);
X }
X getremcap(host);
X next = DV;
X lookedup++;
X }
X /*
X * We return a new device each time we're called (to allow
X * a rotary action to be simulated)
X */
X if (next == NOSTR)
X return (NOSTR);
X if ((cp = index(next, ',')) == NULL) {
X DV = next;
X next = NOSTR;
X } else {
X *cp++ = '\0';
X DV = next;
X next = cp;
X }
X return (DV);
X}
END_OF_FILE
if test 4312 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/remote.c'`; then
echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/remote.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/remote.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/tipout.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/tipout.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/tipout.c'\" \(3945 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/tipout.c' <<'END_OF_FILE'
X/*
X * Copyright (c) 1983 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley. The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X/*+:EDITS:*/
X/*:05-08-1990-15:29-wht@n4hgf-rawthru */
X/*:05-08-1990-15:28-wht@n4hgf-mv tipout.c tipout-orig.c */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)tipout.c 5.2 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X/*
X * tip
X *
X * lower fork of tip -- handles passive side
X * reading from the remote host
X */
X
Xstatic jmp_buf sigbuf;
X
X/*
X * TIPOUT wait state routine --
X * sent by TIPIN when it wants to posses the remote host
X */
Xsigfunc_t
XintIOT()
X{
X
X write(repdes[1],&ccc,1);
X read(fildes[0], &ccc,1);
X longjmp(sigbuf, 1);
X}
X
X/*
X * Scripting command interpreter --
X * accepts script file name over the pipe and acts accordingly
X */
Xsigfunc_t
XintEMT()
X{
X char c, line[256];
X register char *pline = line;
X char reply;
X
X read(fildes[0], &c, 1);
X while (c != '\n') {
X *pline++ = c;
X read(fildes[0], &c, 1);
X }
X *pline = '\0';
X if (boolean(value(SCRIPT)) && fscript != NULL)
X fclose(fscript);
X if (pline == line) {
X boolean(value(SCRIPT)) = FALSE;
X reply = 'y';
X } else {
X if ((fscript = fopen(line, "a")) == NULL)
X reply = 'n';
X else {
X reply = 'y';
X boolean(value(SCRIPT)) = TRUE;
X }
X }
X write(repdes[1], &reply, 1);
X longjmp(sigbuf, 1);
X}
X
Xsigfunc_t
XintTERM()
X{
X
X if (boolean(value(SCRIPT)) && fscript != NULL)
X fclose(fscript);
X finish();
X}
X
Xsigfunc_t
XintSYS()
X{
X
X boolean(value(BEAUTIFY)) = !boolean(value(BEAUTIFY));
X longjmp(sigbuf, 1);
X}
X
X#ifdef TIPX
Xextern int rawthru;
Xsigfunc_t
Xint_tipout_rawthru_on()
X{
X rawthru = 1;
X}
Xsigfunc_t
Xint_tipout_rawthru_off()
X{
X rawthru = 0;
X}
X#endif /* TIPX */
X
X/*
X * ****TIPOUT TIPOUT****
X */
Xtipout()
X{
X char buf[BUFSIZ];
X register char *cp;
X register int cnt;
X extern int errno;
X int omask;
X
X signal(SIGINT, SIG_IGN);
X signal(SIGQUIT, SIG_IGN);
X signal(SIGEMT, intEMT); /* attention from TIPIN */
X signal(SIGTERM, intTERM); /* time to go signal */
X signal(SIGIOT, intIOT); /* scripting going on signal */
X signal(SIGHUP, intTERM); /* for dial-ups */
X signal(SIGSYS, intSYS); /* beautify toggle */
X#ifdef TIPX
X signal(SIGUSR1, int_tipout_rawthru_on);
X signal(SIGUSR2, int_tipout_rawthru_off);
X#endif /* TIPX */
X (void) setjmp(sigbuf);
X for (omask = 0;; sigsetmask(omask)) {
X cnt = read(FD, buf, BUFSIZ);
X if (cnt <= 0) {
X /* lost carrier */
X if (cnt < 0 && errno == EIO) {
X sigblock(sigmask(SIGTERM));
X intTERM();
X /*NOTREACHED*/
X }
X continue;
X }
X#ifdef TIPX
X#define ALLSIGS sigmask(SIGEMT)|sigmask(SIGTERM)|sigmask(SIGIOT)|sigmask(SIGSYS)|sigmask(SIGUSR1)|sigmask(SIGUSR2)
X#else /* TIPX */
X#define ALLSIGS sigmask(SIGEMT)|sigmask(SIGTERM)|sigmask(SIGIOT)|sigmask(SIGSYS)
X#endif /* TIPX */
X omask = sigblock(ALLSIGS);
X#ifdef TIPX
X if(!rawthru)
X#endif
X for (cp = buf; cp < buf + cnt; cp++)
X *cp &= 0177;
X write(1, buf, cnt);
X if (boolean(value(SCRIPT)) && fscript != NULL) {
X if (!boolean(value(BEAUTIFY))) {
X fwrite(buf, 1, cnt, fscript);
X continue;
X }
X#ifdef TIPX
X if(rawthru)
X for (cp = buf; cp < buf + cnt; cp++)
X *cp &= 0177;
X#endif /* TIPX */
X for (cp = buf; cp < buf + cnt; cp++)
X if ((*cp >= ' ' && *cp <= '~') ||
X any(*cp, value(EXCEPTIONS)))
X putc(*cp, fscript);
X }
X }
X}
END_OF_FILE
if test 3945 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/tipout.c'`; then
echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/tipout.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/tipout.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/vars.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/vars.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/vars.c'\" \(4130 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/vars.c' <<'END_OF_FILE'
X/*
X * Copyright (c) 1983 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley. The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)vars.c 5.3 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X
X/*
X * Definition of variables
X */
Xvalue_t vtable[] = {
X { "beautify", BOOL, (READ|WRITE)<<PUBLIC,
X "be", (char *)TRUE },
X { "baudrate", NUMBER|IREMOTE|INIT, (READ<<PUBLIC)|(WRITE<<ROOT),
X "ba", (char *)&BR },
X { "dialtimeout",NUMBER, (READ<<PUBLIC)|(WRITE<<ROOT),
X "dial", (char *)60 },
X { "eofread", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X "eofr", (char *)&IE },
X { "eofwrite", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X "eofw", (char *)&OE },
X { "eol", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X NOSTR, (char *)&EL },
X { "escape", CHAR, (READ|WRITE)<<PUBLIC,
X "es", (char *)'~' },
X { "exceptions", STRING|INIT|IREMOTE, (READ|WRITE)<<PUBLIC,
X "ex", (char *)&EX },
X { "force", CHAR, (READ|WRITE)<<PUBLIC,
X "fo", (char *)CTRL('p') },
X { "framesize", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X "fr", (char *)&FS },
X { "host", STRING|IREMOTE|INIT, READ<<PUBLIC,
X "ho", (char *)&HO },
X { "log", STRING|INIT, (READ|WRITE)<<ROOT,
X NOSTR, "/usr/adm/aculog" },
X { "phones", STRING|INIT|IREMOTE, READ<<PUBLIC,
X NOSTR, (char *)&PH },
X { "prompt", CHAR, (READ|WRITE)<<PUBLIC,
X "pr", (char *)'\n' },
X { "raise", BOOL, (READ|WRITE)<<PUBLIC,
X "ra", (char *)FALSE },
X { "raisechar", CHAR, (READ|WRITE)<<PUBLIC,
X "rc", (char *)CTRL('a') },
X { "record", STRING|INIT|IREMOTE, (READ|WRITE)<<PUBLIC,
X "rec", (char *)&RE },
X { "remote", STRING|INIT|IREMOTE, READ<<PUBLIC,
X NOSTR, (char *)&RM },
X { "script", BOOL, (READ|WRITE)<<PUBLIC,
X "sc", (char *)FALSE },
X { "tabexpand", BOOL, (READ|WRITE)<<PUBLIC,
X "tab", (char *)FALSE },
X { "verbose", BOOL, (READ|WRITE)<<PUBLIC,
X "verb", (char *)FALSE },
X { "SHELL", STRING|ENVIRON|INIT, (READ|WRITE)<<PUBLIC,
X NULL, "/bin/sh" },
X { "HOME", STRING|ENVIRON, (READ|WRITE)<<PUBLIC,
X NOSTR, NOSTR },
X { "echocheck", BOOL, (READ|WRITE)<<PUBLIC,
X "ec", (char *)FALSE },
X { "disconnect", STRING|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X "di", (char *)&DI },
X { "tandem", BOOL, (READ|WRITE)<<PUBLIC,
X "ta", (char *)TRUE },
X { "linedelay", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X "ldelay", (char *)&DL },
X { "chardelay", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X "cdelay", (char *)&CL },
X { "etimeout", NUMBER|IREMOTE|INIT, (READ|WRITE)<<PUBLIC,
X "et", (char *)&ET },
X { "rawftp", BOOL, (READ|WRITE)<<PUBLIC,
X "raw", (char *)FALSE },
X { "halfduplex", BOOL, (READ|WRITE)<<PUBLIC,
X "hdx", (char *)FALSE },
X { "localecho", BOOL, (READ|WRITE)<<PUBLIC,
X "le", (char *)FALSE },
X { "parity", STRING|INIT|IREMOTE, (READ|WRITE)<<PUBLIC,
X "par", (char *)&PA },
X { "slipaddr", STRING|IREMOTE, READ<<PUBLIC,
X "sa", (char *)&SA },
X { "destaddr", STRING|IREMOTE, READ<<PUBLIC,
X "da", (char *)&DA },
X { "slipmask", STRING|IREMOTE, READ<<PUBLIC,
X "sm", (char *)&SM },
X { "sliptype", STRING|IREMOTE, READ<<PUBLIC,
X "st", (char *)&ST },
X { "loginscript",STRING|IREMOTE, (READ|WRITE)<<PUBLIC,
X "ls", (char *)&LS },
X { "setroute", BOOL, READ<<PUBLIC,
X "rt", (char *)FALSE },
X { "linesync", BOOL, (READ|WRITE)<<PUBLIC,
X "li", (char *)FALSE },
X { "dtrhup", BOOL, READ<<PUBLIC,
X "dt", (char *)FALSE },
X { NOSTR, NULL, NULL, NOSTR, NOSTR }
X};
END_OF_FILE
if test 4130 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/vars.c'`; then
echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/vars.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/vars.c'
fi
if test -f 'pf-bootstrap-v1.1a/xmodem-3.9/misc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/xmodem-3.9/misc.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/xmodem-3.9/misc.c'\" \(4396 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/xmodem-3.9/misc.c' <<'END_OF_FILE'
X#include "xmodem.h"
X
X/* Print Help Message */
Xhelp()
X {
X fprintf(stderr, "Usage: \txmodem ");
X fprintf(stderr, "-[rb!rt!ra!sb!st!sa][options] filename\n");
X fprintf(stderr, "Major Commands --");
X fprintf(stderr, "\n\trb <-- Receive Binary");
X fprintf(stderr, "\n\trt <-- Receive Text");
X fprintf(stderr, "\n\tra <-- Receive Apple macintosh text");
X fprintf(stderr, "\n\tsb <-- Send Binary");
X fprintf(stderr, "\n\tst <-- Send Text");
X fprintf(stderr, "\n\tsa <-- Send Apple macintosh text");
X fprintf(stderr, "\nOptions --");
X fprintf(stderr, "\n\ty <-- Use YMODEM Batch Mode on transmit");
X fprintf(stderr, "\n\tg <-- Select YMODEM-G Mode on receive");
X fprintf(stderr, "\n\tm <-- Use MODEM7 Batch Mode on transmit");
X fprintf(stderr, "\n\tk <-- Use 1K packets on transmit");
X fprintf(stderr, "\n\tc <-- Select CRC mode on receive");
X fprintf(stderr, "\n\tt <-- Indicate a TOO BUSY Unix system");
X fprintf(stderr, "\n\td <-- Delete xmodem.log file before starting");
X fprintf(stderr, "\n\tl <-- (ell) Turn OFF Log File Entries");
X fprintf(stderr, "\n\tx <-- Include copious debugging information in log file");
X fprintf(stderr, "\n\tp <-- Use with SunOS tip ~C command");
X fprintf(stderr, "\n\tw <-- Wait before initial handshake");
X fprintf(stderr, "\n\te <-- Supress EOT confirmation");
X fprintf(stderr, "\n\tn <-- Allow mid-transfer CAN-CAN aborts");
X fprintf(stderr, "\n");
X }
X
X/* get type of transmission requested (text or binary) */
Xgettype(ichar)
Xchar ichar;
X {
X if (ichar == 't' || ichar == 'T')
X return('t');
X else if (ichar == 'b' || ichar == 'B')
X return('b');
X else if (ichar == 'a' || ichar == 'A')
X return('a');
X else
X error("Invalid Send/Receive Parameter - not t or b", FALSE);
X return('\0');
X }
X
X/* return a string containing transmission type */
Xchar *
Xprtype(ichar)
Xchar ichar;
X {
X if (ichar == 't' || ichar == 'T')
X return("text");
X else if (ichar == 'b' || ichar == 'B')
X return("binary");
X else if (ichar == 'a' || ichar == 'A')
X return("apple");
X else
X return("");
X }
X
X/* print error message and exit; if mode == TRUE, restore normal tty modes */
Xerror(msg, mode)
Xchar *msg;
Xint mode;
X {
X if (mode)
X restoremodes(TRUE); /* put back normal tty modes */
X fprintf(stderr, "\r\n%s\n", msg);
X if ((LOGFLAG || DEBUG) && (LOGFP != NULL))
X {
X fprintf(LOGFP, "XMODEM Fatal Error: %s\n", msg);
X fclose(LOGFP);
X }
X exit(-1);
X }
X
X
X/* Construct a proper (i.e. pretty) sector count for messages */
X
Xchar
X*sectdisp(recvsectcnt, bufsize, plus1)
Xlong recvsectcnt;
Xint bufsize, plus1;
X {
X static char string[20];
X if (plus1)
X recvsectcnt += (bufsize == 128) ? 1 : 8;
X if (bufsize == 128 || recvsectcnt == 0)
X sprintf (string, "%d", recvsectcnt);
X else
X sprintf (string, "%d-%d", recvsectcnt-7, recvsectcnt);
X return(string);
X }
X
X/* type out debugging info */
Xxmdebug(str)
Xchar *str;
X {
X if (DEBUG && (LOGFP != NULL))
X fprintf(LOGFP,"DEBUG: '%s'\n",str);
X }
X
X/* print elapsed time and rate of transfer in logfile */
X
Xint quant[] = { 60, 60, 24};
Xchar sep[3][10] = { "second", "minute", "hour" };
X
Xprtime (numsect, seconds, fileid)
Xlong numsect;
Xtime_t seconds;
XFILE *fileid;
X
X{
X register int i;
X register int Seconds;
X int nums[3];
X int rate;
X
X if (numsect == 0)
X return(0);
X
X Seconds = (int)seconds;
X Seconds = (Seconds > 0) ? Seconds : 0;
X
X rate = (Seconds != 0) ? 128 * numsect/Seconds : 0;
X
X for (i=0; i<3; i++) {
X nums[i] = (Seconds % quant[i]);
X Seconds /= quant[i];
X }
X
X fprintf (fileid, "%ld Sectors Transfered in ", numsect);
X
X if (rate == 0)
X fprintf (fileid, "0 seconds");
X else
X while (--i >= 0)
X if (nums[i])
X fprintf (fileid, "%d %s%c ", nums[i], &sep[i][0],
X nums[i] == 1 ? ' ' : 's');
X fprintf (fileid, "\n");
X
X if (rate != 0)
X fprintf (fileid, "Transfer Rate = %d Characters per Second\n", rate);
X
X return(0);
X}
X
X/* Print elapsed time estimate */
X
Xprojtime (numsect, fd)
Xlong numsect;
XFILE *fd;
X {
X register int i;
X register int seconds;
X int nums[3];
X
X if (numsect == 0)
X return (0);
X
X/* constant below should really be 1280; reduced to 90% to account for time lost in overhead */
X
X seconds = 1422 * numsect / ttyspeed + 1;
X
X for (i=0; i<3; i++) {
X nums[i] = (seconds % quant[i]);
X seconds /= quant[i];
X }
X
X fprintf (fd, "Estimated transmission time ");
X
X while (--i >= 0)
X if (nums[i])
X fprintf (fd, "%d %s%c ", nums[i], &sep[i][0],
X nums[i] == 1 ? ' ' : 's');
X fprintf (fd, "\n");
X return (0);
X }
END_OF_FILE
if test 4396 -ne `wc -c <'pf-bootstrap-v1.1a/xmodem-3.9/misc.c'`; then
echo shar: \"'pf-bootstrap-v1.1a/xmodem-3.9/misc.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/xmodem-3.9/misc.c'
fi
if test -f 'pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h'\" \(3839 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h' <<'END_OF_FILE'
X#include <ctype.h>
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <sys/time.h>
X#include <sgtty.h>
X#include <signal.h>
X
X/* define macros to print messages in log file */
X#define logit(string) if(LOGFLAG)fprintf(LOGFP,string)
X#define logitarg(string,argument) if(LOGFLAG)fprintf(LOGFP,string,argument)
X#define tlogit(string) if(TIPFLAG)fprintf(stderr,string)
X#define tlogitarg(string,argument) if(TIPFLAG)fprintf(stderr,string,argument)
X
X#define VERSION "3.9 (November 1990)"
X#define FALSE 0
X#define TRUE 1
X
X
X/* ASCII Constants */
X#define SOH 001
X#define STX 002
X#define ETX 003
X#define EOT 004
X#define ENQ 005
X#define ACK 006
X#define LF 012 /* Unix LF/NL */
X#define CR 015
X#define NAK 025
X#define SYN 026
X#define CAN 030
X#define ESC 033
X
X/* XMODEM Constants */
X#define TIMEOUT -1
X#define ERRORMAX 10 /* maximum errors tolerated while transferring a packet */
X#define WAITFIRST 1 /* seconds between startup characters in read */
X#define STERRORMAX 60 /* maximum "errors" tolerated in read startup */
X#define CRCSWMAX 30 /* maximum time to try CRC mode before switching */
X#define NAKMAX 120 /* maximum times to wait for initial NAK when sending */
X#define RETRYMAX 5 /* maximum retries to be made certain handshaking routines */
X#define KSWMAX 5 /* maximum errors before switching to 128 byte packets */
X#define EOTMAX 10 /* maximum times sender will send an EOT to end transfer */
X#define SLEEPNUM 100 /* target number of characters to collect during sleepy time */
X#define BBUFSIZ 1024 /* buffer size */
X#define NAMSIZ 11 /* length of a CP/M file name string */
X#define CTRLZ 032 /* CP/M EOF for text (usually!) */
X#define CRCCHR 'C' /* CRC request character */
X#define KCHR 'K' /* 1K block request character */
X#define GCHR 'G' /* Ymodem-G request character */
X#define BAD_NAME 'u' /* Bad filename indicator */
X#define TIPDELAY 15 /* seconds to delay handshake startup when -w */
X
X#define CREATMODE 0644 /* mode for created files */
X
X/* GLOBAL VARIABLES */
X
Xint ttyspeed; /* tty speed (bits per second) */
Xunsigned char buff[BBUFSIZ]; /* buffer for data */
Xint nbchr; /* number of chars read so far for buffered read */
Xlong filelength; /* length specified in YMODEM header */
Xlong fileread; /* characters actually read so far in file */
Xchar filename[256]; /* place to construct filenames */
Xint yfilesleft; /* # of files left for YMODEM header */
Xlong ytotleft; /* # of bytes left for YMODEM header */
X
XFILE *LOGFP; /* descriptor for LOG file */
X
X/* option flags and state variables */
Xchar XMITTYPE; /* text or binary? */
Xint DEBUG; /* keep debugging info in log? */
Xint RECVFLAG; /* receive? */
Xint SENDFLAG; /* send? */
Xint BATCH; /* batch? (Now used as a state variable) */
Xint CRCMODE; /* CRC or checksums? */
Xint DELFLAG; /* don't delete old log file? */
Xint LOGFLAG; /* keep log? */
Xint LONGPACK; /* do not use long packets on transmit? */
Xint MDM7BAT; /* MODEM7 batch protocol */
Xint YMDMBAT; /* YMODEM batch protocol */
Xint TOOBUSY; /* turn off sleeping in packet read routine */
Xint TIPFLAG; /* for tip ~C command */
Xint DELAYFLAG; /* for startup delay */
Xint NOEOT; /* suppress EOT verification */
Xint CANCAN; /* allow CAN-CAN aborts anytime */
Xint YMODEMG; /* YMODEM-G variant of YMODEM */
X
Xint CHECKLENGTH; /* Are we truncating a file to a YMODEM length? */
X
X
X/* CRC-16 constants. From Usenet contribution by Mark G. Mendel,
X Network Systems Corp. (ihnp4!umn-cs!hyper!mark)
X*/
X
X /* the CRC polynomial. */
X#define P 0x1021
X
X /* number of bits in CRC */
X#define W 16
X
X /* the number of bits per char */
X#define B 8
END_OF_FILE
if test 3839 -ne `wc -c <'pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h'`; then
echo shar: \"'pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/xmodem-3.9/xmodem.h'
fi
echo shar: End of archive 2 \(of 9\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 9 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0