[comp.sys.handhelds] pf-bootstrap-v1.1a part 1 of 9

dan@i10s7.ira.uka.de (Dan Mosedale) (05/17/91)

Excerpts from the README file:

pf-bootstrap v1.1a
------------------
This is a short package that I have put together so that one can do
effective file-transfers between a Sun and an Atari Portfolio palmtop
computer using the serial interface. 

This can probably be considered an alpha version, as I have only tried
it out with the following configuration:  Sun SPARCstation SLC, SunOS
4.1.  It will probably run on most Suns with SunOS 4.0 and up, and
shouldn't be too tough to get working with other BSD based systems.

-Dan Mosedale
dmose@bright.math.uoregon.edu

A compressed tar file can be found on atari.archive.umich.edu
(141.211.164.8).  It is currently in atari/portfolio/new, but I imagine
it may get moved over to the atari/portfolio/telecomm in the future.

#! /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 9)."
# Contents:  pf-bootstrap-v1.1a pf-bootstrap-v1.1a/pf-cmds
#   pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue
#   pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue
#   pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue
#   pf-bootstrap-v1.1a/pf-cmds/readme.doc pf-bootstrap-v1.1a/remote
#   pf-bootstrap-v1.1a/tipx-p1 pf-bootstrap-v1.1a/tipx-p1/README
#   pf-bootstrap-v1.1a/tipx-p1/README.SLIP
#   pf-bootstrap-v1.1a/tipx-p1/TODO
#   pf-bootstrap-v1.1a/tipx-p1/acutab.c
#   pf-bootstrap-v1.1a/tipx-p1/cmdtab.c
#   pf-bootstrap-v1.1a/tipx-p1/cu.c
#   pf-bootstrap-v1.1a/tipx-p1/hosts.slip
#   pf-bootstrap-v1.1a/tipx-p1/hunt.c
#   pf-bootstrap-v1.1a/tipx-p1/libacu
#   pf-bootstrap-v1.1a/tipx-p1/libacu/Makefile
#   pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.c
#   pf-bootstrap-v1.1a/tipx-p1/libacu/df.c
#   pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.c
#   pf-bootstrap-v1.1a/tipx-p1/log.c
#   pf-bootstrap-v1.1a/tipx-p1/login.script
#   pf-bootstrap-v1.1a/tipx-p1/partab.c
#   pf-bootstrap-v1.1a/tipx-p1/phones-file
#   pf-bootstrap-v1.1a/tipx-p1/remote-file
#   pf-bootstrap-v1.1a/tipx-p1/slip.h
#   pf-bootstrap-v1.1a/tipx-p1/uucplock.c
#   pf-bootstrap-v1.1a/xmodem-3.9
#   pf-bootstrap-v1.1a/xmodem-3.9/Makefile
# Wrapped by dan@nostromo on Fri May 17 02:31:40 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'pf-bootstrap-v1.1a' ; then
    echo shar: Creating directory \"'pf-bootstrap-v1.1a'\"
    mkdir 'pf-bootstrap-v1.1a'
fi
if test ! -d 'pf-bootstrap-v1.1a/pf-cmds' ; then
    echo shar: Creating directory \"'pf-bootstrap-v1.1a/pf-cmds'\"
    mkdir 'pf-bootstrap-v1.1a/pf-cmds'
fi
if test -f 'pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue'\" \(383 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue' <<'END_OF_FILE'
Xbegin 644 binhex.com
XMN   H(  !(#^P(O8N   B >T/;J" +  S2&CD0&T/+J8 ;D  ,TAHY,!M#^+
XM'I$!N0$ NI<!S2%R'JG__W09H)<!NY4!Z"$ M$"+'I,!N0( NI4!S2'KTK0^
XMBQZ1 <TAM#Z+'I,!S2'#4U%24-#HT.C0Z-#H!# \.78"! >(!T-8) \$,#PY
XM=@($!X@'6EE;PP        !215-53%0N3U54                        
XM                                                            
X?                                            
X 
Xend
END_OF_FILE
if test 383 -ne `wc -c <'pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue'`; then
    echo shar: \"'pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/pf-cmds/binhex.com.uue'
fi
if test -f 'pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue'\" \(205 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue' <<'END_OF_FILE'
Xbegin 644 chksum.com
XMN   H(  !(#^P(O8N   B >T/;J" +  S2&C< &T/XL>< &Y 0"Z= '-(7(1
XMJ?__= RX  "@= $!!G(!Z]^T/HL>< '-(8L><@&Y! #1P]'#T</1PU-1B]. 
XFX@^ PC" ^CEV X#"![0"S2%96^+>PP                    #1
X 
Xend
END_OF_FILE
if test 205 -ne `wc -c <'pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue'`; then
    echo shar: \"'pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/pf-cmds/chksum.com.uue'
fi
if test -f 'pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue'\" \(383 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue' <<'END_OF_FILE'
Xbegin 644 hexbin.com
XMN   H(  !(#^P(O8N   B >T/;J" +  S2&CE &T/+J< ;D  ,TAHY8!M#^+
XM'I0!N0( NI@!S2%R'JG__W09NY@!Z"0 HIL!M$"+'I8!N0$ NIL!S2'KTK0^
XMBQZ4 <TAM#Z+'I8!S2'#N   45"*!RPP>!T\"78&+ <\#W<3N0  BLA8T>#1
XMX-'@T> #P4/KW%A9PP          4D5354Q4+D]55                   
XM                                                            
X?                                            
X 
Xend
END_OF_FILE
if test 383 -ne `wc -c <'pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue'`; then
    echo shar: \"'pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/pf-cmds/hexbin.com.uue'
fi
if test -f 'pf-bootstrap-v1.1a/pf-cmds/readme.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/pf-cmds/readme.doc'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/pf-cmds/readme.doc'\" \(1211 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/pf-cmds/readme.doc' <<'END_OF_FILE'
XSo you got just what you asked for, an Atari Portfolio.  It is a great little
Xcomputer.  It can do many wonderful things.  A natural addition, to make it
Xever so much more useful is the serial interface.  This lets you "see the
Xworld", or at least listen to it.
X
XTerrific!  You feverishly open the boxes, throw away the documentation and lo
Xand behold, there is no serial port software in the machine.  The file transfer
Xutility is only for the parallel port. 
X
XIn an attempt to enable the loading of these programs in an orderly and simple
Xfashion, I have prepared the accompanying files.  Credit goes to Jim Strauss,
XI believe, for XTERM1.COM, BINHEX.COM, HEXBIN.COM and CHKSUM.COM.  I have added
XPFLOAD.EXE, PFBOOT.BAT and LOAD.BAT.  Together, the process is nearly foolproof
XOkay you fools, prove me wrong).  I have taken the liberty of bundling these
Xprograms together for ease of downloading, especially for novices. Oh Yes, all
Xprograms are MS-DOS compatible.
X
XTo load, simply connect the serial cable, start both machines and type (on PC):
X
X		PFBOOT [ENTER]
X
XThe programs prompt you when necessary.
X
X
XFor further assistance and/or questions:
X
X	Michael D. Weisner
X	71401,1245
END_OF_FILE
if test 1211 -ne `wc -c <'pf-bootstrap-v1.1a/pf-cmds/readme.doc'`; then
    echo shar: \"'pf-bootstrap-v1.1a/pf-cmds/readme.doc'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/pf-cmds/readme.doc'
fi
if test -f 'pf-bootstrap-v1.1a/remote' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/remote'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/remote'\" \(734 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/remote' <<'END_OF_FILE'
Xpfboot|Atari Portfolio Bootstrapping Mode:\
X	:dv=/dev/ttya:br#110:fo=:nb:nt:ie=^Z:oe=^Z:pa=none:rw:
Xportfolio|pf|Atari Portfolio:\
X	:dv=/dev/ttya:br#9600:fo=:nb:nt:ie=^Z:oe=^Z:pa=none:rw:
X--------------------------------------------------------------------
XThe attributes are:
X
Xdv	device to use for the tty
Xel	EOL marks (default is NULL)
Xdu	make a call flag (dial up)
Xpn	phone numbers (@ =>'s search phones file; possibly taken from
X			      PHONES environment variable)
Xat	ACU type
Xie	input EOF marks	(default is NULL)
Xoe	output EOF string (default is NULL)
Xcu	call unit (default is dv)
Xbr	baud rate (defaults to 300)
Xfs	frame size (default is BUFSIZ) -- used in buffering writes
X	  on receive operations
Xtc	to continue a capability
END_OF_FILE
if test 734 -ne `wc -c <'pf-bootstrap-v1.1a/remote'`; then
    echo shar: \"'pf-bootstrap-v1.1a/remote'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/remote'
fi
if test ! -d 'pf-bootstrap-v1.1a/tipx-p1' ; then
    echo shar: Creating directory \"'pf-bootstrap-v1.1a/tipx-p1'\"
    mkdir 'pf-bootstrap-v1.1a/tipx-p1'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/README'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/README'\" \(2084 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/README' <<'END_OF_FILE'
XREADME  -  last updated 1 April 89 (no it's not a joke)
X
XAdded SLIP support (See man page and README.SLIP)
XAdded Pager support (See man pager and page.c)
XAdded auto login code (See README.SLIP and example files)
X
XDoug Kingston  <dpk@morgan.com>
XMorgan Stanley & Co.
X
X
X--------------------------------------------------------------------------
X
XRecent changes about Jan 82 
X
XA new, improved version of tip is now available.  The most important
Xaddition is the capacility to specify a phone number with tip.  The
Xdefault baud rate is 1200.  To use it do:
X
X	tip phone-number
Xor
X	tip -300 phone-number
X
Xfor 300 baud.
X
XA ~^Z command has been added to tip as well.
X
XA new cu program is available that interfaces to the tip program.
XIt attempts to give the same user interface as cu but it is really
Xthe tip program so you have all the advantages of tip.  This allows
Xcu (actually tip) to search for a free ACU instead of having the
Xuser specify which one he wants.
X
X------------------------------------------------------------------------
X
XTip can be configured in a number of ways:
X
XACU's:
X-----
X
XACU				Define in makefile
X--------------------		---------------
XBIZCOMP 1022, 1031		BIZ1022, BIZ1031
XDEC DF02-AC, DF03-AC		DF02, DF03
XDEC DN-11/Able Quadracall	DN11
XVentel				VENTEL
XVadic 831			V831
X
XNew ACU's may be added by editing the ACU description table
Xin acutab.c and writing a ``driver''.
X
XACU usage can be monitored by defining ACULOG in the makefile.
XIf this is done and no phone numbers should appear in the
Xlog file, define PRISTINE in the makefile.
X
XVariables:
X---------
X
XTip's internal workings revolve around a set of (possibly)
Xuser defined variables.  These are statically initialized
Xin vars.c, and from the remote file.
X
XNote that adding or deleting variables requires tip to be completedly
Xrecompiled, as indexes into the variable table are used to avoid
Xexpensive lookups.  These defines are set in tip.h.
X
XCommands:
X--------
X
XThe command dispatch table is defined in cmdtab.c.  Commands
Xmay have attributes such as EXPerimental and PRIVileged (only
Xroot may execute).
X
END_OF_FILE
if test 2084 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/README'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/README'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/README'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/README.SLIP' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/README.SLIP'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/README.SLIP'\" \(2160 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/README.SLIP' <<'END_OF_FILE'
XSeveral changes were added to support SLIP dialout usage.
X
XFirst a login script processor was added (login.c) which
Xis called after the connection is complete.  See the file
Xlogin.script for a sample script.  The script file is specified
Xwith the variable "ls" in /etc/remote.
X
XThe other change was to add the -s option to slip which tells
Xit to enable slip after successful connection/login.  To do this
Xit uses additional information in /etc/remote:
X	sa = local slip address string
X	da = destination slip address string
X	sm = slip netmask
X	st = slip type string (eg. slip, isppp) (currently unimplemented)
X		(will be used for choosing compression schemes)
X	rt = flag to cause setting of default route in none exists
X
XThe script syntax is pretty simple.  There are 6 types of lines:
XA "label" line:	"label foo"
XA "goto" line:	"goto foo"	(basically a branch to label foo)
XA "send" line:	"send \dFooBar\r"
X	Uses C escaping syntax plus a couple of others (\d = delay 1 sec,
X	\s = space, \x = break)
XA "recv" line:	"recv 10/error login:"
X	says look for the strings 'login:' but if its not seen
X	in 10 seconds, do a "goto error".
XA "done" line:	"done"		(indicates a successful login)
XA "fail" line:	"fail"		(indicates an unsuccessful login)
X
XBlank lines and lines beginning with '#' are ignored.
X
XI admit the language is a bit brain-dead, but it was cheap and
Xand easy to implement, and I am sure some bright lad will turn
Xit into the next Postscript some day...
X
XRelated to this enhanced tip is the program "sliplogin" which
Xwill act as a login shell for an incoming dialup slip connection.
XIt provides a level of authentication and control of address
Xassignment.  It can also be used to configure an arbitrary port
Xif invoked by the superuser.  Sliplogin is not in this directory
X(tip) but is expected to be released in parallel.
X
XEnjoy,
X	Doug Kingston	<dpk@morgan.com>
X
X	Morgan Stanley & Co. (19th Floor)
X	1251 Avenue of the Americas
X	NY, NY, 10020
X	(212) 703-7541
X
XTODO:
X	port back to SunOS 3.5/4.2BSD environment (line discipline version)
X		(code is there but untested)
X	work on header file includes and ioctl usage
X		to eliminate the redefine error messages
END_OF_FILE
if test 2160 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/README.SLIP'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/README.SLIP'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/README.SLIP'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/TODO' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/TODO'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/TODO'\" \(720 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/TODO' <<'END_OF_FILE'
X1. Rethink protection glitches on REMOTE & PHONES
X   files (setuid/setgid??).
X
X2. Make clean fix for scripting being set in .tiprc
X
X3.  change EOFREAD to recognize more general strings.
X
X4.  add an option that returns an exit status based on
X    whether resources for the requested operation are available.
X
X5.  write a program to list known systems (a quick shell script
X    should do it); people keep forgetting the names.
X
X6.  change remote file descriptions so that acu attributes are
X    are attached to a device so that several different devices
X    can be used to get to the same system (perhaps hardwired
X    and phone line).  got any ideas here?  I'm looking at something
X    like dv=cua1,cul1,dn11;cua2,,df03.
END_OF_FILE
if test 720 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/TODO'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/TODO'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/TODO'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/acutab.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/acutab.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/acutab.c'\" \(2706 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/acutab.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[] = "@(#)acutab.c	5.3 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X
Xextern int df02_dialer(), df03_dialer(), df_disconnect(), df_abort(),
X	   biz31f_dialer(), biz31_disconnect(), biz31_abort(),
X	   biz31w_dialer(),
X	   biz22f_dialer(), biz22_disconnect(), biz22_abort(),
X	   biz22w_dialer(),
X	   ven_dialer(), ven_disconnect(), ven_abort(),
X	   hay_dialer(), hay_disconnect(), hay_abort(),
X	   cour_dialer(), cour_disconnect(), cour_abort(),
X	   v3451_dialer(), v3451_disconnect(), v3451_abort(),
X	   v831_dialer(), v831_disconnect(), v831_abort(),
X	   sm24_dialer(), sm24_disconnect(), sm24_abort(),
X	   tb_dialer(), tb_disconnect(), tb_abort(),
X	   dn_dialer(), dn_disconnect(), dn_abort();
X
Xacu_t acutable[] = {
X#if TELEBIT
X	"telebit", tb_dialer,	tb_disconnect,		tb_abort,
X#endif
X#if SM2400
X	"sm2400", sm24_dialer,	sm24_disconnect,	sm24_abort,
X#endif
X#if BIZ1031
X	"biz31f", biz31f_dialer, biz31_disconnect,	biz31_abort,
X	"biz31w", biz31w_dialer, biz31_disconnect,	biz31_abort,
X#endif
X#if BIZ1022
X	"biz22f", biz22f_dialer, biz22_disconnect,	biz22_abort,
X	"biz22w", biz22w_dialer, biz22_disconnect,	biz22_abort,
X#endif
X#if DF02
X	"df02",	df02_dialer,	df_disconnect,		df_abort,
X#endif
X#if DF03
X	"df03",	df03_dialer,	df_disconnect,		df_abort,
X#endif
X#if DN11
X	"dn11",	dn_dialer,	dn_disconnect,		dn_abort,
X#endif
X#ifdef VENTEL
X	"ventel",ven_dialer,	ven_disconnect,		ven_abort,
X#endif
X#ifdef HAYES
X	"hayes",hay_dialer,	hay_disconnect,		hay_abort,
X#endif
X#ifdef COURIER
X	"courier",cour_dialer,	cour_disconnect,	cour_abort,
X#endif
X#ifdef V3451
X#ifndef V831
X	"vadic",v3451_dialer,	v3451_disconnect,	v3451_abort,
X#endif
X	"v3451",v3451_dialer,	v3451_disconnect,	v3451_abort,
X#endif
X#ifdef V831
X#ifndef V3451
X	"vadic",v831_dialer,	v831_disconnect,	v831_abort,
X#endif
X	"v831",v831_dialer,	v831_disconnect,	v831_abort,
X#endif
X	0,	0,		0,			0
X};
X
END_OF_FILE
if test 2706 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/acutab.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/acutab.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/acutab.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/cmdtab.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/cmdtab.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/cmdtab.c'\" \(2422 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/cmdtab.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:55-wht@n4hgf-rawthru */
X
X#ifndef lint
Xstatic char sccsid[] = "@(#)cmdtab.c	5.5 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X
Xextern	int shell(), getfl(), sendfile(), chdirectory();
Xextern	int finish(), help(), pipefile(), pipeout(), consh(), variable();
Xextern	int cu_take(), cu_put(), dollar(), genbrk(), suspend();
X
X#ifdef TIPX
Xextern int genctls(), genctlq(), rawthru_control();
Xextern int filexfer();
X#endif
X
Xesctable_t etable[] = {
X	{ '!',	NORM,	"shell",			 shell },
X	{ '<',	NORM,	"receive file from remote host", getfl },
X	{ '>',	NORM,	"send file to remote host",	 sendfile },
X	{ 't',	NORM,	"take file from remote UNIX",	 cu_take },
X	{ 'p',	NORM,	"put file to remote UNIX",	 cu_put },
X	{ '|',	NORM,	"pipe remote file",		 pipefile },
X	{ '$',	NORM,	"pipe local command to remote host", pipeout },
X#ifdef CONNECT
X	{ 'C',  NORM,	"connect program to remote host",consh },
X#endif
X	{ 'c',	NORM,	"change directory",		 chdirectory },
X	{ '.',	NORM,	"exit from tip",		 finish },
X	{CTRL('d'),NORM,"exit from tip",		 finish },
X	{CTRL('y'),NORM,"suspend tip (local+remote)",	 suspend },
X	{CTRL('z'),NORM,"suspend tip (local only)",	 suspend },
X	{ 's',	NORM,	"set variable",			 variable },
X	{ '?',	NORM,	"get this summary",		 help },
X	{ '#',	NORM,	"send break",			 genbrk },
X#ifdef TIPX
X	{ 'S',	NORM,	"send ^S (XOFF)",		 genctls },
X	{ 'Q',	NORM,	"send ^Q (XON)",		 genctlq },
X	{ 'R',	NORM,	"set rawthru mode",		 rawthru_control },
X	{ 'N',	NORM,	"no rawthru mode",		 rawthru_control },
X	{ 'X',  NORM,	"X/Y/ZMODEM send/receive",filexfer },
X#endif
X	{ 0, 0, 0 }
X};
END_OF_FILE
if test 2422 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/cmdtab.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/cmdtab.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/cmdtab.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/cu.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/cu.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/cu.c'\" \(2640 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/cu.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[] = "@(#)cu.c	5.7 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X
Xint	cleanup();
Xint	timeout();
X
X/*
X * Botch the interface to look like cu's
X */
Xcumain(argc, argv)
X	char *argv[];
X{
X	register int i;
X	static char sbuf[12];
X
X	if (argc < 2) {
X		printf("usage: cu telno [-t] [-s speed] [-a acu] [-l line] [-#]\n");
X		exit(8);
X	}
X	CU = DV = NOSTR;
X	BR = DEFBR;
X	for (; argc > 1; argv++, argc--) {
X		if (argv[1][0] != '-')
X			PN = argv[1];
X		else switch (argv[1][1]) {
X
X		case 't':
X			HW = 1, DU = -1;
X			--argc;
X			continue;
X
X		case 'a':
X			CU = argv[2]; ++argv; --argc;
X			break;
X
X		case 's':
X			if (argc < 3 || speed(atoi(argv[2])) == 0) {
X				fprintf(stderr, "cu: unsupported speed %s\n",
X					argv[2]);
X				exit(3);
X			}
X			BR = atoi(argv[2]); ++argv; --argc;
X			break;
X
X		case 'l':
X			DV = argv[2]; ++argv; --argc;
X			break;
X
X		case '0': case '1': case '2': case '3': case '4':
X		case '5': case '6': case '7': case '8': case '9':
X			if (CU)
X				CU[strlen(CU)-1] = argv[1][1];
X			if (DV)
X				DV[strlen(DV)-1] = argv[1][1];
X			break;
X
X		default:
X			printf("Bad flag %s", argv[1]);
X			break;
X		}
X	}
X	signal(SIGINT, cleanup);
X	signal(SIGQUIT, cleanup);
X	signal(SIGHUP, cleanup);
X	signal(SIGTERM, cleanup);
X
X	/*
X	 * The "cu" host name is used to define the
X	 * attributes of the generic dialer.
X	 */
X	(void)sprintf(sbuf, "cu%d", BR);
X	if ((i = hunt(sbuf)) == 0) {
X		printf("all ports busy\n");
X		exit(3);
X	}
X	if (i == -1) {
X		printf("link down\n");
X		(void)uu_unlock(uucplock);
X		exit(3);
X	}
X	setbuf(stdout, NULL);
X	loginit();
X	user_uid();
X	vinit();
X	setparity("none");
X	boolean(value(VERBOSE)) = 0;
X	if (HW)
X		ttysetup(speed(BR));
X	if (lconnect()) {
X		printf("Connect failed\n");
X		daemon_uid();
X		(void)uu_unlock(uucplock);
X		exit(1);
X	}
X	if (!HW)
X		ttysetup(speed(BR));
X}
END_OF_FILE
if test 2640 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/cu.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/cu.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/cu.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/hosts.slip' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/hosts.slip'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/hosts.slip'\" \(160 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/hosts.slip' <<'END_OF_FILE'
X#
X# Login		Mode	Local Address	Remote Address	Net Mask
X#
XIPhost1		slip	193.100.1.2	193.100.1.1	255.255.255.0
XIPhost2		slip	193.100.2.2	193.100.2.1	255.255.255.0
END_OF_FILE
if test 160 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/hosts.slip'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/hosts.slip'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/hosts.slip'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/hunt.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/hunt.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/hunt.c'\" \(3151 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/hunt.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[] = "@(#)hunt.c	5.4 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X
Xextern char *getremote();
Xextern char *rindex();
X
Xstatic	jmp_buf deadline;
Xstatic	int deadfl;
X
Xchar uucplock[BUFSIZ];
X#ifdef TIPX
Xchar opened_tty[128];
X#endif
X
Xdead()
X{
X
X	deadfl = 1;
X	longjmp(deadline, 1);
X}
X
Xhunt(name)
X	char *name;
X{
X	register char *cp, *cf, *ct;
X	sigfunc_t (*f)();
X
X	f = signal(SIGALRM, dead);
X	while (cp = getremote(name)) {
X		/*
X		 * The name of the lock is pretty important. We don't
X		 * want to introduce the following security problems:
X		 * 1. Namecollision in lock file between different devices
X		 * 2. uucplock is used to decide whether or not to call
X		 *    acucntrl. Thus, non-/dev devices should have a different
X		 *    lock name than devices in /dev.
X		 */
X		if (*cp != '/')	/* device name must be absolute path */
X			continue;
X		while (*cp == '/') cp++;
X		cp--;
X		if (strncmp("/dev/", cp, 5) == 0) {
X			cf = cp + 5;
X			while (*cf == '/') cf++;
X		} else
X			cf = cp;
X		ct = uucplock;
X		while (*cf) {
X			if (*cf == '/') {
X				if (ct == uucplock
X				    || (ct > uucplock && *(ct-1) != '_'))
X					*ct++ = '_';
X			} else
X				*ct++ = *cf;
X			cf++;
X		}
X		*ct = '\0';
X		/*
X		 * At this point we are guranteed that any devices outside
X		 * /dev will have a lock name starting with underscore (_),
X		 * and that any slashes (/) in the pathname have been changed
X		 * to underscores, and that multiple slashes are only made
X		 * into a single underscore. Thus, any way of expressing
X		 * a pathname will lead to a unique lock file name.
X		 */
X		deadfl = 0;
X		if (uu_lock(uucplock) < 0)
X			continue;
X		/*
X		 * Straight through call units, such as the BIZCOMP,
X		 * VADIC and the DF, must indicate they're hardwired in
X		 *  order to get an open file descriptor placed in FD.
X		 * Otherwise, as for a DN-11, the open will have to
X		 *  be done in the "open" routine.
X		 */
X		if (!HW)
X			break;
X
X#ifdef TIPX
X		strcpy(opened_tty,cp);
X#endif
X		if (setjmp(deadline) == 0) {
X			alarm(10);
X			FD = open(cp, O_RDWR);
X		}
X		alarm(0);
X		if (FD < 0) {
X			perror(cp);
X			deadfl = 1;
X		}
X		if (!deadfl) {
X			ioctl(FD, TIOCEXCL, 0);
X			ioctl(FD, TIOCHPCL, 0);
X			signal(SIGALRM, SIG_DFL);
X			return ((int)cp);
X		}
X		(void)uu_unlock(uucplock);
X	}
X	signal(SIGALRM, f);
X	return (deadfl ? -1 : (int)cp);
X}
END_OF_FILE
if test 3151 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/hunt.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/hunt.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/hunt.c'
fi
if test ! -d 'pf-bootstrap-v1.1a/tipx-p1/libacu' ; then
    echo shar: Creating directory \"'pf-bootstrap-v1.1a/tipx-p1/libacu'\"
    mkdir 'pf-bootstrap-v1.1a/tipx-p1/libacu'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/libacu/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/libacu/Makefile'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/libacu/Makefile'\" \(1609 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/libacu/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#	@(#)Makefile	5.4 (Berkeley) 9/2/88
X#
X# make file for tip device drivers
X#
X# Current drivers:
X#	BIZCOMP
X#	USR COURIER (2400 baud)
X#	DEC DF02-AC, DF03-AC
X#	DEC DN-11/Able Quadracall
X#	HAYES and Hayes emulators
X#	VENTEL 212+ (w/o echo)
X#	VADIC 831 RS232 adaptor
X#	VADIC 3451
X#	Hayes Smartmodem 2400
X#	Telebit Trailblazer
X
XCFLAGS=	-O -I.. -DDEBUG
XLIBC=	/lib/libc.a
XSRCS=	biz22.c biz31.c courier.c df.c dn11.c hayes.c ventel.c v831.c v3451.c \
X	sm2400.c telebit.c
XOBJS=	biz22.o biz31.o courier.o df.o dn11.o hayes.o ventel.o v831.o v3451.o \
X	sm2400.o telebit.o
XMAN=
X
Xall: libacu.a
X
Xlibacu.a: ${OBJS}
X	ar cu $@ ${OBJS}
X	ranlib $@
X
Xclean:
X	-rm -f ${OBJS} core libacu.a
X
Xcleandir: clean
X	-rm -f tags .depend
X
Xdepend:
X	mkdep ${CFLAGS} ${SRCS}
X
Xinstall:
X
Xlint:
X	lint ${CFLAGS} ${SRCS}
X
Xtags:
X	ctags ${SRCS}
X
END_OF_FILE
if test 1609 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/libacu/Makefile'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/libacu/Makefile'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/libacu/Makefile'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.c'\" \(3278 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.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[] = "@(#)biz22.c	5.2 (Berkeley) 9/13/88";
X#endif /* not lint */
X
X#include "tip.h"
X
X#define DISCONNECT_CMD	"\20\04"	/* disconnection string */
X
Xstatic	int sigALRM();
Xstatic	int timeout = 0;
Xstatic	jmp_buf timeoutbuf;
X
X/*
X * Dial up on a BIZCOMP Model 1022 with either
X * 	tone dialing (mod = "V")
X *	pulse dialing (mod = "W")
X */
Xstatic int
Xbiz_dialer(num, mod)
X	char *num, *mod;
X{
X	register int connected = 0;
X	char cbuf[40];
X
X	if (boolean(value(VERBOSE)))
X		printf("\nstarting call...");
X	/*
X	 * Disable auto-answer and configure for tone/pulse
X	 *  dialing
X	 */
X	if (cmd("\02K\r")) {
X		printf("can't initialize bizcomp...");
X		return (0);
X	}
X	strcpy(cbuf, "\02.\r");
X	cbuf[1] = *mod;
X	if (cmd(cbuf)) {
X		printf("can't set dialing mode...");
X		return (0);
X	}
X	strcpy(cbuf, "\02D");
X	strcat(cbuf, num);
X	strcat(cbuf, "\r");
X	write(FD, cbuf, strlen(cbuf));
X	if (!detect("7\r")) {
X		printf("can't get dial tone...");
X		return (0);
X	}
X	if (boolean(value(VERBOSE)))
X		printf("ringing...");
X	/*
X	 * The reply from the BIZCOMP should be:
X	 *	2 \r or 7 \r	failure
X	 *	1 \r		success
X	 */
X	connected = detect("1\r");
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, "biz1022", line);
X	}
X#endif
X	if (timeout)
X		biz22_disconnect();	/* insurance */
X	return (connected);
X}
X
Xbiz22w_dialer(num, acu)
X	char *num, *acu;
X{
X
X	return (biz_dialer(num, "W"));
X}
X
Xbiz22f_dialer(num, acu)
X	char *num, *acu;
X{
X
X	return (biz_dialer(num, "V"));
X}
X
Xbiz22_disconnect()
X{
X	int rw = 2;
X
X	write(FD, DISCONNECT_CMD, 4);
X	sleep(2);
X	ioctl(FD, TIOCFLUSH, &rw);
X}
X
Xbiz22_abort()
X{
X
X	write(FD, "\02", 1);
X}
X
Xstatic int
XsigALRM()
X{
X
X	timeout = 1;
X	longjmp(timeoutbuf, 1);
X}
X
Xstatic int
Xcmd(s)
X	register char *s;
X{
X	char c;
X	sigfunc_t (*f)();
X
X	write(FD, s, strlen(s));
X	f = signal(SIGALRM, sigALRM);
X	if (setjmp(timeoutbuf)) {
X		biz22_abort();
X		signal(SIGALRM, f);
X		return (1);
X	}
X	alarm(number(value(DIALTIMEOUT)));
X	read(FD, &c, 1);
X	alarm(0);
X	signal(SIGALRM, f);
X	c &= 0177;
X	return (c != '\r');
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			biz22_abort();
X			break;
X		}
X		alarm(number(value(DIALTIMEOUT)));
X		read(FD, &c, 1);
X		alarm(0);
X		c &= 0177;
X		if (c != *s++)
X			return (0);
X	}
X	signal(SIGALRM, f);
X	return (timeout == 0);
X}
END_OF_FILE
if test 3278 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/libacu/biz22.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/libacu/df.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/libacu/df.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/libacu/df.c'\" \(2448 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/libacu/df.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[] = "@(#)df.c	5.2 (Berkeley) 9/13/88";
X#endif /* not lint */
X
X/*
X * Dial the DF02-AC or DF03-AC
X */
X
X#include "tip.h"
X
Xstatic jmp_buf Sjbuf;
Xstatic timeout();
X
Xdf02_dialer(num, acu)
X	char *num, *acu;
X{
X
X	return (df_dialer(num, acu, 0));
X}
X
Xdf03_dialer(num, acu)
X	char *num, *acu;
X{
X
X	return (df_dialer(num, acu, 1));
X}
X
Xdf_dialer(num, acu, df03)
X	char *num, *acu;
X	int df03;
X{
X	register int f = FD;
X	struct sgttyb buf;
X	int speed = 0, rw = 2;
X	char c = '\0';
X
X	ioctl(f, TIOCHPCL, 0);		/* make sure it hangs up when done */
X	if (setjmp(Sjbuf)) {
X		printf("connection timed out\r\n");
X		df_disconnect();
X		return (0);
X	}
X	if (boolean(value(VERBOSE)))
X		printf("\ndialing...");
X	fflush(stdout);
X#ifdef TIOCMSET
X	if (df03) {
X		int st = TIOCM_ST;	/* secondary Transmit flag */
X
X		ioctl(f, TIOCGETP, &buf);
X		if (buf.sg_ospeed != B1200) {	/* must dial at 1200 baud */
X			speed = buf.sg_ospeed;
X			buf.sg_ospeed = buf.sg_ispeed = B1200;
X			ioctl(f, TIOCSETP, &buf);
X			ioctl(f, TIOCMBIC, &st); /* clear ST for 300 baud */
X		} else
X			ioctl(f, TIOCMBIS, &st); /* set ST for 1200 baud */
X	}
X#endif
X	signal(SIGALRM, timeout);
X	alarm(5 * strlen(num) + 10);
X	ioctl(f, TIOCFLUSH, &rw);
X	write(f, "\001", 1);
X	sleep(1);
X	write(f, "\002", 1);
X	write(f, num, strlen(num));
X	read(f, &c, 1);
X#ifdef TIOCMSET
X	if (df03 && speed) {
X		buf.sg_ispeed = buf.sg_ospeed = speed;
X		ioctl(f, TIOCSETP, &buf);
X	}
X#endif
X	return (c == 'A');
X}
X
Xdf_disconnect()
X{
X	int rw = 2;
X
X	write(FD, "\001", 1);
X	sleep(1);
X	ioctl(FD, TIOCFLUSH, &rw);
X}
X
X
Xdf_abort()
X{
X
X	df_disconnect();
X}
X
X
Xstatic
Xtimeout()
X{
X
X	longjmp(Sjbuf, 1);
X}
END_OF_FILE
if test 2448 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/libacu/df.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/libacu/df.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/libacu/df.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.c'\" \(2592 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.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[] = "@(#)dn11.c	5.2 (Berkeley) 9/13/88";
X#endif /* not lint */
X
X/*
X * Routines for dialing up on DN-11
X */
X#include "tip.h"
X
Xint dn_abort(), alarmtr();
Xstatic jmp_buf jmpbuf;
Xstatic int child = -1, dn;
X
Xdn_dialer(num, acu)
X	char *num, *acu;
X{
X	extern errno;
X	char *p, *q, phone[40];
X	int lt, nw, connected = 1;
X	register int timelim;
X
X	if (boolean(value(VERBOSE)))
X		printf("\nstarting call...");
X	if ((dn = open(acu, 1)) < 0) {
X		if (errno == EBUSY)
X			printf("line busy...");
X		else
X			printf("acu open error...");
X		return (0);
X	}
X	if (setjmp(jmpbuf)) {
X		kill(child, SIGKILL);
X		close(dn);
X		return (0);
X	}
X	signal(SIGALRM, alarmtr);
X	timelim = 5 * strlen(num);
X	alarm(timelim < 30 ? 30 : timelim);
X	if ((child = fork()) == 0) {
X		/*
X		 * ignore this stuff for aborts
X		 */
X		signal(SIGALRM, SIG_IGN);
X		signal(SIGINT, SIG_IGN);
X		signal(SIGQUIT, SIG_IGN);
X		sleep(2);
X		nw = write(dn, num, lt = strlen(num));
X		exit(nw != lt);
X	}
X	/*
X	 * open line - will return on carrier
X	 */
X	if ((FD = open(DV, 2)) < 0) {
X		if (errno == EIO)
X			printf("lost carrier...");
X		else
X			printf("dialup line open failed...");
X		alarm(0);
X		kill(child, SIGKILL);
X		close(dn);
X		return (0);
X	}
X	alarm(0);
X	ioctl(dn, TIOCHPCL, 0);
X	signal(SIGALRM, SIG_DFL);
X	while ((nw = wait(&lt)) != child && nw != -1)
X		;
X	fflush(stdout);
X	close(dn);
X	if (lt != 0) {
X		close(FD);
X		return (0);
X	}
X	return (1);
X}
X
Xalarmtr()
X{
X
X	alarm(0);
X	longjmp(jmpbuf, 1);
X}
X
X/*
X * Insurance, for some reason we don't seem to be
X *  hanging up...
X */
Xdn_disconnect()
X{
X
X	sleep(2);
X	if (FD > 0)
X		ioctl(FD, TIOCCDTR, 0);
X	close(FD);
X}
X
Xdn_abort()
X{
X
X	sleep(2);
X	if (child > 0)
X		kill(child, SIGKILL);
X	if (dn > 0)
X		close(dn);
X	if (FD > 0)
X		ioctl(FD, TIOCCDTR, 0);
X	close(FD);
X}
END_OF_FILE
if test 2592 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/libacu/dn11.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/log.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/log.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/log.c'\" \(2279 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/log.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[] = "@(#)log.c	5.3 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include "tip.h"
X#include <grp.h>
X
X#ifdef ACULOG
Xstatic	FILE *flog = NULL;
X
X#ifdef PRISTINE
Xint pristine = 1;	/* so it is easier to change for binary-only sites */
X#else
Xint pristine = 0;
X#endif
X
X/*
X * Log file maintenance routines
X */
X
Xlogent(group, num, acu, message)
X	char *group, *num, *acu, *message;
X{
X	static int uid = -1, gid = -1;
X	static char *user, *ugroup;
X	int i;
X  	long t;
X	char *timestamp;
X	struct passwd *pwd;
X	struct group *grp;
X
X	if (flog == NULL)
X		return;
X	if (flock(fileno(flog), LOCK_EX) < 0) {
X		perror("tip: flock");
X		return;
X	}
X	if (uid != (i = geteuid())) {
X		uid = i;
X		setpwent();
X		if ((pwd = getpwuid(getuid())) == NOPWD)
X			user = "???";
X		else
X			user = pwd->pw_name;
X	}
X	if (gid != (i = getgid())) {
X		gid = i;
X		setgrent();
X		if ((grp = getgrgid(getgid())) == (struct group *)0)
X			ugroup = "???";
X		else
X			ugroup = grp->gr_name;
X	}
X	t = time(0);
X	timestamp = ctime(&t);
X	timestamp[24] = '\0';
X	fprintf(flog, "%s:%s (%s) <%s, %s, %s> %s\n",
X		user, ugroup, timestamp, group,
X		pristine ? "" : num,
X		acu, message);
X	(void) fflush(flog);
X	(void) flock(fileno(flog), LOCK_UN);
X}
X
Xloginit()
X{
X	extern int errno;
X
X  	flog = fopen(value(LOG), "a");
X	if (flog == NULL) {
X		int e = errno;
X		fprintf(stderr, "tip: can't open log file: ");
X		errno = e;
X		perror(value(LOG));
X		putc('\r', stderr);
X		putc('\n', stderr);
X	}
X}
X#endif
END_OF_FILE
if test 2279 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/log.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/log.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/log.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/login.script' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/login.script'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/login.script'\" \(236 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/login.script' <<'END_OF_FILE'
X#
X# This is a sample login script
X#
X
Xsend \r
Xrecv 10/again login:
Xgoto login
X
Xlabel again
Xsend \r
Xrecv 10/error login:
X
Xlabel login
Xsend \dIPuunet\r
Xrecv 10/error word:
Xsend \dFooBar\r
Xrecv 10/error Last\040login
Xdone
X
Xlabel error
Xfail
END_OF_FILE
if test 236 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/login.script'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/login.script'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/login.script'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/partab.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/partab.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/partab.c'\" \(1659 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/partab.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[] = "@(#)partab.c	5.2 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X/*
X * Even parity table for 0-0177
X */
Xchar evenpartab[] = {
X	0000,0201,0202,0003,0204,0005,0006,0207,
X	0210,0011,0012,0213,0014,0215,0216,0017,
X	0220,0021,0022,0223,0024,0225,0226,0027,
X	0030,0231,0232,0033,0234,0035,0036,0237,
X	0240,0041,0042,0243,0044,0245,0246,0047,
X	0050,0251,0252,0053,0254,0055,0056,0257,
X	0060,0261,0262,0063,0264,0065,0066,0267,
X	0270,0071,0072,0273,0074,0275,0276,0077,
X	0300,0101,0102,0303,0104,0305,0306,0107,
X	0110,0311,0312,0113,0314,0115,0116,0317,
X	0120,0321,0322,0123,0324,0125,0126,0327,
X	0330,0131,0132,0333,0134,0335,0336,0137,
X	0140,0341,0342,0143,0344,0145,0146,0347,
X	0350,0151,0152,0353,0154,0355,0356,0157,
X	0360,0161,0162,0363,0164,0365,0366,0167,
X	0170,0371,0372,0173,0374,0175,0176,0377,
X};
END_OF_FILE
if test 1659 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/partab.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/partab.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/partab.c'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/phones-file' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/phones-file'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/phones-file'\" \(368 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/phones-file' <<'END_OF_FILE'
Xbert		004155552184-<
Xernie		004155559822
Xlbl		004155558839-<
Xames		005559299
Xdecvax		00603-555-3311
Xdecvax		006035556374
Xcase		002165552000
Xcasevax		002165558841
Xcwrunix		002165552020
Xcwruecmp	002165552021
Xecmp		002165553454
Xnavy		423015559911
Xgi		006025551592
Xgi750		008015556750
Xtexas           512-555-1167
Xsri             415-555-8942
Xtexas-20        512-555-7449
END_OF_FILE
if test 368 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/phones-file'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/phones-file'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/phones-file'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/remote-file' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/remote-file'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/remote-file'\" \(3585 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/remote-file' <<'END_OF_FILE'
XThis file contains two sample remote files,
Xeach using a different style.  Pick one you
Xlike but don't use both!
X
X
XFirst example:
X
X#
X# General dialer definitions used below
X#
Xdial1200|1200 Baud Able Quadracall attributes:\
X	:dv=/dev/cul1:br#1200:cu=/dev/cua1:at=dn11:du:
Xdial300|300 Bizcomp 1022 attributes:\
X	:dv=/dev/cul0:br#300:cu=/dev/cua0:at=dn11:du:
X#
X# UNIX system definitions
X#
Xunix1200|1200 Baud dial-out to another UNIX system:\
X	:el=^U^C^R^O^D^S^Q:ie=%$:oe=^D:tc=dial1200:
Xunix300|300 Baud dial-out to another UNIX system:\
X	:el=^U^C^R^O^D^S^Q:ie=%$:oe=^D:tc=dial300:
X#
X# System descriptions
X#
X45|Sytek PDP-11/45:dv=/dev/ttyh1:br#9600:hw:el=^U^C^R^O^D^S^Q:ie=%$:oe=^D:
X
Xbert|CSRG ARPA VAX-11/780:pn=@:tc=unix1200:
Xernie|UCB VAX-11/780:pn=@:tc=unix1200:
Xlbl|LBL VAX-11/780:pn=@:tc=unix1200:
Xdecvax|DEC VAX-11/780:pn=@:tc=unix1200:
X
Xcasevax|cwrunix|CWRU VAX-11/750:pn=@:tc=unix1200:
Xcwruecmp|ecmp|CWRU VAX-11/780:pn=@:tc=unix1200:
Xcase|CWRU DEC-20:pn=@:tc=unix1200:
X
Xames|Ames TIP:pn=@:tc=unix1200:
Xnavy|navy PWB 11/70:pn=@:tc=unix300:
X
Xgi750|General Instruments VAX-11/750, Arizona:pn=@:tc=unix1200:
Xgi|General Instruments VAX-11/780, Utah:pn=@:tc=unix1200:
X
Xvideo:dv=/dev/tty04:br#4800:
X
X
X
X
XA second example:
X
X45z|PDP-11/45Z system:\
X	:dv=/dev/tty32:br#9600:el=^U^C^S^Q^D:ie=%$:oe=^D:
Xdecvax|DEC VAX-11/780:\
X	:pn=41148:tc=UNIX-300:
Xdecvax-1200|DEC VAX-11/780:\
X	:pn=41230:tc=UNIX-1200:
Xdecmail:\
X	:pn=42311:tc=VMS-1200:
Xems:\
X	:pn=41991:tc=VMS-1200:
Xvms750|nymph|NPG 750:\
X	:dv=/dev/tty36,/dev/tty37:br#9600:el=^Z^U^C^S^Q^O:ie=$@:oe=^Z:
Xspa|SPA VAX-11/780:\
X	:pn=8=2270513:tc=UNIX-300:
Xvax4|DECnet hub:\
X	:pn=41662:tc=VMS-1200:
Xstar|VMS development system:\
X	:pn=41701:tc=VMS-1200:
Xsultan|Software Tools:\
X	:pn=41701:tc=UNIX-1200:
Xcghub|demo room timesharing VAX:\
X	:pn=41023,41024:tc=VMS-300
Xphenix|phenix-300|Distributed systems:\
X	:pn=8=2472765,8=2472766,8=2472767,8=2472768:tc=VMS-300
Xmarket|arpanet:\
X	:pn=8=2317437,8=2317438,8=2317447,8=2317447,8=2317448,8=2317449,\
X	:8=2317450,8=2317451:tc=TOPS20-1200
Xmarket300|arpanet300:\
X	:pn=8=2311120,8=2311125,8=2311128:tc=TOPS20-300
Xtip0|tip1200:tc=UNIX-1200:
Xtip300:tc=UNIX-300:
Xcu0|cu300:tc=UNIX-300:
Xcu1200:tc=UNIX-1200:
XUNIX-300:\
X	:dv=/dev/cua0:el=^D^U^C^S^Q^O@:du:at=df02:ie=#$%:oe=^D:br#300:
XUNIX-1200:\
X	:dv=/dev/cua1,/dev/cua2,/dev/cua4:el=^D^U^C^S^Q^O@:du:at=df03:\
X	:ie=#$%:oe=^D:br#1200:
XVMS-300|TOPS20-300:\
X	:dv=/dev/cua0:el=^Z^U^C^S^Q^O:du:at=df02:ie=$@:oe=^Z:br#300:
XVMS-1200|TOPS20-1200:\
X	:dv=/dev/cua1,/dev/cua2,/dev/cua4:el=^Z^U^C^S^Q^O:du:at=df03:\
X	:ie=$@:oe=^Z:br#1200:
X
X
XThe following entries might be include to dial out to two SLIP
Xhosts:
X
Xhost1:\
X	:ls=/etc/slip/host1.login:\
X	:sa=193.100.1.1:sm=255.255.255.0:da=193.100.1.2:st=slip:rt:\
X	:pn=@:tc=UNIX-19200:
Xhost2:\
X	:ls=/etc/slip/host2.login:\
X	:sa=193.100.2.1:sm=255.255.255.0:da=193.100.2.2:st=slip:\
X	:pn=@:tc=UNIX-19200:
X
X
X--------------------------------------------------------------------
XThe attributes are:
X
Xdv	device to use for the tty
Xel	EOL marks (default is NULL)
Xdu	make a call flag (dial up)
Xpn	phone numbers (@ =>'s search phones file; possibly taken from
X			      PHONES environment variable)
Xat	ACU type
Xie	input EOF marks	(default is NULL)
Xoe	output EOF string (default is NULL)
Xcu	call unit (default is dv)
Xbr	baud rate (defaults to 300)
Xfs	frame size (default is BUFSIZ) -- used in buffering writes
X	  on receive operations
Xtc	to continue a capability
X
Xls	login script file
Xsa	local IP address
Xda	destination IP address
Xsm	IP netmask
Xsd	serial line protocol type
Xrt	set up a default route on this interface if none present
END_OF_FILE
if test 3585 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/remote-file'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/remote-file'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/remote-file'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/slip.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/slip.h'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/slip.h'\" \(1719 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/slip.h' <<'END_OF_FILE'
X/*
X * Header file for SunOS 4.0 streams SLIP module
X *
X * Copyright 1988 by Rayan Zachariassen
X *
X * You may do anything with this file except put your own
X * copyright on it or change or remove this copyright notice.
X */
X
X#ifndef	_sys_slip_h
X#define	_sys_slip_h
X
X/*
X * To compensate for lack of M_HANGUP on dialout lines, we use M_UNHANGUP
X * as symptom of a possible carrier change, and generate a signal whenever
X * an M_UNHANGUP passes by so the application can check for DCD.  This is
X * a workaround that should go away when M_HANGUP is generated on dialouts.
X */
X
X#include <sys/signal.h>
X
X/* signal to send application on stream device non-hangup DCD change */
X#define	SIGDCD		SIGUSR1
X
X
X#define	SLIPIFNAME	"slip"		/* base name of network interface */
X
X#define	SLIOGUNIT	_IOR(t, 62, int)		/* get SLIP unit no. */
X#define	SLIOGSTATS	_IOR(t, 63, struct slipstat)	/* get statistics */
X#define	SLIOSFLAGS	_IOW(t, 64, int)		/* set flags */
X
Xstruct slipstat {
X	u_int		sl_ibytes;	/* total number of data bytes in */
X	u_int		sl_ipackets;	/* total number of data packets in */
X	u_int		sl_ierrors;	/* total number of input errors */
X	u_int		sl_obytes;	/* total number of data bytes out */
X	u_int		sl_opackets;	/* total number of data packets out */
X	u_int		sl_oerrors;	/* total number of output errors */
X};
X
X/* end of what the user-level process should care about */
X
X/* See RFC1055 for the origin of the following magic numbers */
X
X#define SLIPMTU		1006	/* this is the IP-level MTU */
X
X#define	END	0300		/* a frame just finished */
X#define	ESC	0333		/* introduces an escape sequence */
X#define	ESC_END	0334		/* the data contained an END */
X#define	ESC_ESC	0335		/* the data contained an ESC */
X
X#endif	/* !_sys_slip_h */
END_OF_FILE
if test 1719 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/slip.h'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/slip.h'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/slip.h'
fi
if test -f 'pf-bootstrap-v1.1a/tipx-p1/uucplock.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/tipx-p1/uucplock.c'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/tipx-p1/uucplock.c'\" \(2518 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/tipx-p1/uucplock.c' <<'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
X#ifndef lint
Xstatic char sccsid[] = "@(#)uucplock.c	5.3 (Berkeley) 9/2/88";
X#endif /* not lint */
X
X#include <sys/types.h>
X#include <sys/file.h>
X#include <sys/dir.h>
X#include <errno.h>
X
X/* pick the directory naming scheme you are using */
X
X#define LOCKDIRNAME	"/usr/spool/uucp/LCK..%s"	/**/
X/* #define LOCKDIRNAME	"/usr/spool/uucp/LCK/LCK..%s"	/**/
X
X/* 
X * uucp style locking routines
X * return: 0 - success
X * 	  -1 - failure
X */
X
Xuu_lock(ttyname)
X	char *ttyname;
X{
X	extern int errno;
X	int fd, pid;
X	char tbuf[sizeof(LOCKDIRNAME) + MAXNAMLEN];
X	off_t lseek();
X
X	(void)sprintf(tbuf, LOCKDIRNAME, ttyname);
X	fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0660);
X#if 0
X	if (fd < 0) {
X		/*
X		 * file is already locked
X		 * check to see if the process holding the lock still exists
X		 */
X		fd = open(tbuf, O_RDWR, 0);
X		if (fd < 0) {
X			perror("lock open");
X			return(-1); 
X		}
X		if (read(fd, &pid, sizeof(pid)) != sizeof(pid)) {
X			(void)close(fd);
X			perror("lock read");
X			return(-1);
X		}
X
X		if (kill(pid, 0) == 0 || errno != ESRCH) {
X			(void)close(fd);	/* process is still running */
X			return(-1);
X		}
X		/*
X		 * The process that locked the file isn't running, so
X		 * we'll lock it ourselves
X		 */
X		if (lseek(fd, 0L, L_SET) < 0) {
X			(void)close(fd);
X			perror("lock lseek");
X			return(-1);
X		}
X		/* fall out and finish the locking process */
X	}
X	pid = getpid();
X	if (write(fd, (char *)&pid, sizeof(pid)) != sizeof(pid)) {
X		(void)close(fd);
X		(void)unlink(tbuf);
X		perror("lock write");
X		return(-1);
X	}
X#endif
X	(void)close(fd);
X	return(0);
X}
X
Xuu_unlock(ttyname)
X	char *ttyname;
X{
X	char tbuf[sizeof(LOCKDIRNAME) + MAXNAMLEN];
X
X	(void)sprintf(tbuf, LOCKDIRNAME, ttyname);
X	return(unlink(tbuf));
X}
END_OF_FILE
if test 2518 -ne `wc -c <'pf-bootstrap-v1.1a/tipx-p1/uucplock.c'`; then
    echo shar: \"'pf-bootstrap-v1.1a/tipx-p1/uucplock.c'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/tipx-p1/uucplock.c'
fi
if test ! -d 'pf-bootstrap-v1.1a/xmodem-3.9' ; then
    echo shar: Creating directory \"'pf-bootstrap-v1.1a/xmodem-3.9'\"
    mkdir 'pf-bootstrap-v1.1a/xmodem-3.9'
fi
if test -f 'pf-bootstrap-v1.1a/xmodem-3.9/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pf-bootstrap-v1.1a/xmodem-3.9/Makefile'\"
else
echo shar: Extracting \"'pf-bootstrap-v1.1a/xmodem-3.9/Makefile'\" \(935 characters\)
sed "s/^X//" >'pf-bootstrap-v1.1a/xmodem-3.9/Makefile' <<'END_OF_FILE'
XOBJECTS = xmodem.o getput.o misc.o send.o receive.o batch.o
XCFLAGS = -O
XCC= gcc -traditional
X
Xxmodem: $(OBJECTS)
X	cc $(CFLAGS) $(OBJECTS) -o xmodem
X
X$(OBJECTS): xmodem.h
X
Xprint: 
X	lpr -p -Pvmslp xmodem.h xmodem.c getput.c receive.c send.c batch.c \
X	misc.c Makefile update.doc README xmodem.1 getput.sysv.c
X
Xlint:
X	lint xmodem.c getput.c receive.c send.c batch.c misc.c | imprint
X
Xshar:
X	shar README Makefile xmodem.1 xmodem.h > xmodem.shar.1
X	shar update.doc xmodem.c receive.c > xmodem.shar.2
X	shar getput.c getput.sysv.c > xmodem.shar.3
X	shar misc.c batch.c send.c > xmodem.shar.4
X	shar ymodem.doc > xmodem.shar.5
X
Xbigshar: 
X	shar README update.doc Makefile xmodem.1 xmodem.h xmodem.c getput.c \
X	getput.sysv.c receive.c misc.c batch.c send.c > xmodem.shar
X
Xtarz: 
X	tar cvf xmodem.tar README update.doc Makefile xmodem.1 xmodem.h \
X	xmodem.c getput.c getput.sysv.c receive.c misc.c batch.c send.c \
X	ymodem.doc
X	compress xmodem.tar
END_OF_FILE
if test 935 -ne `wc -c <'pf-bootstrap-v1.1a/xmodem-3.9/Makefile'`; then
    echo shar: \"'pf-bootstrap-v1.1a/xmodem-3.9/Makefile'\" unpacked with wrong size!
fi
# end of 'pf-bootstrap-v1.1a/xmodem-3.9/Makefile'
fi
echo shar: End of archive 1 \(of 9\).
cp /dev/null ark1isdone
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
-- 
-----schnippel-----cut_here-----reiss-----beiss_ab-----hau_wech-----fetz-----