]> git.ozlabs.org Git - ppp.git/commitdiff
updated for 2.3
authorPaul Mackerras <paulus@samba.org>
Thu, 22 May 1997 06:43:46 +0000 (06:43 +0000)
committerPaul Mackerras <paulus@samba.org>
Thu, 22 May 1997 06:43:46 +0000 (06:43 +0000)
README
README.bsd
README.cbcp
README.linux
SETUP

diff --git a/README b/README
index d5e8421a16caa7fb61df1efafcd6a35c7c5bbec4..5b67ae0e8912361ab2030933463a6aae3d9288ba 100644 (file)
--- a/README
+++ b/README
@@ -2,14 +2,6 @@ This is the README file for ppp-2.3, a package which implements the
 Point-to-Point Protocol (PPP) to provide Internet connections over
 serial lines.
 
-In this first beta release, the ports for SunOS, Solaris, NetBSD and
-Digital Unix (OSF/1) are believed to be working correctly.  The Linux
-port mostly works, but still has some known bugs (demand dialling
-doesn't work correctly).  The remaining ports haven't been tested
-extensively.  The NeXTStep port is not included here since it hasn't
-been updated from 2.2 yet.  For information on its current status, see
-http://www.thoughtport.com:8080/PPP/.
-
 
 Introduction.
 *************
@@ -73,7 +65,8 @@ What's new in ppp-2.3.
 * Demand-dialling.  Pppd now has a mode where it will establish the
 network interface immediately when it starts, but not actually bring
 the link up until it sees some data to be sent.  Look for the demand
-option description in the pppd man page.
+option description in the pppd man page.  Demand-dialling is not
+supported under Ultrix or NeXTStep.
 
 * Idle timeout.  Pppd will optionally terminate the link if no data
 packets are sent or received within a certain time interval.
@@ -140,29 +133,24 @@ removed from the Makefiles.
 Contacts.
 *********
 
-Bugs in the the SunOS, Solaris 2, NetBSD and Ultrix ports, and bugs in
-pppd, chat or pppstats should be reported me at:
-
-       email:  Paul.Mackerras@cs.anu.edu.au
-
-       mail:   Dr Paul Mackerras
-               Dept. of Computer Science
-               Australian National University
-               Canberra  ACT  0200
-               AUSTRALIA
-
-       fax:    +61-6-249-0010
-
-Bugs in other ports should be reported to the maintainer for that port
-(see the appropriate README.* file) or to me.
+The comp.protocols.ppp newsgroup is a useful place to get help if you
+have trouble getting your ppp connections to work.  Please do not send
+me questions of the form "please help me get connected to my ISP" -
+I'm sorry, but I simply do not have the time to answer all the
+questions like this that I get.
 
-Thanks to:
+If you find bugs in this package, please report them to the maintainer
+for the port for the operating system you are using:
 
-       Brad Parker  (brad@fcr.com)
-       Greg Christy (gmc@quotron.com)
-       Drew D. Perkins (ddp@andrew.cmu.edu)
-       Rick Adams (rick@seismo.ARPA)
-       Chris Torek (chris@mimsy.umd.edu, umcp-cs!chris).
+Digital Unix (OSF/1)   Farrell Woods <ftw@zk3.dec.com>
+Linux                  Al Longyear <longyear@pobox.com>
+NetBSD                 Matthew Green <mrg@eterna.com.au
+FreeBSD                        Peter Wemm <peter@haywire.DIALix.COM>
+NeXTStep               Steve Perkins <perkins@cps.msu.edu>
+Solaris 2              Paul Mackerras <Paul.Mackerras@cs.anu.edu.au>
+SunOS 4.x              Paul Mackerras <Paul.Mackerras@cs.anu.edu.au>
+System V Release 4     Matthias Apitz <Matthias.Apitz@SOFTCON.de>
+Ultrix 4.x             Paul Mackerras (for want of anybody better :-)
 
 
 Copyrights:
@@ -179,4 +167,4 @@ The primary site for releases of this software is:
        ftp://cs.anu.edu.au/pub/software/ppp/
 
 
-($Id: README,v 1.7 1996/08/28 06:30:32 paulus Exp $)
+($Id: README,v 1.8 1997/05/22 06:43:44 paulus Exp $)
index b5a961acecee85fbc1eb24fa5e78f55ae459b586..a909a4ff849cd48e655febfcfa7e8827d3120cdb 100644 (file)
@@ -1,10 +1,9 @@
 Installation instructions for installing ppp-2.3 on FreeBSD and
 NetBSD systems.
 
-This package supports NetBSD-current, NetBSD-1.1, NetBSD-1.0, and
-FreeBSD-2.0.  (The code hasn't been tested under NetBSD-current or
-FreeBSD at this stage.)  Modloading is not supported.  I have code
-which may work on earlier systems; contact me if you need it.
+This package supports NetBSD-current, NetBSD-1.2, NetBSD-1.1,
+FreeBSD-2.1, and FreeBSD-2.0.  Modloading is not supported.  I have
+code which may work on earlier systems; contact me if you need it.
 
 To install PPP, you need to rebuild your kernel to include the latest
 version of the PPP driver, as well as compiling and installing the
@@ -14,14 +13,14 @@ reboot with the new kernel (you'll have to reboot with the new kernel
 before you can run them, of course).
 
 The following commands should compile and install the user-level
-applications (in the ppp-2.3b1 directory):
+applications (in the ppp-2.3 directory):
 
        ./configure
        make
        make install            (you need to be root for this)
 
 The process of updating the kernel source files is now largely
-automated.  In the ppp-2.3b1 directory, issue the command:
+automated.  In the ppp-2.3 directory, issue the command:
 
        make kernel
 
@@ -81,35 +80,9 @@ or this (old-style):
 If you use config.old or config.new, you will need to edit
 /sys/conf/files.oldconf or /sys/conf/files.newconf respectively.
 
-For NetBSD-1.0, if you have not previously had ppp-2.2 installed, you
-will need to patch the file containing the code which dispatches
-software interrupts.  Unfortunately, this code is in the
-architecture-dependent files, so the file to patch depends on which
-NetBSD port you are using:
 
-Port   File to patch                      Patch file is netbsd-1.0/arch/
-----   -------------                      ------------------------------
-amiga  /sys/arch/amiga/amiga/machdep.c    amiga/machdep.c.patch
-hp300  /sys/arch/hp300/hp300/machdep.c    hp300/machdep.c.patch
-i386   /sys/arch/i386/isa/icu.s           i386/icu.s.patch
-mac68k /sys/arch/mac68k/mac68k/machdep.c  mac68k/machdep.c.patch
-pc532  /sys/arch/pc532/pc532/locore.s     pc532/locore.s.patch
-pmax   /sys/arch/pmax/pmax/trap.c         pmax/trap.c.patch
-sparc  /sys/arch/sparc/sparc/intr.c       sparc/intr.c.patch
-sun3   /sys/arch/sun3/sun3/isr.c          sun3/isr.c.patch
-
-To do the patch, you would use a command something like this:
-
-       patch -p -d /sys/arch/i386/isa <netbsd-1.0/arch/i386/icu.s.patch
-
-You also need to make sure that there is a line like this in
-/sys/net/netisr.h:
-
-#define        NETISR_PPP      26              /* for PPP processing */
-
-
-FreeBSD-2.0.
-============
+FreeBSD.
+========
 
 Copy the following files to /sys/net:
 
index 8521021d50118f8baa20329d080c69d431b23be0..6f7b7685e31c3652735abda641a95ae1bd84ae9c 100644 (file)
@@ -1,5 +1,6 @@
             Microsoft Call Back Configuration Protocol.
                        by Pedro Roque Marques
+                       (updated by Paul Mackerras)
 
 The CBCP is a method by which the Microsoft Windows NT Server may
 implement additional security. It is possible to configure the server
@@ -19,1497 +20,78 @@ in the developr/rfc directory.
 
 The ietf task group has decided to recommend that the LCP sequence be
 extended to permit the callback operation. For this reason, these
-patches are not 'part' of pppd but are an adjunct to the code. I
-hopefully have included enough of the context to permit the patch
-program so that minor changes to the program should not effect the
-patch by more than a few lines in the 'fuzz' factor.
+patches are not 'part' of pppd but are an adjunct to the code.
 
+To enable CBCP support, all that is required is to change the
+appropriate Makefile in the pppd subdirectory to add "-DCBCP_SUPPORT"
+to the CFLAGS definition and add cbcp.o to the list of object files,
+and then recompile pppd.  The patch below does this for Makefile.bsd
+and Makefile.linux.
 
 
-diff -r --unified=10 ppp-2.2a5.orig/linux/ppp_defs.h ppp-2.2a5/linux/ppp_defs.h
---- ppp-2.2a5.orig/linux/ppp_defs.h    Sat May 13 12:38:19 1995
-+++ ppp-2.2a5/linux/ppp_defs.h Sat May 13 13:46:36 1995
-@@ -56,20 +56,21 @@
- #define PPP_IP                0x21    /* Internet Protocol */
- #define       PPP_VJC_COMP    0x2d    /* VJ compressed TCP */
- #define       PPP_VJC_UNCOMP  0x2f    /* VJ uncompressed TCP */
- #define PPP_COMP      0xfd    /* compressed packet */
- #define PPP_IPCP      0x8021  /* IP Control Protocol */
- #define PPP_CCP               0x80fd  /* Compression Control Protocol */
- #define PPP_LCP               0xc021  /* Link Control Protocol */
- #define PPP_PAP               0xc023  /* Password Authentication Protocol */
- #define PPP_LQR               0xc025  /* Link Quality Report protocol */
- #define PPP_CHAP      0xc223  /* Cryptographic Handshake Auth. Protocol */
-+#define PPP_CBCP        0xc029  /* Callback Control Protocol */
- /*
-  * Values for FCS calculations.
-  */
- #define PPP_INITFCS   0xffff  /* Initial FCS value */
- #define PPP_GOODFCS   0xf0b8  /* Good final FCS value */
- #define PPP_FCS(fcs, c)       (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
- /*
-  * A 32-bit unsigned integral type.
-diff -r --unified=10 ppp-2.2a5.orig/net/ppp_defs.h ppp-2.2a5/net/ppp_defs.h
---- ppp-2.2a5.orig/net/ppp_defs.h      Sat May 13 12:38:19 1995
-+++ ppp-2.2a5/net/ppp_defs.h   Sat May 13 13:57:14 1995
-@@ -56,20 +56,21 @@
- #define PPP_IP                0x21    /* Internet Protocol */
- #define       PPP_VJC_COMP    0x2d    /* VJ compressed TCP */
- #define       PPP_VJC_UNCOMP  0x2f    /* VJ uncompressed TCP */
- #define PPP_COMP      0xfd    /* compressed packet */
- #define PPP_IPCP      0x8021  /* IP Control Protocol */
- #define PPP_CCP               0x80fd  /* Compression Control Protocol */
- #define PPP_LCP               0xc021  /* Link Control Protocol */
- #define PPP_PAP               0xc023  /* Password Authentication Protocol */
- #define PPP_LQR               0xc025  /* Link Quality Report protocol */
- #define PPP_CHAP      0xc223  /* Cryptographic Handshake Auth. Protocol */
-+#define PPP_CBCP        0xc029  /* Callback Control Protocol */
- /*
-  * Values for FCS calculations.
-  */
- #define PPP_INITFCS   0xffff  /* Initial FCS value */
- #define PPP_GOODFCS   0xf0b8  /* Good final FCS value */
- #define PPP_FCS(fcs, c)       (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
- /*
-  * A 32-bit unsigned integral type.
-diff -r --unified=10 ppp-2.2a5.orig/pppd/Makefile.aix4 ppp-2.2a5/pppd/Makefile.aix4
---- ppp-2.2a5.orig/pppd/Makefile.aix4  Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/Makefile.aix4       Sat May 13 14:09:17 1995
-@@ -3,26 +3,26 @@
- # $Id: README.cbcp,v 1.1 1997/04/30 05:37:27 paulus Exp $
- #
- #ifndef BINDIR
- BINDIR = /usr/sbin
- #endif
- #ifndef MANDIR
- MANDIR = /usr/man
- #ENDIF
- PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c \
--      auth.c options.c sys-bsd.c sys-str.c sys-aix4.c ccp.c
--HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h
-+      auth.c options.c sys-bsd.c sys-str.c sys-aix4.c ccp.c cbcp.c
-+HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h cbc.h
- MANPAGES = pppd.8
- PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o \
--      auth.o options.o sys-aix4.o ccp.o
-+      auth.o options.o sys-aix4.o ccp.o cbcp.o
- CC = xlc
- DEBUG_FLAGS = -DDEBUGALL
- # SECURE_FLAGS = -DREQ_SYSOPTIONS=1
- COMPILE_FLAGS = -DSTREAMS
- COPTS = -O
- LIBS= -bI:/lib/pse.exp
- LOCK_PREFIX=\"/var/locks/LCK..\"
- CFLAGS = -I.. $(COPTS) $(DEBUG_FLAGS) $(COMPILE_FLAGS) $(SECURE_FLAGS)
-diff -r --unified=10 ppp-2.2a5.orig/pppd/Makefile.bsd ppp-2.2a5/pppd/Makefile.bsd
---- ppp-2.2a5.orig/pppd/Makefile.bsd   Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/Makefile.bsd        Sat May 13 14:09:36 1995
-@@ -1,18 +1,18 @@
- #     $Id: README.cbcp,v 1.1 1997/04/30 05:37:27 paulus Exp $
- BINDIR?= /usr/sbin
- CFLAGS+= -I.. -DHAVE_PATHS_H
- PROG= pppd
- SRCS= main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
--      auth.c options.c sys-bsd.c
-+      auth.c options.c sys-bsd.c cbcp.c
- MAN8= pppd.0
- # The next line is for NetBSD-current systems.
- MAN=  pppd.cat8
- BINMODE=4555
- BINOWN=       root
- LDADD=        -lcrypt -lutil
- DPADD=        ${LIBCRYPT} ${LIBUTIL}
- .include <bsd.prog.mk>
-diff -r --unified=10 ppp-2.2a5.orig/pppd/Makefile.linux ppp-2.2a5/pppd/Makefile.linux
---- ppp-2.2a5.orig/pppd/Makefile.linux Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/Makefile.linux      Sat May 13 13:46:36 1995
-@@ -1,25 +1,25 @@
- #
- # pppd makefile for Linux
- # $Id: README.cbcp,v 1.1 1997/04/30 05:37:27 paulus Exp $
- #
- BINDIR = /usr/etc
- MANDIR = /usr/man
- PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
--      auth.c options.c sys-linux.c
--HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h
-+      auth.c options.c sys-linux.c cbcp.c
-+HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h cbcp.h
- MANPAGES = pppd.8
- PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
--      auth.o options.o sys-linux.o
-+      auth.o options.o sys-linux.o cbcp.o
- all: pppd
- #
- # include dependancies if present and backup if as a header file
- ifeq (.depend,$(wildcard .depend))
- include .depend
- HEADERS := $(HEADERS) .depend
- endif
-diff -r --unified=10 ppp-2.2a5.orig/pppd/Makefile.osf ppp-2.2a5/pppd/Makefile.osf
---- ppp-2.2a5.orig/pppd/Makefile.osf   Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/Makefile.osf        Sat May 13 14:09:54 1995
-@@ -1,26 +1,26 @@
- #
- # pppd makefile for OSF/1 on DEC Alpha
- # $Id: README.cbcp,v 1.1 1997/04/30 05:37:27 paulus Exp $
- #
- BINDIR = /usr/local/etc
- MANDIR = /usr/local/man
- PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
-       auth.c options.c sys-bsd.c sys-str.c sys-ultrix.c sys-linux.c \
--      sys-osf.c
--HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h
-+      sys-osf.c cbcp.c
-+HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h cbcp.h
- MANPAGES = pppd.8
- PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
--      auth.o options.o sys-osf.o
-+      auth.o options.o sys-osf.o cbcp.o
- CC = cc
- DEBUG_FLAGS = -DDEBUGALL
- COMPILE_FLAGS = -DSTREAMS -DGIDSET_TYPE=int
- COPTS = -O2
- LIBS = 
- CFLAGS = -I.. $(COPTS) $(COMPILE_FLAGS)
- SOURCE= RELNOTES Makefile \
-diff -r --unified=10 ppp-2.2a5.orig/pppd/Makefile.sol2 ppp-2.2a5/pppd/Makefile.sol2
---- ppp-2.2a5.orig/pppd/Makefile.sol2  Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/Makefile.sol2       Sat May 13 14:10:09 1995
-@@ -6,21 +6,21 @@
- BINDIR = /usr/local/etc
- MANDIR = /usr/local/man
- CC = gcc
- COPTS = -g -O2
- CFLAGS = $(COPTS) -I..
- INSTALL = /usr/sbin/install
- OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
--      auth.o options.o sys-sol2.o
-+      auth.o options.o sys-sol2.o cbcp.o
- pppd: $(OBJS)
-       $(CC) -o pppd $(OBJS) -lnsl
- install:
-       $(INSTALL) -f $(BINDIR) -m 4755 -u root pppd
-       $(INSTALL) -f $(MANDIR)/man8 pppd.8
- clean:
-       rm -f $(OBJS) pppd *~ core
-diff -r --unified=10 ppp-2.2a5.orig/pppd/Makefile.sun ppp-2.2a5/pppd/Makefile.sun
---- ppp-2.2a5.orig/pppd/Makefile.sun   Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/Makefile.sun        Sat May 13 14:10:27 1995
-@@ -2,26 +2,26 @@
- # pppd makefile for Suns
- # $Id: README.cbcp,v 1.1 1997/04/30 05:37:27 paulus Exp $
- #
- BINDIR = /usr/local/etc
- MANDIR = /usr/local/man
- INSTALL= install -o root -g daemon
- PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
--      auth.c options.c sys-bsd.c sys-str.c sys-ultrix.c sys-linux.c
--HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h
-+      auth.c options.c sys-bsd.c sys-str.c sys-ultrix.c sys-linux.c cbcp.c
-+HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h cbcp.h
- MANPAGES = pppd.8
- PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
--      auth.o options.o sys-str.o
-+      auth.o options.o sys-str.o cbcp.o
- # CC = gcc
- DEBUG_FLAGS =
- COMPILE_FLAGS =
- COPTS = -O
- LIBS = -lkvm
- CFLAGS = -I.. $(COPTS) $(DEBUG_FLAGS) $(COMPILE_FLAGS)
- SOURCE= RELNOTES Makefile \
-diff -r --unified=10 ppp-2.2a5.orig/pppd/Makefile.ultrix ppp-2.2a5/pppd/Makefile.ultrix
---- ppp-2.2a5.orig/pppd/Makefile.ultrix        Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/Makefile.ultrix     Sat May 13 14:10:44 1995
-@@ -1,25 +1,25 @@
- #
- # pppd makefile for Ultrix
- # $Id: README.cbcp,v 1.1 1997/04/30 05:37:27 paulus Exp $
- #
- BINDIR = /usr/local/etc
- MANDIR = /usr/local/man
- PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
--      auth.c options.c sys-bsd.c sys-str.c sys-ultrix.c sys-linux.c
--HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h
-+      auth.c options.c sys-bsd.c sys-str.c sys-ultrix.c sys-linux.c cbcp.c
-+HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h cbcp.h
- MANPAGES = pppd.8
- PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
--      auth.o options.o sys-ultrix.o
-+      auth.o options.o sys-ultrix.o cbcp.o
- # CC = gcc
- DEBUG_FLAGS =
- COMPILE_FLAGS = -DNO_DRAND48 -DGIDSET_TYPE=int
- COPTS = -O
- LIBS =
- CFLAGS = -I.. $(COPTS) $(DEBUG_FLAGS) $(COMPILE_FLAGS)
- SOURCE= RELNOTES Makefile \
-diff -r --unified=10 ppp-2.2a5.orig/pppd/auth.c ppp-2.2a5/pppd/auth.c
---- ppp-2.2a5.orig/pppd/auth.c Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/auth.c      Sat May 13 13:46:36 1995
-@@ -55,20 +55,21 @@
- #ifndef PW_PPP
- #define PW_PPP PW_LOGIN
- #endif
- #endif
- #include "pppd.h"
- #include "fsm.h"
- #include "lcp.h"
- #include "upap.h"
- #include "chap.h"
-+#include "cbcp.h"
- #include "ipcp.h"
- #include "ccp.h"
- #include "pathnames.h"
- #ifdef sparc
- #include <alloca.h>
- #endif /*sparc*/
- /* Used for storing a sequence of words.  Usually malloced. */
- struct wordlist {
-@@ -93,20 +94,21 @@
- /* Bits in auth_pending[] */
- #define UPAP_WITHPEER 1
- #define UPAP_PEER     2
- #define CHAP_WITHPEER 4
- #define CHAP_PEER     8
- /* Prototypes */
- void check_access __P((FILE *, char *));
- static void network_phase __P((int));
-+static void callback_phase __P((int));
- static int  login __P((char *, char *, char **, int *));
- static void logout __P((void));
- static int  null_login __P((int));
- static int  get_upap_passwd __P((void));
- static int  have_upap_secret __P((void));
- static int  have_chap_secret __P((char *, char *));
- static int  scan_authfile __P((FILE *, char *, char *, char *,
-                                 struct wordlist **, char *));
- static void free_wordlist __P((struct wordlist *));
-@@ -140,20 +142,21 @@
- /*
-  * LCP has gone down; it will either die or try to re-establish.
-  */
- void
- link_down(unit)
-     int unit;
- {
-     ipcp_close(0);
-     ccp_close(0);
-+    cbcp_close(0);
-     phase = PHASE_TERMINATE;
- }
- /*
-  * The link is established.
-  * Proceed to the Dead, Authenticate or Network phase as appropriate.
-  */
- void
- link_established(unit)
-     int unit;
-@@ -189,36 +192,53 @@
-     if (ho->neg_chap) {
-       ChapAuthWithPeer(unit, our_name, ho->chap_mdtype);
-       auth |= CHAP_WITHPEER;
-     } else if (ho->neg_upap) {
-       upap_authwithpeer(unit, user, passwd);
-       auth |= UPAP_WITHPEER;
-     }
-     auth_pending[unit] = auth;
-     if (!auth)
--      network_phase(unit);
-+      callback_phase(unit);
- }
- /*
-  * Proceed to the network phase.
-  */
- static void
- network_phase(unit)
-     int unit;
- {
-     phase = PHASE_NETWORK;
-     ipcp_open(unit);
-     ccp_open(unit);
- }
- /*
-+ * Proceed to the callback phase which may be empty.
-+ */
-+static void
-+callback_phase(unit)
-+     int unit;
-+{
-+    lcp_options *wo = &lcp_wantoptions[unit];
-+
-+    if (!wo->neg_cbcp)
-+        network_phase(unit);
-+    else {
-+        phase = PHASE_CALLBACK;
-+        cbcp_open(unit);
-+    }
-+}
-+
-+/*
-  * The peer has failed to authenticate himself using `protocol'.
-  */
- void
- auth_peer_fail(unit, protocol)
-     int unit, protocol;
- {
-     /*
-      * Authentication failure: take the link down
-      */
-     lcp_close(unit);
-@@ -242,27 +262,24 @@
-       bit = UPAP_PEER;
-       break;
-     default:
-       syslog(LOG_WARNING, "auth_peer_success: unknown protocol %x",
-              protocol);
-       return;
-     }
-     /*
-      * If there is no more authentication still to be done,
--     * proceed to the network phase.
-+     * go to the next phase.
-      */
--    if ((auth_pending[unit] &= ~bit) == 0) {
--      phase = PHASE_NETWORK;
--      ipcp_open(unit);
--      ccp_open(unit);
--    }
-+    if ((auth_pending[unit] &= ~bit) == 0)
-+      callback_phase(unit);
- }
- /*
-  * We have failed to authenticate ourselves to the peer using `protocol'.
-  */
- void
- auth_withpeer_fail(unit, protocol)
-     int unit, protocol;
- {
-     /*
-@@ -291,22 +308,23 @@
-     default:
-       syslog(LOG_WARNING, "auth_peer_success: unknown protocol %x",
-              protocol);
-       bit = 0;
-     }
-     /*
-      * If there is no more authentication still being done,
-      * proceed to the network phase.
-      */
-+
-     if ((auth_pending[unit] &= ~bit) == 0)
--      network_phase(unit);
-+      callback_phase(unit);
- }
- /*
-  * check_auth_options - called to check authentication options.
-  */
- void
- check_auth_options()
- {
-     lcp_options *wo = &lcp_wantoptions[0];
-@@ -335,21 +353,20 @@
-     if (ao->neg_chap && !have_chap_secret(our_name, remote_name))
-       ao->neg_chap = 0;
-     if (wo->neg_chap && !have_chap_secret(remote_name, our_name))
-       wo->neg_chap = 0;
-     if (auth_required && !wo->neg_chap && !wo->neg_upap) {
-       fprintf(stderr, "\
- pppd: peer authentication required but no authentication files accessible\n");
-       exit(1);
-     }
--
- }
- /*
-  * check_passwd - Check the user name and passwd against the PAP secrets
-  * file.  If requested, also check against the system password database,
-  * and login the user if OK.
-  *
-  * returns:
-  *    UPAP_AUTHNAK: Authentication failed.
-diff -r --unified=10 ppp-2.2a5.orig/pppd/cbcp.c ppp-2.2a5/pppd/cbcp.c
---- ppp-2.2a5.orig/pppd/cbcp.c Sat May 13 14:08:45 1995
-+++ ppp-2.2a5/pppd/cbcp.c      Sat May 13 14:15:12 1995
-@@ -0,0 +1,370 @@
-+/*
-+ * cbcp - Call Back Configuration Protocol.
-+ *
-+ * Copyright (c) 1995 Pedro Roque Marques
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms are permitted
-+ * provided that the above copyright notice and this paragraph are
-+ * duplicated in all such forms and that any documentation,
-+ * advertising materials, and other materials related to such
-+ * distribution and use acknowledge that the software was developed
-+ * by Pedro Roque Marques.  The name of the author may not be used to
-+ * endorse or promote products derived from this software without
-+ * specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+#ifndef lint
-+static char rcsid[] = "$Id: README.cbcp,v 1.1 1997/04/30 05:37:27 paulus Exp $";
-+#endif
-+
-+#include <stdio.h>
-+#include <string.h>
-+#include <sys/types.h>
-+#include <sys/time.h>
-+#include <syslog.h>
-+
-+#include "pppd.h"
-+#include "cbcp.h"
-+#include "fsm.h"
-+#include "lcp.h"
-+#include "ipcp.h"
-+
-+cbcp_state cbcp[NUM_PPP];     
-+
-+/* internal prototypes */
-+
-+void cbcp_recvreq(cbcp_state *us, char *pckt, int len);
-+void cbcp_resp(cbcp_state *us);
-+void cbcp_up(cbcp_state *us);
-+void cbcp_recvack(cbcp_state *us, char *pckt, int len);
-+void cbcp_send(cbcp_state *us, u_char code, u_char *buf, int len);
-+
-+/* init state */
-+void cbcp_init(int iface)
-+{
-+    cbcp_state *us;
-+
-+    us = &cbcp[iface];
-+    memset(us, 0, sizeof(cbcp_state));
-+    us->us_unit = iface;
-+    us->us_type |= (1 << CB_CONF_NO);
-+}
-+
-+/* lower layer is up */
-+void cbcp_lowerup(int iface)
-+{
-+    cbcp_state *us = &cbcp[iface];
-+
-+    syslog(LOG_DEBUG, "cbcp_lowerup");
-+    syslog(LOG_DEBUG, "want: %d", us->us_type);
-+
-+    if (us->us_type == CB_CONF_USER)
-+        syslog(LOG_DEBUG, "phone no: %s", us->us_number);
-+}
-+
-+void cbcp_open(int unit)
-+{
-+    syslog(LOG_DEBUG, "cbcp_open");
-+}
-+
-+void cbcp_close(int unit)
-+{
-+}
-+
-+/* process an incomming packet */
-+void cbcp_input(int unit, u_char *inpacket, int pktlen)
-+{
-+    u_char *inp;
-+    u_char code, id;
-+    u_short len;
-+
-+    cbcp_state *us = &cbcp[unit];
-+
-+    inp = inpacket;
-+
-+    if (pktlen < CBCP_MINLEN) {
-+        syslog(LOG_ERR, "CBCP packet is too small");
-+      return;
-+    }
-+
-+    GETCHAR(code, inp);
-+    GETCHAR(id, inp);
-+    GETSHORT(len, inp);
-+
-+#if 0
-+    if (len > pktlen) {
-+        syslog(LOG_ERR, "CBCP packet: invalid length");
-+        return;
-+    }
-+#endif
-+
-+    len -= CBCP_MINLEN;
-+ 
-+    switch(code) {
-+    case CBCP_REQ:
-+        us->us_id = id;
-+      cbcp_recvreq(us, inp, len);
-+      break;
-+
-+    case CBCP_RESP:
-+      syslog(LOG_DEBUG, "CBCP_RESP received");
-+      break;
-+
-+    case CBCP_ACK:
-+      if (id != us->us_id)
-+          syslog(LOG_DEBUG, "id doesn't match: expected %d recv %d",
-+                 us->us_id, id);
-+
-+      cbcp_recvack(us, inp, len);
-+      break;
-+
-+    default:
-+      break;
-+    }
-+}
-+
-+/* protocol was rejected by foe */
-+void cbcp_protrej(int iface)
-+{
-+}
-+
-+char *cbcp_codenames[] = {"Request", "Response", "Ack"};
-+
-+char *cbcp_optionnames[] = {  "NoCallback",
-+                            "UserDefined",
-+                            "AdminDefined",
-+                            "List"};
-+/* pretty print a packet */
-+int cbcp_printpkt(u_char *p, int plen,
-+                 void (*printer) __P((void *, char *, ...)),
-+                 void *arg)
-+{
-+    int code, opt, id, len, olen, delay;
-+    u_char *pstart, *optend;
-+    u_short cishort;
-+    u_long cilong;
-+
-+    if (plen < HEADERLEN)
-+      return 0;
-+    pstart = p;
-+    GETCHAR(code, p);
-+    GETCHAR(id, p);
-+    GETSHORT(len, p);
-+    if (len < HEADERLEN || len > plen)
-+      return 0;
-+
-+    if (code >= 1 && code <= sizeof(cbcp_codenames) / sizeof(char *))
-+      printer(arg, " %s", cbcp_codenames[code-1]);
-+    else
-+      printer(arg, " code=0x%x", code); 
-+
-+    printer(arg, " id=0x%x", id);
-+    len -= HEADERLEN;
-+
-+    switch (code) {
-+    case CBCP_REQ:
-+    case CBCP_RESP:
-+    case CBCP_ACK:
-+        while(len >= 2) {
-+          GETCHAR(opt, p);
-+          GETCHAR(olen, p);
-+
-+          if (olen < 2 || olen > len) {
-+              break;
-+          }
-+
-+          printer(arg, " <");
-+          len -= olen;
-+
-+          if (opt >= 1 && opt <= sizeof(cbcp_optionnames) / sizeof(char *))
-+              printer(arg, " %s", cbcp_optionnames[opt-1]);
-+          else
-+              printer(arg, " option=0x%x", opt); 
-+
-+          if (olen > 2) {
-+              GETCHAR(delay, p);
-+              printer(arg, " delay = %d", delay);
-+          }
-+
-+          if (olen > 3) {
-+              int addrt;
-+              char str[256];
-+
-+              GETCHAR(addrt, p);
-+              memcpy(str, p, olen - 4);
-+              str[olen - 4] = 0;
-+              printer(arg, " number = %s", str);
-+          }
-+          printer(arg, ">");
-+      break;
-+      }
-+
-+      default:
-+      break;
-+    }
-+
-+    for (; len > 0; --len) {
-+      GETCHAR(code, p);
-+      printer(arg, " %.2x", code);
-+    }
-+
-+    return p - pstart;
-+}
-+
-+/* received CBCP request */
-+
-+void cbcp_recvreq(cbcp_state *us, char *pckt, int pcktlen)
-+{
-+    u_char type, opt_len, delay, addr_type;
-+    char address[256];
-+    int len = pcktlen;
-+
-+    address[0] = 0;
-+
-+    while (len) {
-+        syslog(LOG_DEBUG, "length: %d", len);
-+
-+      GETCHAR(type, pckt);
-+      GETCHAR(opt_len, pckt);
-+
-+      if (opt_len > 2)
-+          GETCHAR(delay, pckt);
-+
-+      us->us_allowed |= (1 << type);
-+
-+      switch(type) {
-+      case CB_CONF_NO:
-+          syslog(LOG_DEBUG, "no callback allowed");
-+          break;
-+
-+      case CB_CONF_USER:
-+          syslog(LOG_DEBUG, "user callback allowed");
-+          if (opt_len > 4) {
-+              GETCHAR(addr_type, pckt);
-+              memcpy(address, pckt, opt_len - 4);
-+              address[opt_len - 4] = 0;
-+              if (address[0])
-+                  syslog(LOG_DEBUG, "address: %s", address);
-+          }
-+      break;
-+
-+      case CB_CONF_ADMIN:
-+          syslog(LOG_DEBUG, "user admin defined allowed");
-+          break;
-+
-+      case CB_CONF_LIST:
-+          break;
-+      }
-+      len -= opt_len;
-+    }
-+
-+  cbcp_resp(us);
-+}
-+
-+void cbcp_resp(cbcp_state *us)
-+{
-+    u_char cb_type;
-+    u_char buf[256];
-+    u_char *bufp = buf;
-+    int len = 0;
-+
-+    cb_type = us->us_allowed & us->us_type;
-+    syslog(LOG_DEBUG, "cbcp_resp cb_type=%d", cb_type);
-+
-+#if 0
-+    if (!cb_type)
-+        lcp_down(us->us_unit);
-+#endif
-+
-+    if (cb_type & ( 1 << CB_CONF_USER ) ) {
-+      syslog(LOG_DEBUG, "cbcp_resp CONF_USER");
-+      PUTCHAR(CB_CONF_USER, bufp);
-+      len = 3 + 1 + strlen(us->us_number) + 1;
-+      PUTCHAR(len , bufp);
-+      PUTCHAR(5, bufp); /* delay */
-+      PUTCHAR(1, bufp);
-+      BCOPY(us->us_number, bufp, strlen(us->us_number) + 1);
-+      cbcp_send(us, CBCP_RESP, buf, len);
-+      return;
-+    }
-+
-+    if (cb_type & ( 1 << CB_CONF_ADMIN ) ) {
-+        PUTCHAR(CB_CONF_ADMIN, bufp);
-+      len = 3;
-+      PUTCHAR(len , bufp);
-+      PUTCHAR(0, bufp);
-+      cbcp_send(us, CBCP_RESP, buf, len);
-+      return;
-+    }
-+
-+    if (cb_type & ( 1 << CB_CONF_NO ) ) {
-+        syslog(LOG_DEBUG, "cbcp_resp CONF_NO");
-+      PUTCHAR(CB_CONF_NO, bufp);
-+      len = 3;
-+      PUTCHAR(len , bufp);
-+      PUTCHAR(0, bufp);
-+      cbcp_send(us, CBCP_RESP, buf, len);
-+      ipcp_open(us->us_unit);
-+      return;
-+    }
-+}
-+
-+void cbcp_send(cbcp_state *us, u_char code, u_char *buf, int len)
-+{
-+    u_char *outp;
-+    int outlen;
-+
-+    outp = outpacket_buf;
-+
-+    outlen = 4 + len;
-+    
-+    MAKEHEADER(outp, PPP_CBCP);
-+
-+    PUTCHAR(code, outp);
-+    PUTCHAR(us->us_id, outp);
-+    PUTSHORT(outlen, outp);
-+    
-+    if (len)
-+        BCOPY(buf, outp, len);
-+
-+    output(us->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
-+}
-+
-+void cbcp_recvack(cbcp_state *us, char *pckt, int len)
-+{
-+    u_char type, delay, addr_type;
-+    int opt_len;
-+    char address[256];
-+
-+    if (len) {
-+        GETCHAR(type, pckt);
-+      GETCHAR(opt_len, pckt);
-+     
-+      if (opt_len > 2)
-+          GETCHAR(delay, pckt);
-+
-+      if (opt_len > 4) {
-+          GETCHAR(addr_type, pckt);
-+          memcpy(address, pckt, opt_len - 4);
-+          address[opt_len - 4] = 0;
-+          if (address[0])
-+              syslog(LOG_DEBUG, "peer will call: %s", address);
-+      }
-+    }
-+
-+    cbcp_up(us);
-+}
-+
-+extern int persist;
-+
-+/* ok peer will do callback */
-+void cbcp_up(cbcp_state *us)
-+{
-+    persist = 0;
-+    lcp_close(0);
-+}
-diff -r --unified=10 ppp-2.2a5.orig/pppd/cbcp.h ppp-2.2a5/pppd/cbcp.h
---- ppp-2.2a5.orig/pppd/cbcp.h Sat May 13 14:08:40 1995
-+++ ppp-2.2a5/pppd/cbcp.h      Sat May 13 13:56:20 1995
-@@ -0,0 +1,33 @@
-+#ifndef CBCP_H
-+#define CBCP_H
-+
-+typedef struct cbcp_state {
-+    int    us_unit;   /* Interface unit number */
-+    u_char us_id;             /* Current id */
-+    u_char us_allowed;
-+    int    us_type;
-+    char   *us_number;    /* Telefone Number */
-+} cbcp_state;
-+
-+void cbcp_init      __P((int));
-+void cbcp_open      __P((int));
-+void cbcp_lowerup   __P((int));
-+void cbcp_input     __P((int, u_char *, int));
-+void cbcp_protrej   __P((int));
-+int  cbcp_printpkt  __P((u_char *, int,
-+                          void (*) __P((void *, char *, ...)),
-+                          void *));
-+
-+extern cbcp_state cbcp[];
-+
-+#define CBCP_MINLEN 4
-+
-+#define CBCP_REQ    1
-+#define CBCP_RESP   2
-+#define CBCP_ACK    3
-+
-+#define CB_CONF_NO     1
-+#define CB_CONF_USER   2
-+#define CB_CONF_ADMIN  3
-+#define CB_CONF_LIST   4
-+#endif
-diff -r --unified=10 ppp-2.2a5.orig/pppd/lcp.c ppp-2.2a5/pppd/lcp.c
---- ppp-2.2a5.orig/pppd/lcp.c  Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/lcp.c       Sat May 13 13:46:36 1995
-@@ -112,24 +112,26 @@
-     lcp_extcode,              /* Called to handle LCP-specific codes */
-     "LCP"                     /* String name of protocol */
- };
- int lcp_warnloops = DEFWARNLOOPS; /* Warn about a loopback this often */
- /*
-  * Length of each type of configuration option (in octets)
-  */
- #define CILEN_VOID    2
-+#define CILEN_CHAR      3
- #define CILEN_SHORT   4       /* CILEN_VOID + sizeof(short) */
- #define CILEN_CHAP    5       /* CILEN_VOID + sizeof(short) + 1 */
- #define CILEN_LONG    6       /* CILEN_VOID + sizeof(long) */
- #define CILEN_LQR     8       /* CILEN_VOID + sizeof(short) + sizeof(long) */
-+#define CILEN_CBCP      3
- #define CODENAME(x)   ((x) == CONFACK ? "ACK" : \
-                        (x) == CONFNAK ? "NAK" : "REJ")
- /*
-  * lcp_init - Initialize LCP.
-  */
- void
- lcp_init(unit)
-@@ -153,32 +155,34 @@
-     wo->mru = DEFMRU;
-     wo->neg_asyncmap = 0;
-     wo->asyncmap = 0;
-     wo->neg_chap = 0;                 /* Set to 1 on server */
-     wo->neg_upap = 0;                 /* Set to 1 on server */
-     wo->chap_mdtype = CHAP_DIGEST_MD5;
-     wo->neg_magicnumber = 1;
-     wo->neg_pcompression = 1;
-     wo->neg_accompression = 1;
-     wo->neg_lqr = 0;                  /* no LQR implementation yet */
-+    wo->neg_cbcp = 0;
-     ao->neg_mru = 1;
-     ao->mru = MAXMRU;
-     ao->neg_asyncmap = 1;
-     ao->asyncmap = 0;
-     ao->neg_chap = 1;
-     ao->chap_mdtype = CHAP_DIGEST_MD5;
-     ao->neg_upap = 1;
-     ao->neg_magicnumber = 1;
-     ao->neg_pcompression = 1;
-     ao->neg_accompression = 1;
-     ao->neg_lqr = 0;                  /* no LQR implementation yet */
-+    ao->neg_cbcp = 1;
-     memset(xmit_accm[unit], 0, sizeof(xmit_accm[0]));
-     xmit_accm[unit][3] = 0x60000000;
- }
- /*
-  * lcp_open - LCP is allowed to come up.
-  */
- void
-@@ -478,29 +482,31 @@
- lcp_cilen(f)
-     fsm *f;
- {
-     lcp_options *go = &lcp_gotoptions[f->unit];
- #define LENCIVOID(neg)        (neg ? CILEN_VOID : 0)
- #define LENCICHAP(neg)        (neg ? CILEN_CHAP : 0)
- #define LENCISHORT(neg)       (neg ? CILEN_SHORT : 0)
- #define LENCILONG(neg)        (neg ? CILEN_LONG : 0)
- #define LENCILQR(neg) (neg ? CILEN_LQR: 0)
-+#define LENCICBCP(neg)        (neg ? CILEN_CBCP: 0)
-     /*
-      * NB: we only ask for one of CHAP and UPAP, even if we will
-      * accept either.
-      */
-     return (LENCISHORT(go->neg_mru) +
-           LENCILONG(go->neg_asyncmap) +
-           LENCICHAP(go->neg_chap) +
-           LENCISHORT(!go->neg_chap && go->neg_upap) +
-           LENCILQR(go->neg_lqr) +
-+          LENCICBCP(go->neg_cbcp) +
-           LENCILONG(go->neg_magicnumber) +
-           LENCIVOID(go->neg_pcompression) +
-           LENCIVOID(go->neg_accompression));
- }
- /*
-  * lcp_addci - Add our desired CIs to a packet.
-  */
- static void
-@@ -537,25 +543,33 @@
-       PUTLONG(val, ucp); \
-     }
- #define ADDCILQR(opt, neg, val) \
-     if (neg) { \
-       PUTCHAR(opt, ucp); \
-       PUTCHAR(CILEN_LQR, ucp); \
-       PUTSHORT(PPP_LQR, ucp); \
-       PUTLONG(val, ucp); \
-     }
-+#define ADDCICHAR(opt, neg, val) \
-+    if (neg) { \
-+      PUTCHAR(opt, ucp); \
-+      PUTCHAR(CILEN_CHAR, ucp); \
-+      PUTCHAR(val, ucp); \
-+    }
-+
-     ADDCISHORT(CI_MRU, go->neg_mru, go->mru);
-     ADDCILONG(CI_ASYNCMAP, go->neg_asyncmap, go->asyncmap);
-     ADDCICHAP(CI_AUTHTYPE, go->neg_chap, PPP_CHAP, go->chap_mdtype);
-     ADDCISHORT(CI_AUTHTYPE, !go->neg_chap && go->neg_upap, PPP_PAP);
-     ADDCILQR(CI_QUALITY, go->neg_lqr, go->lqr_period);
-+    ADDCICHAR(CI_CALLBACK, go->neg_cbcp, CBCP_OPT);
-     ADDCILONG(CI_MAGICNUMBER, go->neg_magicnumber, go->magicnumber);
-     ADDCIVOID(CI_PCOMPRESSION, go->neg_pcompression);
-     ADDCIVOID(CI_ACCOMPRESSION, go->neg_accompression);
-     if (ucp - start_ucp != *lenp) {
-       /* this should never happen, because peer_mtu should be 1500 */
-       syslog(LOG_ERR, "Bug in lcp_addci: wrong length");
-     }
- }
-@@ -600,20 +614,33 @@
-           goto bad; \
-       GETCHAR(citype, p); \
-       GETCHAR(cilen, p); \
-       if (cilen != CILEN_SHORT || \
-           citype != opt) \
-           goto bad; \
-       GETSHORT(cishort, p); \
-       if (cishort != val) \
-           goto bad; \
-     }
-+#define ACKCICHAR(opt, neg, val) \
-+    if (neg) { \
-+      if ((len -= CILEN_CHAR) < 0) \
-+          goto bad; \
-+      GETCHAR(citype, p); \
-+      GETCHAR(cilen, p); \
-+      if (cilen != CILEN_CHAR || \
-+          citype != opt) \
-+          goto bad; \
-+      GETCHAR(cichar, p); \
-+      if (cichar != val) \
-+          goto bad; \
-+    }
- #define ACKCICHAP(opt, neg, val, digest) \
-     if (neg) { \
-       if ((len -= CILEN_CHAP) < 0) \
-           goto bad; \
-       GETCHAR(citype, p); \
-       GETCHAR(cilen, p); \
-       if (cilen != CILEN_CHAP || \
-           citype != opt) \
-           goto bad; \
-       GETSHORT(cishort, p); \
-@@ -651,20 +678,21 @@
-       GETLONG(cilong, p); \
-       if (cilong != val) \
-         goto bad; \
-     }
-     ACKCISHORT(CI_MRU, go->neg_mru, go->mru);
-     ACKCILONG(CI_ASYNCMAP, go->neg_asyncmap, go->asyncmap);
-     ACKCICHAP(CI_AUTHTYPE, go->neg_chap, PPP_CHAP, go->chap_mdtype);
-     ACKCISHORT(CI_AUTHTYPE, !go->neg_chap && go->neg_upap, PPP_PAP);
-     ACKCILQR(CI_QUALITY, go->neg_lqr, go->lqr_period);
-+    ACKCICHAR(CI_CALLBACK, go->neg_cbcp, CBCP_OPT);
-     ACKCILONG(CI_MAGICNUMBER, go->neg_magicnumber, go->magicnumber);
-     ACKCIVOID(CI_PCOMPRESSION, go->neg_pcompression);
-     ACKCIVOID(CI_ACCOMPRESSION, go->neg_accompression);
-     /*
-      * If there are any remaining CIs, then this packet is bad.
-      */
-     if (len != 0)
-       goto bad;
-     return (1);
-@@ -722,20 +750,31 @@
-       len >= CILEN_CHAP && \
-       p[1] == CILEN_CHAP && \
-       p[0] == opt) { \
-       len -= CILEN_CHAP; \
-       INCPTR(2, p); \
-       GETSHORT(cishort, p); \
-       GETCHAR(cichar, p); \
-       no.neg = 1; \
-       code \
-     }
-+#define NAKCICHAR(opt, neg, code) \
-+    if (go->neg && \
-+      len >= CILEN_CHAR && \
-+      p[1] == CILEN_CHAR && \
-+      p[0] == opt) { \
-+      len -= CILEN_CHAR; \
-+      INCPTR(2, p); \
-+      GETCHAR(cichar, p); \
-+      no.neg = 1; \
-+      code \
-+    }
- #define NAKCISHORT(opt, neg, code) \
-     if (go->neg && \
-       len >= CILEN_SHORT && \
-       p[1] == CILEN_SHORT && \
-       p[0] == opt) { \
-       len -= CILEN_SHORT; \
-       INCPTR(2, p); \
-       GETSHORT(cishort, p); \
-       no.neg = 1; \
-       code \
-@@ -851,20 +890,27 @@
-      * If they Nak the reporting period, take their value XXX ?
-      */
-     NAKCILQR(CI_QUALITY, neg_lqr,
-            if (cishort != PPP_LQR)
-                try.neg_lqr = 0;
-            else
-                try.lqr_period = cilong;
-            );
-     /*
-+     * Only implementing CBCP... not the rest of the callback options
-+     */
-+    NAKCICHAR(CI_CALLBACK, neg_cbcp,
-+            try.neg_cbcp = 0;
-+            );
-+
-+    /*
-      * Check for a looped-back line.
-      */
-     NAKCILONG(CI_MAGICNUMBER, neg_magicnumber,
-             try.magicnumber = magic();
-             ++try.numloops;
-             looped_back = 1;
-             );
-     NAKCIVOID(CI_PCOMPRESSION, neg_pcompression,
-             try.neg_pcompression = 0;
-@@ -1045,28 +1091,43 @@
-       len -= CILEN_LQR; \
-       INCPTR(2, p); \
-       GETSHORT(cishort, p); \
-       GETLONG(cilong, p); \
-       /* Check rejected value. */ \
-       if (cishort != PPP_LQR || cilong != val) \
-           goto bad; \
-       try.neg = 0; \
-       LCPDEBUG((LOG_INFO,"lcp_rejci rejected LQR opt %d", opt)); \
-     }
-+#define REJCICBCP(opt, neg, val) \
-+    if (go->neg && \
-+      len >= CILEN_CBCP && \
-+      p[1] == CILEN_CBCP && \
-+      p[0] == opt) { \
-+      len -= CILEN_CBCP; \
-+      INCPTR(2, p); \
-+      GETCHAR(cichar, p); \
-+      /* Check rejected value. */ \
-+      if (cichar != val) \
-+          goto bad; \
-+      try.neg = 0; \
-+      LCPDEBUG((LOG_INFO,"lcp_rejci rejected Callback opt %d", opt)); \
-+    }
-     REJCISHORT(CI_MRU, neg_mru, go->mru);
-     REJCILONG(CI_ASYNCMAP, neg_asyncmap, go->asyncmap);
-     REJCICHAP(CI_AUTHTYPE, neg_chap, PPP_CHAP, go->chap_mdtype);
-     if (!go->neg_chap) {
-       REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP);
-     }
-     REJCILQR(CI_QUALITY, neg_lqr, go->lqr_period);
-+    REJCICBCP(CI_CALLBACK, neg_cbcp, CBCP_OPT);
-     REJCILONG(CI_MAGICNUMBER, neg_magicnumber, go->magicnumber);
-     REJCIVOID(CI_PCOMPRESSION, neg_pcompression);
-     REJCIVOID(CI_ACCOMPRESSION, neg_accompression);
-     /*
-      * If there are any remaining CIs, then this packet is bad.
-      */
-     if (len != 0)
-       goto bad;
-     /*
-@@ -1447,20 +1508,21 @@
-      */
-     ppp_recv_config(f->unit, (go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU),
-                   (go->neg_asyncmap? go->asyncmap: 0x00000000),
-                   go->neg_pcompression, go->neg_accompression);
-     if (ho->neg_mru)
-       peer_mru[f->unit] = ho->mru;
-     ChapLowerUp(f->unit);     /* Enable CHAP */
-     upap_lowerup(f->unit);    /* Enable UPAP */
-+    cbcp_lowerup(f->unit);      /* Enable CBCP */
-     ipcp_lowerup(f->unit);    /* Enable IPCP */
-     ccp_lowerup(f->unit);     /* Enable CCP */
-     lcp_echo_lowerup(f->unit);  /* Enable echo messages */
-     link_established(f->unit);
- }
- /*
-  * lcp_down - LCP has gone DOWN.
-@@ -1593,20 +1655,34 @@
-               }
-               break;
-           case CI_QUALITY:
-               if (olen >= CILEN_SHORT) {
-                   p += 2;
-                   printer(arg, "quality ");
-                   GETSHORT(cishort, p);
-                   switch (cishort) {
-                   case PPP_LQR:
-                       printer(arg, "lqr");
-+                      break;
-+                  default:
-+                      printer(arg, "0x%x", cishort);
-+                  }
-+              }
-+              break;
-+          case CI_CALLBACK:
-+              if (olen >= CILEN_CHAR) {
-+                  p += 2;
-+                  printer(arg, "callback ");
-+                  GETSHORT(cishort, p);
-+                  switch (cishort) {
-+                  case CBCP_OPT:
-+                      printer(arg, "CBCP");
-                       break;
-                   default:
-                       printer(arg, "0x%x", cishort);
-                   }
-               }
-               break;
-           case CI_MAGICNUMBER:
-               if (olen == CILEN_LONG) {
-                   p += 2;
-                   GETLONG(cilong, p);
-diff -r --unified=10 ppp-2.2a5.orig/pppd/lcp.h ppp-2.2a5/pppd/lcp.h
---- ppp-2.2a5.orig/pppd/lcp.h  Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/lcp.h       Sat May 13 13:46:36 1995
-@@ -22,44 +22,47 @@
- /*
-  * Options.
-  */
- #define CI_MRU                1       /* Maximum Receive Unit */
- #define CI_ASYNCMAP   2       /* Async Control Character Map */
- #define CI_AUTHTYPE   3       /* Authentication Type */
- #define CI_QUALITY    4       /* Quality Protocol */
- #define CI_MAGICNUMBER        5       /* Magic Number */
- #define CI_PCOMPRESSION       7       /* Protocol Field Compression */
- #define CI_ACCOMPRESSION 8    /* Address/Control Field Compression */
-+#define CI_CALLBACK      13     /* callback */
- /*
-  * LCP-specific packet types.
-  */
- #define PROTREJ               8       /* Protocol Reject */
- #define ECHOREQ               9       /* Echo Request */
- #define ECHOREP               10      /* Echo Reply */
- #define DISCREQ               11      /* Discard Request */
-+#define CBCP_OPT        6       /* Use callback control protocol */
- /*
-  * The state of options is described by an lcp_options structure.
-  */
- typedef struct lcp_options {
-     int passive : 1;          /* Don't die if we don't get a response */
-     int silent : 1;           /* Wait for the other end to start first */
-     int restart : 1;          /* Restart vs. exit after close */
-     int neg_mru : 1;          /* Negotiate the MRU? */
-     int neg_asyncmap : 1;     /* Negotiate the async map? */
-     int neg_upap : 1;         /* Ask for UPAP authentication? */
-     int neg_chap : 1;         /* Ask for CHAP authentication? */
-     int neg_magicnumber : 1;  /* Ask for magic number? */
-     int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
-     int neg_accompression : 1;        /* HDLC Address/Control Field Compression? */
-     int neg_lqr : 1;          /* Negotiate use of Link Quality Reports */
-+    int neg_cbcp : 1;           /* Negotiate use of CBCP */
-     u_short mru;              /* Value of MRU */
-     u_char chap_mdtype;               /* which MD type (hashing algorithm) */
-     u_int32_t asyncmap;               /* Value of async map */
-     u_int32_t magicnumber;
-     int numloops;             /* Number of loops during magic number neg. */
-     u_int32_t lqr_period;     /* Reporting period for link quality */
- } lcp_options;
- extern fsm lcp_fsm[];
- extern lcp_options lcp_wantoptions[];
-diff -r --unified=10 ppp-2.2a5.orig/pppd/main.c ppp-2.2a5/pppd/main.c
---- ppp-2.2a5.orig/pppd/main.c Sat May 13 12:38:20 1995
-+++ ppp-2.2a5/pppd/main.c      Sat May 13 13:46:36 1995
-@@ -40,20 +40,21 @@
- #include <sys/socket.h>
- #include <net/if.h>
- #include "pppd.h"
- #include "magic.h"
- #include "fsm.h"
- #include "lcp.h"
- #include "ipcp.h"
- #include "upap.h"
- #include "chap.h"
-+#include "cbcp.h"
- #include "ccp.h"
- #include "pathnames.h"
- #include "patchlevel.h"
- /*
-  * If REQ_SYSOPTIONS is defined to 1, pppd will not run unless
-  * /etc/ppp/options exists.
-  */
- #ifndef       REQ_SYSOPTIONS
- #define REQ_SYSOPTIONS        1
-@@ -129,20 +130,22 @@
-     int  (*printpkt)();
-     void (*datainput)();
-     char *name;
- } prottbl[] = {
-     { PPP_LCP, lcp_init, lcp_input, lcp_protrej,
-         lcp_printpkt, NULL, "LCP" },
-     { PPP_IPCP, ipcp_init, ipcp_input, ipcp_protrej,
-         ipcp_printpkt, NULL, "IPCP" },
-     { PPP_PAP, upap_init, upap_input, upap_protrej,
-         upap_printpkt, NULL, "PAP" },
-+    { PPP_CBCP, cbcp_init, cbcp_input, cbcp_protrej,
-+        cbcp_printpkt, NULL, "CBCP" },
-     { PPP_CHAP, ChapInit, ChapInput, ChapProtocolReject,
-         ChapPrintPkt, NULL, "CHAP" },
-     { PPP_CCP, ccp_init, ccp_input, ccp_protrej,
-         ccp_printpkt, ccp_datainput, "CCP" },
- };
- #define N_PROTO               (sizeof(prottbl) / sizeof(prottbl[0]))
- main(argc, argv)
-     int argc;
-diff -r --unified=10 ppp-2.2a5.orig/pppd/options.c ppp-2.2a5/pppd/options.c
---- ppp-2.2a5.orig/pppd/options.c      Sat May 13 12:38:21 1995
-+++ ppp-2.2a5/pppd/options.c   Sat May 13 13:59:24 1995
-@@ -36,20 +36,21 @@
- #include <netinet/in.h>
- #include "pppd.h"
- #include "pathnames.h"
- #include "patchlevel.h"
- #include "fsm.h"
- #include "lcp.h"
- #include "ipcp.h"
- #include "upap.h"
- #include "chap.h"
-+#include "cbcp.h"
- #include "ccp.h"
- #include <net/ppp-comp.h>
- #define FALSE 0
- #define TRUE  1
- #if defined(ultrix) || defined(NeXT)
- char *strdup __P((char *));
- #endif
-@@ -112,20 +113,21 @@
- static int reqchap __P((void));
- static int setspeed __P((char *));
- static int noaccomp __P((void));
- static int noasyncmap __P((void));
- static int noipaddr __P((void));
- static int nomagicnumber __P((void));
- static int setasyncmap __P((char **));
- static int setescape __P((char **));
- static int setmru __P((char **));
- static int setmtu __P((char **));
-+static int setcbcp __P((char **));
- static int nomru __P((void));
- static int nopcomp __P((void));
- static int setconnector __P((char **));
- static int setdisconnector __P((char **));
- static int setdomain __P((char **));
- static int setnetmask __P((char **));
- static int setcrtscts __P((void));
- static int setnocrtscts __P((void));
- static int setxonxoff __P((void));
- static int setnodetach __P((void));
-@@ -202,20 +204,21 @@
-     {"connect", 1, setconnector}, /* A program to set up a connection */
-     {"disconnect", 1, setdisconnector},       /* program to disconnect serial dev. */
-     {"crtscts", 0, setcrtscts},       /* set h/w flow control */
-     {"-crtscts", 0, setnocrtscts}, /* clear h/w flow control */
-     {"xonxoff", 0, setxonxoff},       /* set s/w flow control */
-     {"debug", 0, setdebug},   /* Increase debugging level */
-     {"kdebug", 1, setkdebug}, /* Enable kernel-level debugging */
-     {"domain", 1, setdomain}, /* Add given domain name to hostname*/
-     {"mru", 1, setmru},               /* Set MRU value for negotiation */
-     {"mtu", 1, setmtu},               /* Set our MTU */
-+    {"cb", 1, setcbcp},               /* Set CBCP */
-     {"netmask", 1, setnetmask},       /* set netmask */
-     {"passive", 0, setpassive},       /* Set passive mode */
-     {"silent", 0, setsilent}, /* Set silent mode */
-     {"modem", 0, setmodem},   /* Use modem control lines */
-     {"local", 0, setlocal},   /* Don't use modem control lines */
-     {"lock", 0, setlock},     /* Lock serial device (with lock file) */
-     {"name", 1, setname},     /* Set local name for authentication */
-     {"user", 1, setuser},     /* Set username for PAP auth with peer */
-     {"usehostname", 0, setusehostname},       /* Must use hostname for auth. */
-     {"remotename", 1, setremote}, /* Set remote name for authentication */
-@@ -775,20 +778,31 @@
-       return 0;
-     if (mtu < MINMRU || mtu > MAXMRU) {
-       fprintf(stderr, "mtu option value of %ld is too %s\n", mtu,
-               (mtu < MINMRU? "small": "large"));
-       return 0;
-     }
-     lcp_allowoptions[0].mru = mtu;
-     return (1);
- }
-+static int
-+setcbcp(argv)
-+    char **argv;
-+{
-+    lcp_wantoptions[0].neg_cbcp = 1;
-+   
-+    cbcp[0].us_number = (char *) malloc(strlen(*argv) + 1);
-+    strcpy(cbcp[0].us_number, *argv);
-+    cbcp[0].us_type |= (1 << CB_CONF_USER);
-+    return (1);
-+}
- /*
-  * nopcomp - Disable Protocol field compression negotiation.
-  */
- static int
- nopcomp()
- {
-     lcp_wantoptions[0].neg_pcompression = 0;
-     lcp_allowoptions[0].neg_pcompression = 0;
-     return (1);
-diff -r --unified=10 ppp-2.2a5.orig/pppd/pppd.8 ppp-2.2a5/pppd/pppd.8
---- ppp-2.2a5.orig/pppd/pppd.8 Sat May 13 12:38:21 1995
-+++ ppp-2.2a5/pppd/pppd.8      Sat May 13 13:52:26 1995
-@@ -221,20 +221,31 @@
- .B -pap
- Don't agree to authenticate using PAP.
- .TP
- .B +chap
- Require the peer to authenticate itself using CHAP [Cryptographic
- Handshake Authentication Protocol] authentication.
- .TP
- .B -chap
- Don't agree to authenticate using CHAP.
- .TP
-+.B cb \fItelephone_number
-+Configure the current execution of pppd to negotiate the \fIclient\fR
-+portion of '\fIC\fRall \fIB\fRack \fIC\fRonfiguration
-+\fIP\fRrotocol'. The use of this protocol will permit the client to
-+authenticate itself with the server and then supply a telephone number
-+for the reverse connection. Once the telephone number is accepted, the
-+connection will be terminated. You should then wait for the server to
-+recall your location and re-authenticate yourself. This second step
-+will require a second execution of \fIpppd\fR. This second execution should
-+not include the \fIcb\fR option.
-+.TP
- .B -vj
- Disable negotiation of Van Jacobson style IP header compression (use
- default, i.e. no compression).
- .TP
- .B bsdcomp \fInr,nt
- Request that the peer compress packets that it sends, using the
- BSD-Compress scheme, with a maximum code size of \fInr\fR bits, and
- agree to compress packets sent to the peer with a maximum code size of
- \fInt\fR bits.  If \fInt\fR is not specified, it defaults to the value
- given for \fInr\fR.  Values in the range 9 to 15 may be used for
-diff -r --unified=10 ppp-2.2a5.orig/pppd/pppd.h ppp-2.2a5/pppd/pppd.h
---- ppp-2.2a5.orig/pppd/pppd.h Sat May 13 12:38:21 1995
-+++ ppp-2.2a5/pppd/pppd.h      Sat May 13 13:46:36 1995
-@@ -85,22 +85,23 @@
- extern int    disable_defaultip; /* Don't use hostname for default IP adrs */
- extern char   *ipparam;       /* Extra parameter for ip up/down scripts */
- extern int    cryptpap;       /* Others' PAP passwords are encrypted */
- /*
-  * Values for phase.
-  */
- #define PHASE_DEAD            0
- #define PHASE_ESTABLISH               1
- #define PHASE_AUTHENTICATE    2
--#define PHASE_NETWORK         3
--#define PHASE_TERMINATE               4
-+#define PHASE_CALLBACK          3
-+#define PHASE_NETWORK         4
-+#define PHASE_TERMINATE               5
- /*
-  * Prototypes.
-  */
- void quit __P((void));        /* Cleanup and exit */
- void timeout __P((void (*)(), caddr_t, int));
-                               /* Look-alike of kernel's timeout() */
- void untimeout __P((void (*)(), caddr_t));
-                               /* Look-alike of kernel's untimeout() */
- void output __P((int, u_char *, int));
+--------------------------------cut here-------------------------------
+diff -r -c ppp-2.3.orig/pppd/Makefile.bsd ppp-2.3/pppd/Makefile.bsd
+*** ppp-2.3.orig/pppd/Makefile.bsd     Tue Oct  8 13:33:33 1996
+--- ppp-2.3/pppd/Makefile.bsd  Fri Apr 11 23:59:15 1997
+***************
+*** 4,14 ****
+  # -D_BITYPES is for FreeBSD, which doesn't define anything to
+  # tell us that u_int32_t gets defined if <sys/types.h> is included.
+  # Remove for older *BSD systems for which this isn't true.
+! CFLAGS+= -g -I.. -DHAVE_PATHS_H -D_BITYPES
+  
+  PROG=        pppd
+  SRCS=        main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
+!      demand.c auth.c options.c sys-bsd.c
+  MAN= pppd.cat8
+  MAN8=        pppd.8
+  BINMODE=4555
+--- 4,14 ----
+  # -D_BITYPES is for FreeBSD, which doesn't define anything to
+  # tell us that u_int32_t gets defined if <sys/types.h> is included.
+  # Remove for older *BSD systems for which this isn't true.
+! CFLAGS+= -I.. -DHAVE_PATHS_H -D_BITYPES -DCBCP_SUPPORT
+  
+  PROG=        pppd
+  SRCS=        main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
+!      demand.c auth.c options.c sys-bsd.c cbcp.c
+  MAN= pppd.cat8
+  MAN8=        pppd.8
+  BINMODE=4555
+diff -r -c ppp-2.3.orig/pppd/Makefile.linux ppp-2.3/pppd/Makefile.linux
+*** ppp-2.3.orig/pppd/Makefile.linux   Tue Oct  8 15:42:41 1996
+--- ppp-2.3/pppd/Makefile.linux        Sat Apr 12 00:02:28 1997
+***************
+*** 14,20 ****
+          ipxcp.h cbcp.h
+  MANPAGES = pppd.8
+  PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
+!         auth.o options.o demand.o sys-linux.o ipxcp.o
+  
+  all: pppd
+  
+--- 14,20 ----
+          ipxcp.h cbcp.h
+  MANPAGES = pppd.8
+  PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
+!         auth.o options.o demand.o sys-linux.o ipxcp.o cbcp.o
+  
+  all: pppd
+  
+***************
+*** 36,42 ****
+  #INCLUDE_DIRS= -I/usr/include -I..
+  INCLUDE_DIRS=
+  
+! COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE
+  
+  CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
+  
+--- 36,42 ----
+  #INCLUDE_DIRS= -I/usr/include -I..
+  INCLUDE_DIRS=
+  
+! COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DCBCP_SUPPORT
+  
+  CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
+  
index 4a93aa562f7717e4a39ee31d443425e15ffff916..b99806213ed27d2c9489469f4bbc4f6ac98fac70 100644 (file)
@@ -5,6 +5,7 @@ PPP for Linux                                             Version 2.3.0
 
 Michael Callahan    callahan@maths.ox.ac.uk
 Al Longyear         longyear@netcom.com
+Paul Mackerras      Paul.Mackerras@cs.anu.edu.au
 
   Contents:
     INTRODUCTION
@@ -29,10 +30,11 @@ Al Longyear         longyear@netcom.com
 INTRODUCTION
 
 This file is substantially derived from the previous version for the
-pppd process 2.3.0, which itself was derived from earlier works by
+pppd process 2.2.0, which itself was derived from earlier works by
 Michael Callahan. This particular version was written, modified,
-hacked, changed, whatever, by Al Longyear. If you find errors in this
-document, they are probably mine and not Michael's.
+hacked, changed, whatever, by Al Longyear and Paul Mackerras. If you
+find errors in this document, they are probably ours and not
+Michael's.
 
 This is a PPP driver for Linux.  It has been used by many people and
 seems to be quite stable.  It is capable of being used either as a
@@ -91,10 +93,10 @@ of '16 channel' support obsolete.
 
 INSTALLATION
 
-This version of PPP has been tested on kernel version 1.3.100. It will
-probably not work on kernels much earlier than this due to earlier problems
-with the kernels. If you have an earlier kernel, please upgrade to the 2.0
-kernel (when it is available).
+This version of PPP has been tested on various Linux kernel versions
+(most recently 2.0.30 and 2.1.24). It will probably not work on
+kernels before 2.0.0. If you have an earlier kernel, please upgrade to
+the latest 2.0 kernel.
 
 joining the PPP channel of linux-activists:
 
@@ -226,15 +228,10 @@ not work with the older kernel driver. If you don't know how to build
 a kernel, then you should read the README file in the kernel source
 directory.
 
-If you wish module support then you need to have the 'modules-1.1.87'
+If you wish module support then you need to have the 'modules-2.0.0'
 package installed as the minimum version. Earlier versions of the module
 support will not work properly. All of the later ones will.
 
-As of this time, the current version for the modules package is
-1.2.0. Even 1.1.87 is old. However, if you only have 1.1.87 then it
-will do as it permits the symbol table references. Please consider
-upgrading the module package however.
-
 Instructions on building the kernel with modules are given in the
 README.modules in the kernel source directory.
 
@@ -300,14 +297,10 @@ regard to any order with the BSD one. The idea is that the ppp.o code must
 be loaded to use the compressor and the VJ header compression code must be
 loaded to use ppp.o.
 
-You may elect not to load the BSD compression module if you desire. There
-is a controversy regarding a Motorola software patent and while it is
-believed that this code does not infringe upon the patent, it is however
-an optional component.
-
-The deflate compressor has been stated by Morotola to not infringe upon
-their patent. However, it is also new. You may not find many systems which
-use this compressor.
+You may elect not to load the BSD compression module if you desire.
+The LZW compression algorithm (as used by BSD-Compress and the
+`compress' command) is claimed to be covered by a patent held by
+Unisys in the USA and other countries.
 
 In addition, if memory is a premium, do not run the compressors. It
 may take large amounts of memory (up to 2.6 meg) for high compression
diff --git a/SETUP b/SETUP
index fd5641954b78fbadafafe680f0f1538d10194003..fb28a213892e7a08349ea1e34ff40509bcc78db5 100644 (file)
--- a/SETUP
+++ b/SETUP
-               Setting up a PPP link.
-
-Setting up a PPP link between two machines involves several steps:
-
-1. Prepare both of the machines which are to be connected:
-   1A. Make and install the pppd, pppstats and chat programs.
-   1B. Install the ppp driver in the kernel.
-The README.* files give details on this step.
-
-2. Decide on the IP addresses to be used and the level of
-authentication required by each machine, and set up the /etc/ppp
-directories accordingly.
-
-3. Set up the serial link between the two machines and run pppd on
-each machine.  The two pppd's then negotiate and set up the link.
-
-Step 1 is described in the system-specific README.* files.  The
-remaining steps are described below.  Steps 1 and 2 need only be done
-once; step 3 is done each time the link is to be established.
-
-
-Choosing IP addresses.
-
-If a host is already connected to the Internet via a LAN such as
-Ethernet, then it will already have at least one IP address assigned,
-which will usually be the IP address of the LAN interface.  In such
-cases, it is usually most convenient to use that address as the local
-IP address of the PPP interface(s) on that host.  This is OK because
-the PPP interface(s) are point-to-point interfaces.
-
-If a host is not connected to the Internet, then an IP address needs
-to be assigned for it.  If PPP is to be used to link it to another
-host which is connected to the Internet, is is usually most convenient
-to assign it an address on the same subnet as the remote host.  If the
-other host is not connected to the Internet either, then the choice of
-IP addresses is quite arbitrary.
-
-Authentication.
-
-The level of authentication required depends on the situation, but
-generally hosts which are connected to the Internet via a LAN should
-be set up to (a) require the remote host to authenticate itself, and
-(b) restrict the remote host's choice of IP address, based on its
-identity.  Otherwise the possibility exists for a remote host to
-impersonate another host on the local subnet.  (However, when you are
-first installing PPP, it is probably easier to leave authentication
-disabled until you get to the point where you can successfully
-establish a link.)
-
-Setting up /etc/ppp.
-
-The /etc/ppp directory contains various files used by pppd; it should
-be created by the system administrator when installing PPP.  It would
-typically contain the following files:
-
-    chap-secrets       Secrets used for authenticating with CHAP
-    pap-secrets                Secrets used for authenticating with PAP
-    options            Options that the system administrator wants to
-                       apply whenever pppd is run
-
-Since this directory contains files of secrets used for
-authentication, it should not be in a partition which is accessible
-from other hosts (e.g., exported by NFS).
-
-The `options' file contains any options which the system administrator
-wants pppd to use whenever it is run.  If authentication is to be
-required, this should contain the `auth' and `usehostname' options.
-If the /etc/ppp/options file does not exist, or is not readable by
-pppd, it will refuse to run.
-
-Secrets for PAP (Password Authentication Protocol) authentication are
-stored in /etc/ppp/pap-secrets; secrets for CHAP (Cryptographic
-Authentication Protocol) are stored in /etc/ppp/chap-secrets.  These
-files have the same format, and store secrets both for authenticating
-other hosts, and for authenticating this host to others.  The format
-is that there are 3 or more words per line, which are:
-
-       client - name of the machine to be authenticated
-       server - name of the machine requiring the authentication
-       secret - password or CHAP secret known by both client and server
-       IP addresses - zero or more IP addresses which the client may
-               use (this field is only used on the server).
-
-For example, if a LAN-connected host called "worksun" is to require
-authentication, and a host "bsdbox" is to connect to it and
-authenticate itself using CHAP, then both machines should have a
-/etc/ppp/chap-secrets file, which should contain a line something
-like:
-
-       bsdbox  worksun "an unguessable secret" bsdbox.my.domain
-
-Setting up syslog.
-
-pppd issues messages using syslog facility daemon (or local2 if it has
-been compiled with debugging enabled); chat uses facility local2.  It
-is useful to see messages of priority notice or higher on the console.
-To see these, find the line in /etc/syslog.conf which has /dev/console
-on the right-hand side, and add `daemon.notice' on the left.  This
-line should end up something like this:
+               Configuring a PPP link.
+
+After you have compiled and installed this package, there are some
+configuration files which will generally need to be set up.  The
+pppd(8) man page is the best reference for the full details; this file
+outlines the configuration process for the most common case, where
+this package is being used to enable a machine to dial an ISP and
+connect to the internet.  The FAQ and README.linux files also provide
+useful information about setting up PPP.
+
+Dialling an ISP.
+****************
+
+Usually, an ISP will assign an IP address to your machine, and will
+refuse to authenticate itself to you.  Some ISPs require a username
+and password to be entered before PPP service commences, while others
+use PPP authentication (using either the PAP or CHAP protocols).
+
+The recommended way to set up to dial an ISP is for the system
+administrator to create a file under /etc/ppp/peers, named for the ISP
+that you will be dialling.  For example, suppose the file is called
+/etc/ppp/peers/isp.  This file would contain something like this:
+
+cua0           # modem is connected to /dev/cua0
+38400          # run the serial port at 38400 baud
+crtscts                # use hardware flow control
+noauth         # don't require the ISP to authenticate itself
+defaultroute   # use the ISP as our default route
+connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp'
+
+If there are any other pppd options that should apply when calling
+this ISP, they can also be placed in this file.
+
+The /etc/ppp/chat-isp file named in the last line contains the script
+for chat(8) to use to dial the ISP and go through any username/
+password authentication required before PPP service starts.  Here is
+an example (for dialling an Annex terminal server):
+
+ABORT "NO CARRIER"
+ABORT "NO DIALTONE"
+ABORT "ERROR"
+ABORT "NO ANSWER"
+ABORT "BUSY"
+ABORT "Username/Password Incorrect"
+"" "at"
+OK "at&d2&c1"
+OK "atdt2479381"
+"name:" "^Uusername"
+"word:" "\qpassword"
+"annex" "ppp"
+"Switching to PPP-ppp-Switching to PPP"
+
+See the chat(8) man page for details of the script.  If you are not
+sure how the initial dialog with your ISP will go, you could use
+a terminal emulator such as kermit or minicom to go through the
+process manually.
+
+If your ISP requires PAP or CHAP authentication, you will have to
+create a line in /etc/ppp/pap-secrets or /etc/ppp/chap-secrets like
+this:
+
+myhostname     *       "password"
+
+(Replace myhostname with the hostname of your machine.)
+
+At this point, you can initiate the link with the command:
+
+/usr/sbin/pppd call isp
+
+(N.B.: pppd might be installed in a different directory on some
+systems).
+
+This will return to the shell prompt immediately, as pppd will detach
+itself from its controlling terminal.  (If you don't want it to do
+this, use the "nodetach" option.)
+
+Pppd will log messages describing the progress of the connection and
+any errors using the syslog facility (see the syslogd(8) and
+syslog.conf(5) man pages).  Pppd issues messages using syslog facility
+daemon (or local2 if it has been compiled with debugging enabled);
+chat uses facility local2.  It is often useful to see messages of
+priority notice or higher on the console.  To see these, find the line
+in /etc/syslog.conf which has /dev/console on the right-hand side, and
+add `daemon.notice' on the left.  This line should end up something
+like this:
 
 *.err;kern.debug;daemon,local2,auth.notice;mail.crit   /dev/console
 
@@ -115,139 +101,11 @@ file.
 After modifying syslog.conf, you will then need to send a HUP signal
 to syslogd (or reboot).
 
-
-Setting up a PPP link.
-
-Establishing a PPP connection between two machines basically involves
-setting up a serial link and running pppd on both ends of the link.
-How this is done depends on the nature of the serial link, which may
-be as simple as a null modem cable between two machines, or it may
-involve modems, terminal servers, telnet sessions, etc.  The `chat'
-program is very useful in setting up the serial link because it
-enables you to automate any dialog which may be required, e.g.,
-logging in to the remote machine with a username and password, issuing
-a command to start ppp on the remote machine, etc.  As an example,
-the link could be started by issuing a command like
-
-       pppd /dev/ttya 38400 connect 'chat -f /etc/ppp/chat-script'
-
-where the file /etc/ppp/chat-script contains
-
-       "" atdt2135476
-       login: myname
-       Password: "\qmypassword"
-       "$ " "\qpppd"
-
-The words in this script are alternately strings to look for and
-strings to send.  In this example, we start by sending a dial command
-to the modem; then we look for "login:", send "myname", look for
-"Password:", send "mypassword" (the "\q" prevents chat from logging it
-when you use the -v option), look for "$ " (the end of the shell
-prompt) and send "pppd" to start up ppp on the remote machine (the
-"\q" cancels the effect of the previous "\q").
-
-In another scenario, you could establish the serial link manually,
-e.g. using Kermit to dial out, log into the remote machine, and issue
-the commands to start ppp there.  Then you have to exit Kermit without
-having the modem hang up, and then start pppd locally, using a command
-like this:
-
-       pppd /dev/ttya 38400
-
-When a device is given, as in this command line, pppd will put itself
-in the background.  The two pppd's should then negotiate and bring up
-the link.  If you have edited /etc/syslog.conf as described above, you
-will see messages from pppd giving the local and remote IP addresses
-of the link when it is successfully established.
-
-If the local machine has no other connection to the Internet, you can
-ask pppd to add a default route via the remote host by adding the
-`defaultroute' option to the pppd command.
-
-N.B. When you run pppd on the remote machine, you usually want it to
-use the tty device where you logged in.  In this case, do not give a
-device name to pppd; it uses the controlling tty by default.  This may
-be a pty, e.g., if the serial link contains a telnet session, except
-under Ultrix (pppd will not run on a pty under Ultrix, due to the pty
-driver not passing ioctls to the ppp line discipline code).
-
-If the remote machine is connected to the Internet via a LAN, it is
-often useful to add the `proxyarp' option.  The `asyncmap' option is
-also useful if the serial line is not completely transparent;
-`asyncmap 200a0000' is appropriate if the serial link includes a
-telnet.
-
-Some people find it convenient to set up a `ppp' username on the
-remote machine, with no password, and a shell script which runs pppd
-as its login shell.
-
-Other random points about running pppd:
-       - If you want the local address of the PPP link to be
-         different from the (first) IP address of the host, you need
-         to put the desired address on the pppd command line with a
-         colon appended.
-       - The performance will probably be better if you reduce the
-         MRU (maximum receive unit) on both ends; 296 is a good
-         value.  To do this, use the option `mru 296'.
-       - You DO NOT need to use ifconfig to configure the addresses
-         of the ppp interface.  Pppd does all the necessary work
-         (assigning addresses, marking the interface up, etc.).
-
-
-Terminating the PPP link.
-
 When you wish terminate the PPP link, you should send a TERM or INTR
-signal to one of the pppd's, e.g., with a command like:
-
-       kill `cat /etc/ppp/ppp0.pid`
-
-on SunOS or Ultrix, or
+signal to pppd.  Pppd writes its process ID to a file called
+ppp<n>.pid in /var/run (or /etc/ppp on older systems such as SunOS or
+Ultrix).  Here <n> is the PPP interface unit number, which will be 0
+unless you have more than one PPP link running simultaneously.  Thus
+you can terminate the link with a command like
 
        kill `cat /var/run/ppp0.pid`
-
-on {386,Net,Free}BSD.
-
-That pppd will inform the other pppd to terminate, and they will both
-clean up and exit.
-
-If pppd is attached to a hardware serial port connected to a modem,
-then it should get a HUP signal when the modem hangs up, which will
-cause it to clean up and exit.  Whether it does or not depends on the
-driver, and on Suns, on the setting of the `tty soft carrier' flag,
-which is manipulated by the /usr/etc/ttysoftcar program (see
-ttysoftcar(8)).
-
-
-Debugging.
-
-If the link comes up successfully, you should see messages logged to
-the console like "Local IP address:  xx.xx.xx.xx" and "Remote IP
-address: yy.yy.yy.yy" (assuming you've edited /etc/syslog.conf as
-described above).  If the link doesn't come up, it could be due to any
-of several factors:
-
-- Perhaps the serial connection is not being set up successfully, or
-you haven't succeeded in getting ppp running on the remote machine.
-You can use the -v flag to chat; it will then log the characters it
-sends and receives (using syslog with facility `local2' and level
-`debug').
-
-- Perhaps the PPP negotiation with the peer is failing.  You can use
-the `debug' option to pppd; it will then log the contents of all
-control packets sent and received (using syslog with facility `daemon'
-and level `debug').
-
-In some cases, the link will come up successfully, but you may then be
-unable to use network-based applications over the link.  This usually
-indicates an IP-address assignment problem or a routing problem.  Or
-you may be able to communicate with the peer machine but not any
-machine beyond that.  Typically this is a routing problem.  For the
-common case where the local machine is only connected to the Internet
-via the peer, this problem can usually be solved if you:
-       - assign the local machine an IP address on the same subnet
-         as the remote machine
-       - use the `defaultroute' option on the local pppd
-       - use the `proxyarp' option on the remote pppd.
-
-For solving routing and network problems, the ifconfig, netstat -i,
-netstat -r, ping and traceroute commands are useful.