Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/pppd Pull up pppd 2.4.0 (requested by christos...



details:   https://anonhg.NetBSD.org/src/rev/a740ae27a37c
branches:  netbsd-1-5
changeset: 489600:a740ae27a37c
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sat Sep 30 06:21:40 2000 +0000

description:
Pull up pppd 2.4.0 (requested by christos, approved by thorpej).

diffstat:

 usr.sbin/pppd/chat/chat.c         |    13 +-
 usr.sbin/pppd/doc/PLUGINS         |   132 +++
 usr.sbin/pppd/doc/README          |   393 +--------
 usr.sbin/pppd/doc/README.bsd      |     4 +-
 usr.sbin/pppd/doc/README.cbcp     |     2 +
 usr.sbin/pppd/doc/TODO            |    17 +
 usr.sbin/pppd/pppd/Makefile       |     6 +-
 usr.sbin/pppd/pppd/auth.c         |   135 ++-
 usr.sbin/pppd/pppd/ccp.c          |    10 +-
 usr.sbin/pppd/pppd/demand.c       |     6 +-
 usr.sbin/pppd/pppd/eui64.c        |    30 +-
 usr.sbin/pppd/pppd/eui64.h        |    28 +-
 usr.sbin/pppd/pppd/ipcp.c         |    51 +-
 usr.sbin/pppd/pppd/ipv6cp.c       |    46 +-
 usr.sbin/pppd/pppd/ipv6cp.h       |    23 +-
 usr.sbin/pppd/pppd/ipxcp.c        |     5 +-
 usr.sbin/pppd/pppd/lcp.c          |   283 +++++-
 usr.sbin/pppd/pppd/lcp.h          |    12 +-
 usr.sbin/pppd/pppd/main.c         |  1545 +++++++++++++-----------------------
 usr.sbin/pppd/pppd/multilink.c    |   392 +++++++++
 usr.sbin/pppd/pppd/options.c      |   222 ++--
 usr.sbin/pppd/pppd/patchlevel.h   |    11 +-
 usr.sbin/pppd/pppd/pathnames.h    |    16 +-
 usr.sbin/pppd/pppd/pppd.8         |   100 ++-
 usr.sbin/pppd/pppd/pppd.h         |    73 +-
 usr.sbin/pppd/pppd/sys-bsd.c      |   168 +++-
 usr.sbin/pppd/pppd/tdb.c          |  1292 ++++++++++++++++++++++++++++++
 usr.sbin/pppd/pppd/tdb.h          |    79 +
 usr.sbin/pppd/pppd/tty.c          |   963 +++++++++++++++++++++++
 usr.sbin/pppd/pppd/utils.c        |     6 +-
 usr.sbin/pppd/pppstats/pppstats.8 |     5 +-
 usr.sbin/pppd/pppstats/pppstats.c |    27 +-
 32 files changed, 4404 insertions(+), 1691 deletions(-)

diffs (truncated from 7829 to 300 lines):

diff -r f5939d71dfae -r a740ae27a37c usr.sbin/pppd/chat/chat.c
--- a/usr.sbin/pppd/chat/chat.c Sat Sep 30 06:20:43 2000 +0000
+++ b/usr.sbin/pppd/chat/chat.c Sat Sep 30 06:21:40 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chat.c,v 1.18.8.1 2000/07/18 16:15:06 tron Exp $       */
+/*     $NetBSD: chat.c,v 1.18.8.2 2000/09/30 06:21:40 simonb Exp $     */
 
 /*
  *     Chat -- a program for automatic session establishment (i.e. dial
@@ -84,17 +84,18 @@
  *
  */
 
+#ifndef __STDC__
+#define const
+#endif
+
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
-static char rcsid[] = "Id: chat.c,v 1.26 1999/12/23 01:39:54 paulus Exp ";
+static const char rcsid[] = "Id: chat.c,v 1.26 1999/12/23 01:39:54 paulus Exp ";
 #else
-__RCSID("$NetBSD: chat.c,v 1.18.8.1 2000/07/18 16:15:06 tron Exp $");
+__RCSID("$NetBSD: chat.c,v 1.18.8.2 2000/09/30 06:21:40 simonb Exp $");
 #endif
 #endif
-#ifndef __STDC__
-#define const
-#endif
 
 #include <stdio.h>
 #include <ctype.h>
diff -r f5939d71dfae -r a740ae27a37c usr.sbin/pppd/doc/PLUGINS
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/pppd/doc/PLUGINS Sat Sep 30 06:21:40 2000 +0000
@@ -0,0 +1,132 @@
+$NetBSD: PLUGINS,v 1.1.1.1.2.2 2000/09/30 06:21:41 simonb Exp $
+Starting with version 2.3.10, pppd includes support for `plugins' -
+pieces of code which can be loaded into pppd at runtime and which can
+affect its behaviour in various ways.  The idea of plugins is to
+provide a way for people to customize the behaviour of pppd without
+having to either apply local patches to each version or get their
+patches accepted into the standard distribution.  My aim is that
+plugins will be able to be used with successive versions of pppd
+without needing to recompile the plugins.
+
+A plugin is a standard shared library object, typically with a name
+ending in .so.  They are loaded using the standard dlopen() library
+call, so plugins are only supported on systems which support shared
+libraries and the dlopen call.  At present pppd is compiled with
+plugin support only under Linux and Solaris.
+
+Plugins are loaded into pppd using the `plugin' option, which takes
+one argument, the name of a shared object file.  The plugin option is
+a privileged option.  I suggest that you give the full path name of
+the shared object file; if you don't, it may be possible for
+unscrupulous users to substitute another shared object file for the
+one you mean to load, e.g. by setting the LD_LIBRARY_PATH variable.
+
+Plugins are usually written in C and compiled and linked to a shared
+object file in the appropriate manner for your platform.  Using gcc
+under Linux, a plugin called `xyz' could be compiled and linked with
+the following commands:
+
+       gcc -c -O xyz.c
+       gcc -shared -o xyz.so xyz.o
+
+There are some example plugins in the pppd/plugins directory in the
+ppp distribution.  Currently there is one example, minconn.c, which
+implements a `minconnect' option, which specifies a minimum connect
+time before the idle timeout applies.
+
+Plugins can access global variables within pppd, so it is useful for
+them to #include "pppd.h" from the pppd source directory.
+
+Every plugin must contain a global procedure called `plugin_init'.
+This procedure will get called (with no arguments) immediately after
+the plugin is loaded.
+
+Plugins can affect the behaviour of pppd in at least three ways:
+
+1. They can add extra options which pppd will then recognize.  This is
+   done by calling the add_options() procedure with a pointer to an
+   array of option_t structures.  The last entry in the array must
+   have its name field set to NULL.
+
+2. Pppd contains `hook' variables which are procedure pointers.  If a
+   given hook is not NULL, pppd will call the procedure it points to
+   at the appropriate point in its processing.  The plugin can set any
+   of these hooks to point to its own procedures.  See below for a
+   description of the hooks which are currently implemented.
+
+3. Plugin code can call any global procedures and access any global
+   variables in pppd.
+
+Here is a list of the currently implemented hooks in pppd.
+
+
+int (*idle_time_hook)(struct ppp_idle *idlep);
+
+The idle_time_hook is called when the link first comes up (i.e. when
+the first network protocol comes up) and at intervals thereafter.  On
+the first call, the idlep parameter is NULL, and the return value is
+the number of seconds before pppd should check the link activity, or 0
+if there is to be no idle timeout.
+
+On subsequent calls, idlep points to a structure giving the number of
+seconds since the last packets were sent and received.  If the return
+value is > 0, pppd will wait that many seconds before checking again.
+If it is <= 0, that indicates that the link should be terminated due
+to lack of activity.
+
+
+int (*holdoff_hook)(void);
+
+The holdoff_hook is called when an attempt to bring up the link fails,
+or the link is terminated, and the persist or demand option was used.
+It returns the number of seconds that pppd should wait before trying
+to reestablish the link (0 means immediately).
+
+
+int (*pap_check_hook)(void);
+int (*pap_passwd_hook)(char *user, char *passwd);
+int (*pap_auth_hook)(char *user, int userlen,
+                    char *passwd, int passlen,
+                    char **msgp, int *msglenp,
+                    struct wordlist **paddrs,
+                    struct wordlist **popts);
+
+These hooks are designed to allow a plugin to replace the normal PAP
+password processing in pppd with something different (e.g. contacting
+an external server).
+
+The pap_check_hook is called to check whether there is any possibility
+that the peer could authenticate itself to us.  If it returns 1, pppd
+will ask the peer to authenticate itself.  If it returns 0, pppd will
+not ask the peer to authenticate itself (but if authentication is
+required, pppd may exit, or terminate the link before network protocol
+negotiation).  If it returns -1, pppd will look in the pap-secrets
+file as it would normally.
+
+The pap_passwd_hook is called to determine what username and password
+pppd should use in authenticating itself to the peer with PAP.  The
+user string will already be initialized, by the `user' option, the
+`name' option, or from the hostname, but can be changed if necessary.
+MAXNAMELEN bytes of space are available at *user, and MAXSECRETLEN
+bytes of space at *passwd.  If this hook returns 0, pppd will use the
+values at *user and *passwd; if it returns -1, pppd will look in the
+pap-secrets file, or use the value from the +ua or password option, as
+it would normally.
+
+The pap_auth_hook is called to determine whether the username and
+password supplied by the peer are valid.  user and passwd point to
+null-terminated strings containing the username and password supplied
+by the peer, with non-printable characters converted to a printable
+form.  The pap_auth_hook function should set msg to a string to be
+returned to the peer and return 1 if the username/password was valid
+and 0 if not.  If the hook returns -1, pppd will look in the
+pap-secrets file as usual.
+
+If the username/password was valid, the hook can set *paddrs to point
+to a wordlist containing the IP address(es) which the peer is
+permitted to use, formatted as in the pap-secrets file.  It can also
+set *popts to a wordlist containing any extra options for this user
+which pppd should apply at this point.
+
+
+## Id: PLUGINS,v 1.2 1999/09/17 06:02:45 paulus Exp  ##
diff -r f5939d71dfae -r a740ae27a37c usr.sbin/pppd/doc/README
--- a/usr.sbin/pppd/doc/README  Sat Sep 30 06:20:43 2000 +0000
+++ b/usr.sbin/pppd/doc/README  Sat Sep 30 06:21:40 2000 +0000
@@ -1,4 +1,5 @@
-This is the README file for ppp-2.3, a package which implements the
+$NetBSD: README,v 1.1.1.2.8.1 2000/09/30 06:21:41 simonb Exp $
+This is the README file for ppp-2.4, a package which implements the
 Point-to-Point Protocol (PPP) to provide Internet connections over
 serial lines.
 
@@ -16,14 +17,19 @@
 - Kernel code, which establishes a network interface and passes
 packets between the serial port, the kernel networking code and the
 PPP daemon (pppd).  This code is implemented using STREAMS modules on
-SunOS 4.x, Solaris 2.x, System V Release 4, and OSF/1, and as a
-line discipline under Ultrix, NextStep, NetBSD, FreeBSD, and Linux.
+SunOS 4.x and Solaris, and as a line discipline under Linux and FreeBSD.
 
 - The PPP daemon (pppd), which negotiates with the peer to establish
 the link and sets up the ppp network interface.  Pppd includes support
 for authentication, so you can control which other systems may make a
 PPP connection and what IP addresses they may use.
 
+The primary platforms supported by this package are Linux and Solaris.
+Code for SunOS 4.x is included here but is largely untested.  I have
+code for NeXTStep, FreeBSD, SVR4, Tru64 (Digital Unix), AIX and Ultrix
+but no active maintainers for these platforms.  Code for all of these
+except AIX is included in the ppp-2.3.11 release.
+
 
 Installation.
 *************
@@ -36,19 +42,7 @@
 
        Linux                           README.linux
        Solaris 2                       README.sol2
-       Digital Unix (OSF/1)            README.osf
-       NetBSD, FreeBSD                 README.bsd
-       NeXTStep                        README.next
        SunOS 4.x                       README.sunos4
-       System V Release 4              README.svr4
-       Ultrix 4.x                      README.ultrix
-
-In fact, only the Linux and Solaris 2 ports have been tested in this
-release.  Code for the other systems is still included; if you use it,
-let me know how it works.  If I don't hear from anyone it will
-probably get dropped in a subsequent release.  AIX 4 is no longer
-supported, since I don't have a maintainer for the AIX 4 port.  If you
-want to volunteer, contact me.
 
 In each case you start by running the ./configure script.  This works
 out which operating system you are using and creates symbolic links to
@@ -56,12 +50,6 @@
 user-level code, and (as root) `make install' to install the
 user-level programs pppd, chat and pppstats.
 
-The procedures for installing the kernel code vary from system to
-system.  On some systems, the kernel code can be loaded into a running
-kernel using a `modload' facility.  On others, the kernel image has to
-be recompiled and the system rebooted.  See the README.* files for
-details.
-
 N.B. Since 2.3.0, leaving the permitted IP addresses column of the
 pap-secrets or chap-secrets file empty means that no addresses are
 permitted.  You need to put a "*" in that column to allow the peer to
@@ -69,352 +57,21 @@
 authenticating itself to you, of course.)
 
 
-What's new in ppp-2.3.9.
+What's new in ppp-2.4.0.
 ************************
 
-* Support for the new generic PPP layer under development for the
-  Linux kernel.
-
-* You can now place extra options to apply to specific users at the
-  end of the line with their password in the pap-secrets or
-  chap-secrets file, separated from the IP address(es) with a "--"
-  separator.  These options are parsed after the peer is authenticated
-  but before network protocol (IPCP, IPXCP) or CCP negotiation
-  commences.
-
-* Pppd will apply the holdoff period if the link was terminated by the
-  peer.  It doesn't apply it if the link was terminated because the
-  local pppd thought it was idle.
-
-* Synchronous support for Solaris has been added, thanks to John
-  Morrison, and for FreeBSD, thanks to Paul Fulghum.
-
-* IPV6 support has been merged in, from Tommi Komulainen.  At the
-  moment it only supports Linux and it is not tested by me.
-
-* The `nodefaultip' option can be used in demand mode to say that pppd
-  should not suggest its local IP address to the peer.
-
-* The `init' option has been added; this causes pppd to run a script
-  to initialize the serial device (e.g. by sending an init string to
-  the modem).  Unlike the connect option, this can be used in a
-  dial-in situation.  (Thanks to Tobias Ringstrom.)
-
-* There is a new `logfile' option to send log messages to a file as
-  well as syslog.
-
-* There is a new, privileged `linkname' option which sets a logical
-  name for the link.  Pppd will create a /var/run/ppp-<linkname>.pid
-  file containing its process ID.
-
-* There is a new `maxfail' option which specifies how many consecutive
-  failed connection attempts are permitted before pppd will exit.  The
-  default value is 10, and 0 means infinity. :-)
-
-* Sundry bugs fixed.
-
-
-What was new in ppp-2.3.8.
-**************************
-
-* The exit status of pppd will now indicate whether the link was
-  successfully established, or if not, what error was encountered.
-
-* Pppd has two new options: fdlog <n> will send log messages to file
-  descriptor <n> instead of standard output, and nofdlog will stop log
-  messages from being sent to any file descriptor (they will still be
-  sent to syslog).  Pppd now will not send log messages to a file
-  descriptor if the serial port is open on that file descriptor.
-
-* Pppd sets an environment variable called PPPLOGNAME for scripts that
-  it runs, indicating the login name of the user who invoked pppd.
-
-* Pppd sets environment variables CONNECT_TIME, BYTES_SENT and



Home | Main Index | Thread Index | Old Index