Readme instructions for installing PPP drivers on Sun OS (streams) systems.

These instructions and the accompanying software were developed on a
Sun386i running Sun OS 4.0.1, your mileage may vary.  They were then
ported to SunOS 4.0.3c and then SunOS 4.1 and 4.1.1 running on a
SPARCstation 1.

The 386i implementation was tested against the June 18, 1991  version of Phil
Karn's KA9Q Net program. You can obtain this package via anonymous ftp
from:
	ucsd.edu:/hamradio/packet/ka9q

In order to get PPP working in KA9Q, I  overlayed the Bill Simpson PPP
code (was-ppp.zip) on top of the KA9Q src0618.zip file mentioned
above.  It is also available via anonymous ftp from:
	merit.edu:/pub/ppp/was-ppp.zip

Note to Borland C++ 2.0 compiler users:  Add -DTURBOC_SWITCH_BUG in
the Makefile to the CFLAGS macro.  This is needed to get around a
nasty bug in the compiler.

Also note that this version uses a slightly outdated version of Van Jacobsons
TCP header compression module (slcompress.c), where sl_uncompress_tcp returns
an int instead of char *. If you are currently running SLIP
with VJ compression, check to be sure which version you have and arrange
to link to the appropriate version when installing this package.


* Things to do *
	1. Bring the UPAP and FSM implementations up to the newer
	   draft RFC standards.

	2. Add a type of service priority handler to outgoing packets.

	3. Add better statistics.

	4. Change main.c to really handle multiple interfaces.

	5. Add code to read a configuration file instead of using
	   command line options.

Manifest:  You should have received the following files.
   Files with ()'s after them should be copied to the indicated directory
   for installation.

	README	- Readme for 4.3 BSD systems
	Makefile
	Readme.streams - this file
	args.h
	callout.h
	chap.c
	chap.h
	fsm.c
	fsm.h
	if_ppp.c  - PPP driver for 4.3 BSD systems.
	if_ppp.h	- BSD and Streams file (/sys/sys)
	ipcp.c
	ipcp.h
	lcp.c
	lcp.h
	logwtmp.c
	magic.c
	magic.h
	main.c
	md5.c           - MD5 message digest algorithm used by CHAP
	md5.h
	md5driver.c	- a test program for the MD5 algorithm
	patchlevel.h
	pathnames.h
	ppp.8           - manual page
	ppp.h
	ppp_async.c	- Streams Async driver (/sys/os)
	ppp_if.c	- Streams PPP driver   (/sys/os)
	ppp_str.h	- Streams Include file (/sys/sys)
	slcompress.c	- VJ compression       (/sys/os)
	slcompress.h	- VJ include file      (/sys/os)
	slip_var.h	- Streams Stats file   (/sys/sys and /usr/include/sys)
	slstats.c	- Statistics program
	upap.c
	upap.h
	vax.diff	- Diff patches for 4.3BSD on vaxes.


Installation Instructions

	1. Copy the above indicated files to the directory shown in ().

	2. Edit the file /sys/conf.common/files.cmn -- Add the following
	   lines:

		os/slcompress.c         optional ppp
		os/ppp_if.c             optional ppp
		os/ppp_async.c          optional ppp

	3. Edit the file /sys/sun/str_conf.c -- Add the following lines at the
	   top of the file, where similar lines are located:

		#include "ppp.h"

		...

		#if     NPPP > 0
		extern struct streamtab ppp_asyncinfo;
		extern struct streamtab ppp_ifinfo;
		#endif
	
	4. In the same file, within the fmodsw structure, add the following
	   lines before the #ifdef VDDRV entry (or before the last entry if
	   you don't have VDDRV)


		#if     NPPP > 0
			{ "pppif",     &ppp_ifinfo },
			{ "pppasync",  &ppp_asyncinfo },
		#endif

	5. Edit the kernel configuration file for your system, add the
	   following line to the config file.
	
		pseudo-device	ppp5	init	ppp_attach

	    (You may replace '5' with the number of PPP devices you want,
	     also, if you do not want your ppp devices to be pre-attached, you
	     may leave out the 'init ppp_attach' portion of the line).

	6. You may need to edit /sys/net/if.h and /usr/include/net/if.h
	   Within the ifreq structure, add the following two lines, if not
	   already there.

		a. Within the ifr_ifru union, add
			int	ifru_mtu;

		b. After #define ifr_data, add
			#define	ifr_mtu		ifr_ifru.ifru_mtu /* MTU */

	7. Perform a config; make depend and make on your kernel to rebuild
	   as normal. Consult your system manual for more information on this
	   process.  Install the new kernel (save an old copy just in case)
	   and reboot.

	   Note:  If you don't have makedepend on your system, you can
	          get it from the X11R5 distribution, or via anonymous FTP
                  from: 
			aeneas.mit.edu:/pub/tools/makedepend.tar.Z

	8. Make the ppp program and slstats program using the supplied
	   Makefile.

	   If you are running SunOS 4.1 or later, you may need to fix
	   the system include file /usr/include/pixrect/pr_impl_util.h.
	   It tests for "_sys_types_h", but /usr/include/sys/types.h
	   defines the symbol "__sys_types_h" (note the extra
	   underscore) instead.  Change the test in pr_impl_util.h to
	   check for the correct symbol, or the setsid() code in ppp.c
	   won't get compiled correctly (thanks to Greg Earle
	   <earle@Sun.COM>, <earle@poseur.JPL.NASA.GOV> for this fix).

	9. Both programs need to be setuid root to run. 

Other info:

	Be sure to leave in the  PPP_STATS define (in ppp_if.c) and DEBUGS
	defines in both ppp_if.c and ppp_async.c to enable the use of 
	slstats and kernel debugging if you need it in the future.

	If you experience problems, you may wish to enable the streams debug
	statements in the kernel, you can do this using adb.

	% adb -w -k /vmunix /dev/mem

		ppp_if_debug
		/ D
		/ W 1
		ppp_async_debug
		/ D
		/ W 1
		^D

	Error messages and diagnostics will show up in /usr/adm/messages.

	You can also enable debugging of the incoming raw PPP frames that
	are passed from the ppp_async streams module to the ppp_if
        module.  Note that doing so will add quite a bit of 
        overhead to each incoming frame and can cause timeouts to
        occur in the higher level PPP functions.  Because of this,
        you should limit the number of bytes to be printed.  If a
        frame is received that is larger that the specified maximum,  a ">"
        character is appended in the log.  The maximum number of bytes
        per frame that will be logged can be set by changing the value
        of ppp_async_input_debug in the kernel.  A value of zero turns
        off the logging altogether. Do the following to enable this feature: 

	% adb -w -k /vmunix /dev/mem

		ppp_async_input_debug
		/ D
		/ W 80  (or however many bytes (in hex) you wish to dump)
		^D


	If you experience problems 'uploading' binary files from your PPP
	client through the PPP gateway, you may wish to alter the asyncmap
	of the gateway using the -as <hex map value> on the ppp command line.

Bugs to
	gmc@quotron.com

	Greg Christy
	716 9th St.
	Manhattan Beach, CA
	
Copyright Restrictions (applies to ppp_if.c, ppp_async.c and #ifdef STREAMS
changes in the ppp.c and related modules)

	This code is Copyright (C) 1989, 1990 By Brad K. Clements, 
	All Rights Reserved.

	You may use this code for your personal use, to provide a non-profit
	service to others, or to use as a test platform for a commercial
	implementation.

	You may NOT use this code in a commercial product, nor to provide a 
	commercial service, nor may you sell this code without express
	written permission of the author.

	Otherwise, Enjoy!

	
