History log of /freebsd-current/usr.sbin/ppp/command.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# f80b39d1 17-Aug-2018 Nick Hibma <n_hibma@FreeBSD.org>

Add the possibility to mark packets urgent based on their length.

This allows preferring small (e.g. ACK) packets, in upload heavy
environments.

It was already possible to mark packets urgent based on destination
port. This option piggy backs on that feature.


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 71866e62 14-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use NULL instead of 0 for pointers.

getenv(3) returns NULL if the variable name is not in the current
environment.
getservent(3) returns NULL on EOF or error

MFC after: 4 weeks


# 9304cfd0 28-Jan-2015 Dimitry Andric <dim@FreeBSD.org>

Fix multiple instances of the following clang 3.6.0 warning in ppp:

usr.sbin/ppp/command.c:2054:74: error: address of array 'arg->bundle->radius.cfg.file'
will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
if (arg->bundle->radius.alive.interval && !arg->bundle->radius.cfg.file) {
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~

In all cases, the file field of struct radius is a char array, but the
intent was to check whether the string is empty, so add an indirection
to achieve that. Use a similar approach for the sockname field of
struct server.


# ab3f6b34 17-Apr-2013 Gabor Kovesdan <gabor@FreeBSD.org>

- Correct mispellings of the word occurrence

Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)


# 3df5ecac 30-Dec-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Spelling fixes for usr.sbin/


# f2f5156f 07-Feb-2011 Brian Somers <brian@FreeBSD.org>

Add "iface name" and "iface description" commands.

PR: 151400
Submitted by: Aragon Gouveia - aragon at phat dot za dot net with minor fixes
MFC after: 3 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# a5625ae7 12-Mar-2008 Paolo Pisati <piso@FreeBSD.org>

Update to the "new" libalias API (and thus fix world breakage).


# d4d4a70a 25-May-2007 Roman Bogorodskiy <novel@FreeBSD.org>

Add a new option for ppp.conf: rad_port_id. It allows to
change the way of what ppp submits to the RADIUS server
as NAS-Port-Id. Possible options are: the PID of the process
owning the corresponding interface, tun(4) interface number,
interface index (as it would get returned by if_nametoindex(3)),
or it's possible to keep the default behavior. Check the ppp(8)
manual page for details.

PR: bin/112764
Submitted by: novel (myself)
Reviewed by: flz
Approved by: flz
MFC after: 1 month


# d398d502 06-Sep-2006 Brian Somers <brian@FreeBSD.org>

Remove __DATE__ so that compiling the same source produces the same binary
(for non-static binaries at least).


# 23417e56 08-Feb-2005 Brian Somers <brian@FreeBSD.org>

Use the correct length when copying trailing data!!

PR: 77104
Submitted by: Martin Birgmeier martin at email dot aon dot at
MFC after: 3 days


# 125eb366 12-Dec-2004 Brian Somers <brian@FreeBSD.org>

Implement an ``enable/disable echo'' option, defaults to off.
This allows LCP ECHOs to be enabled independently of LQR reports.

Note: This introduces a change in the default behaviour (search for lqr and
echo in the man page). I'll update UPDATING to reflect this.

PR: 74821


# 0508c09a 29-Nov-2004 Brian Somers <brian@FreeBSD.org>

Send NAS-IP-Address as well as NAS-Identifier
Add ``disable NAS-IP-Address'' and ``disable NAS-Identifier'' options to
support pre-rfc2865 RADIUS servers.
This pushes our enable/disable items over the 32 bit limit, so reoganise
things to allow a bunch more options.
Go to version 3.4.1 so that any compatability problems can be identified.


# 5d604c11 11-Oct-2004 Brian Somers <brian@FreeBSD.org>

Add a bunch of malloc() return checks

PR: 71592
Submitted by: Dan Lukes <dan@obluda.cz> with further changes


# 057f1760 04-Sep-2004 Brian Somers <brian@FreeBSD.org>

Make ppp WARNS=5 clean


# b5bc6d4d 28-Jul-2004 Gleb Smirnoff <glebius@FreeBSD.org>

Add configuration option "set pppoe [standard|3Com]" which allows
to configure mode for ng_pppoe(4) node under control.

Reviewed by: brian
Approved by: julian (mentor)


# e715b13b 16-Jul-2004 Brian Somers <brian@FreeBSD.org>

Support a ``set rad_alive N'' command to enable periodic RADIUS accounting
information being sent to the RADIUS server.

Logging of RADIUS accounting information moves to a ``set log [+-]radius''
level, along with the RADIUS alive info, and the version number is bumped
to 3.2 to reflect this.

Mostly submitted by: alx@sm.ukrtel.net (back in January)
MFC after: 3 weeks


# 6489fd21 15-Jul-2004 Brian Somers <brian@FreeBSD.org>

Fix ``set ifaddr''. The code was actually using an uninitialised variable,
but conveniently, because ncpaddr.ncpaddr_family != AF_INET, the call to
ncpaddr_getip4addr() became a no-op leaving the local address as it was
(defaulting to whatever my hostname resolves to).

PR: 62050
Submitted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
MFC after: 3 days


# b07fbc17 23-Sep-2003 Joe Marcus Clarke <marcus@FreeBSD.org>

Add Cisco Skinny Station protocol support to libalias, natd, and ppp.
Skinny is the protocol used by Cisco IP phones to talk to Cisco Call
Managers. With this code, one can use a Cisco IP phone behind a FreeBSD
NAT gateway.

Currently, having the Call Manager behind the NAT gateway is not supported.
More information on enabling Skinny support in libalias, natd, and ppp
can be found in those applications' manpages.

PR: 55843
Reviewed by: ru
Approved by: ru
MFC after: 30 days


# ec3e98b8 20-Jun-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

IPV6PREFIX is set when Framed-IPv6-Prefix is defined, You may
want to pass the value to upper layer protocol such as DHCPv6
for prefix delegation.

MFC after: 1 week


# 34894c56 25-Mar-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

Don't install wrong IPv6 route by add command.


# 9603d5b4 25-Mar-2003 Brian Somers <brian@FreeBSD.org>

Add a ``force-scripts'' option for using chat scripts with -direct and
-dedicated links.

Submitted by: Maksim Yevmenkin <myevmenk@exodus.net>


# 31c759c0 02-Sep-2002 Brian Somers <brian@FreeBSD.org>

Unbreak -DNOINET6

Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
MFC after: 1 day


# a3c48b40 28-Aug-2002 Brian Somers <brian@FreeBSD.org>

- made ppp compliant to RFC 2472 (based on a patch from another
contributor)
- support ipv6cpretry and ipv6cpretries, which are IPv6 versions
of ipcpretry and ipcpretries.
- improve handling of IPv6 link-local addresses

Submitted by: JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>


# 6eafd353 27-Aug-2002 Brian Somers <brian@FreeBSD.org>

Include the correct file (stdarg.h) and use va_list rather than _BSD_VA_LIST_

Suggested by: mike


# 10be78d3 15-Jun-2002 Brian Somers <brian@FreeBSD.org>

Remove whitespace at the end of lines.


# aea6acb6 12-Jun-2002 Brian Somers <brian@FreeBSD.org>

Bump the version number to reflect the recent RADIUS commits


# 42df3c25 27-May-2002 Brian Somers <brian@FreeBSD.org>

Coerce pid_t to long rather than int for better portability.

Suggested by: Theo de Raadt <deraadt@openbsd.org>


# a16061b2 16-May-2002 Brian Somers <brian@FreeBSD.org>

Handle MS-CHAPv2 authentication correctly via the RADIUS server (if it's
configured).
Handle internal failures in radius_Authenticate() correctly.
Bump the ppp version number.

This doesn't yet work with MPPE. More will follow.

Sponsored by: Mozoon


# de59e178 13-May-2002 Brian Somers <brian@FreeBSD.org>

o Clean up some #includes
o Bump version number to 3.0.4
o When talking to a RADIUS server, provide a NAS-Port-Type.

When the NAS-Port-Type is Ethernet, provide a NAS-Port value equal
to the SESSIONID from the environment in direct mode or the
NGM_PPPOE_SESSIONID message in other modes. If no SESSIONID is found,
default to the interface index in client mode or zero in server mode.

When the NAS-Port-Type is ISDN, set the NAS-Port to the minor number
of the physical device (ie, the N in /dev/i4brbchN).

This makes it easier for the RADIUS server to identify the client
WRT accounting data etc.

Prompted by: lsz8425 <lsz8425@mail.cd.hn.cn>


# e1e3d2ca 04-May-2002 Brian Somers <brian@FreeBSD.org>

Make ``set mru'' require a context. In multi-link mode, there's no
point in being allowed to ``set mru'' for the MP lcp layer.

Spotted by: Richard Browne <richb@timestone.com.au>
MFC after: 1 month


# d9c83d7b 01-May-2002 Brian Somers <brian@FreeBSD.org>

Bump the version to mark the fixed FSM TLD ordering


# d3974088 22-Apr-2002 Dag-Erling Smørgrav <des@FreeBSD.org>

Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.


# d5f69430 16-Apr-2002 Brian Somers <brian@FreeBSD.org>

Add variable substitutions for SOCKNAME, IPOCTETSIN, IPOCTETSOUT, IPPACKETSIN,
IPPACKETSOUT, IPV6OCTETSIN, IPV6OCTETSOUT, IPV6PACKETSIN, IPV6PACKETSOUT,
OCTETSIN, OCTETSOUT, PACKETSIN, PACKETSOUT and SOCKNAME.


# ff360cc9 16-Apr-2002 Brian Somers <brian@FreeBSD.org>

Make the way FSM options are processed easier to read by using structures
instead of u_char *.

The changes are cosmetic except:

RecvConfigAck() now displays the options that are being ACK'd
Huge (bogus) options sent from the peer won't cause an infinite loop
SendIdent and ReceiveIdent are displayed consistenlty with other FSM data
LCP AUTHPROTO options that aren't understood are NAK'd, not REJ'd


# fb11a9c2 29-Mar-2002 Brian Somers <brian@FreeBSD.org>

Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's line
discipline to do the async escaping, but no other benefits are available yet.

Change ``ifdef HAVE_DES'' to ``ifndef NODES'' for consistency.

Make the Makefile a little more sane WRT RELEASE_CRUNCH.


# a12856cf 21-Nov-2001 Brian Somers <brian@FreeBSD.org>

Expand the first argument of the ``log'' command if it's a variable.


# 39d2e655 04-Nov-2001 Brian Somers <brian@FreeBSD.org>

Remove unused variables


# 46df5aa7 03-Nov-2001 Brian Somers <brian@FreeBSD.org>

Add a ``log'' command for logging specific information.
Add an ``UPTIME'' variable to indicate the bundle uptime.

It's now possible to put something like this in ppp.linkdown
for a server setup:

MYADDR:
log Session closing: User USER, address HISADDR, up UPTIME

Fixed some memory leakage with commands that expand words.
Made some functions static.
Fixed a diagnostic bug (iface add .... SIOCDIFADDR)


# dad51e5c 23-Oct-2001 Brian Somers <brian@FreeBSD.org>

Don't avoid setting a 0 second timer in datalink_StartDialTimer() by
not setting any timer. Instead, set a 1 millisecond timer.

This ensures that ppp will come out of it's select() call after
losing carrier in -ddial mode with a reconnect period of 0 and
going to ST_OPENING, rather than waiting indefinitely for some
other event to wake ppp up.

Bump the ppp version number to indicate the event.

MFC after: 3 days


# 2313781d 20-Aug-2001 Brian Somers <brian@FreeBSD.org>

Handle snprintf() returning < 0 (not just -1)

MFC after: 2 weeks


# 1433aa5d 18-Aug-2001 Brian Somers <brian@FreeBSD.org>

Better handling for the return of snprintf().


# 1136c6ac 18-Aug-2001 Brian Somers <brian@FreeBSD.org>

Back out the previous fix to deal with kernels that don't support IPv6,
and implement a far more subtle and correct fix.

The reason behind the infinite loop was that ppp was trying to make up
initial IPv6 numbers and wasn't giving up when it failed unexpectedly to
assign the addresses it just fabricated to it's interface (thinking that
the reason was because another interface was using the same address).
It now attempts this up to 100 times before just failing and trying to
muddle along (in reality, this should never happen more than a couple
of times unless our random number generator doesn't work).

Also, when IPv6 is not available, don't even try to assign the IPv6
interface address in the first place...


# c5109a32 18-Aug-2001 Brian Somers <brian@FreeBSD.org>

Run correctly on a machine built without AF_INET6 support


# 6c764d89 17-Aug-2001 Brian Somers <brian@FreeBSD.org>

Build properly with -DNOIPV6


# e1a94c3d 16-Aug-2001 Brian Somers <brian@FreeBSD.org>

Remove an unused variable


# 971abb29 15-Aug-2001 Brian Somers <brian@FreeBSD.org>

Probe for the availability of AF_INET6 at startup. If it's not
available, default ipv6cp to disabled and refuse to let the user
enable it.


# 30949fd4 14-Aug-2001 Brian Somers <brian@FreeBSD.org>

o Add ipv6 support, abstracting most NCP addresses into opaque
structures (well, they're treated as opaque).

It's now possible to manage IPv6 interface addresses and routing
table entries and to filter IPV6 traffic whether encapsulated or
not.

IPV6CP support is crude for now, and hasn't been tested against
any other implementations.

RADIUS and IPv6 are independent of eachother for now.

ppp.linkup/ppp.linkdown aren't currently used by IPV6CP

o Understand all protocols(5) in filter rules rather than only a select
few.

o Allow a mask specification for the ``delete'' command. It's now
possible to specifically delete one of two conflicting routes.

o When creating and deleting proxy arp entries, do it for all IPv4
interface addresses rather than doing it just for the ``current''
peer address.

o When iface-alias isn't in effect, don't blow away manually (via ``iface
add'') added interface addresses.

o When listening on a tcp server (diagnostic) socket, bind so that a
tcp46 socket is created -- allowing both IPv4 and IPv6 connections.

o When displaying ICMP traffic, don't display the icmp type twice.
When display traffic, display at least some information about unrecognised
traffic.

o Bump version

Inspired after filtering work by: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>


# 686e8c8b 02-Aug-2001 Brian Somers <brian@FreeBSD.org>

Add a ``nat punch_fw'' command for punching FTP and IRC DCC holes through
the firewall.


# 525b58c9 26-Jul-2001 Brian Somers <brian@FreeBSD.org>

Handle peer REQ/NAKs of >1500 byte MRUs when we have no preference.

MFC after: 3 days


# b5b15b9e 09-Jul-2001 Brian Somers <brian@FreeBSD.org>

Fix the type of the last arg to execl()

Obtained from: OpenBSD


# 88298994 08-Jul-2001 Brian Somers <brian@FreeBSD.org>

Add a ``nat proto'' command -- similar to natd(8)'s -redirect_proto switch.

MFC after: 3 weeks


# 80a18377 06-Jul-2001 Brian Somers <brian@FreeBSD.org>

Spell stateful properly

Inconsistently done by: brian
Spotted by: ru


# f2e587a3 03-Jul-2001 Brian Somers <brian@FreeBSD.org>

Silence some gcc warnings


# 7aab014b 02-Jul-2001 Brian Somers <brian@FreeBSD.org>

Do away with the ``err'' variable.

Inspired by: kris


# 0c50e528 01-Jul-2001 Kris Kennaway <kris@FreeBSD.org>

Silence some of the -Wnon-const-format warnings and add __printflike()
to a function prototype which needs it.

Approved by: brian
MFC After: 2 weeks


# 6cf6ee76 18-Jun-2001 Brian Somers <brian@FreeBSD.org>

Add support for stateful MPPE (microsoft encryption) providing
encryption compatibility with Windows 2000. Stateful encryption
uses less CPU but is bad on lossy transports.

The ``set mppe'' command has been expanded. If it's used with any
arguments, ppp will insist on encryption, closing LCP if the other
end refuses.

Unfortunately, Microsoft have abused the CCP reset request so that
receiving a reset request does not result in a reset ack when using
MPPE...

Sponsored by: Monzoon Networks AG and FreeBSD Services Limited


# c8b9fb53 18-Jun-2001 Brian Somers <brian@FreeBSD.org>

Handle hardware-imposed MTU/MRU limitations. PPPoE will no longer
allow MRU/MTU negotiations to exceed 1492.

Add an optional ``max'' specifier to ``set m[rt]u'', ie.

set mtu max 1480

Bump the ppp version number.

Sponsored by: Monzoon Networks AG and FreeBSD Services Limited


# 65309e5c 13-Jun-2001 Brian Somers <brian@FreeBSD.org>

Convert IIJ copyrights to BSD copyrights.

Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp>


# 03a2501a 04-Apr-2001 Brian Somers <brian@FreeBSD.org>

When we change the interface MTU, run through the routing table and tweak
all route MTUs too.


# 2fc2f705 03-Feb-2001 Brian Somers <brian@FreeBSD.org>

Untangle some cunfusion between the CLOSE_STAYDOWN, CLOSE_LCP and
CLOSE_NORMAL meanings. CLOSE_NORMAL doesn't change the currently
required state, the others do. This should stop ppp from entering
DATALINK_READY when LCP shutdown doesn't end up happening cleanly.

Bump our version number to reflect this change.


# 37b8a5c7 28-Jan-2001 Brian Somers <brian@FreeBSD.org>

Only remove socket files with ``set server open''.
Only show the mask in ``show bundle'' when it's been specified.
Complain about unexpected arguments after ``set server {none,open,closed}''
Log re-open failures as warnings rather than phase messages.
Fix some markup for the ``set server'' man page description.


# 74457d3d 25-Jan-2001 Brian Somers <brian@FreeBSD.org>

Allow ``set server closed'' to close the diagnostic socket.
Allow ``set server open'' to re-open the diagnostic socket.
Handle SIGUSR1 by re-opening the diagnostic socket
When receiving SIGUSR2 (and in ``set server none''), don't forget the
socket details so that ``set server open'' and SIGUSR1 open it again.

Don't create the diagnostic socket as uid 0 ! It's far to dangerous.


# 94d7be52 28-Nov-2000 Brian Somers <brian@FreeBSD.org>

Add ``enable/disable tcpmssfixup'', defaulting to enabled.

Suggested by: julian
Hijacked from: ru (ports/net/tcpmssd)


# 7f03ca53 29-Oct-2000 Brian Somers <brian@FreeBSD.org>

Add ``all'' logging.

Submitted by: eivind


# 2388e045 29-Oct-2000 Brian Somers <brian@FreeBSD.org>

Bump our version to reflect the recent MPPE additions (and ccp struct
size change).


# a8d604ab 29-Oct-2000 Brian Somers <brian@FreeBSD.org>

Add MPPE and MSChap v2 support (denied and disabled by default)

Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>


# 1a0f89e0 06-Sep-2000 Brian Somers <brian@FreeBSD.org>

Spelling police

Submitted by: des


# 106ae3d0 30-Aug-2000 Brian Somers <brian@FreeBSD.org>

Complain about invalid arguments passed to ``set ifaddr''


# 68602c3e 17-Aug-2000 Brian Somers <brian@FreeBSD.org>

Make -DNOSUID (or -DPPP_NOSUID) possible to build ppp without SUID
capabilities.


# c1a6c9e2 17-Aug-2000 Brian Somers <brian@FreeBSD.org>

Warn that the ``alias'' command is depricated.
We still process it for now though.


# ebe96675 16-Aug-2000 Brian Somers <brian@FreeBSD.org>

setproctitle() doesn't need to be called with root privs, so move
it from id.c into defs.c


# 91cbd2ee 15-Aug-2000 Brian Somers <brian@FreeBSD.org>

Maintain input and output throughput averages and choose the highest
of the two when calculating the MP throughput average for the ``set
autoload'' implementation.

This makes more sense as all links I know of are full-duplex. This
also means that people may need to adjust their autoload settings
as 100% bandwidth is now the theoretical maximum rather than 200%
(but of course, halfing the current settings is probably not the
correct answer either!).

This involves a ppp version bump as we need to pass an extra
throughput array through the MP local domain socket.


# 11572abf 14-Aug-2000 Brian Somers <brian@FreeBSD.org>

Calculate the average link throughput using a counter based on the
cumulative total of all active links rather than basing it on the
total of PROTO_MP traffic.

This fixes a problem whereby Cisco routers send PROTO_IP packets only
when there's only one link (hmm, what a good idea!).


# 1038894e 18-Jul-2000 Brian Somers <brian@FreeBSD.org>

Support link identification from rfc1570
Two new commands are available; ``ident'' and ``sendident''.


# 98251667 07-Jul-2000 Brian Somers <brian@FreeBSD.org>

o Log the (payload/size) of all packet types, not just TCP packets

o If the new ``filter-decapsulation'' is enabled, delve into UDP packets
that contain 0xff 0x03 as the first two bytes, and if we recognise it
as PROTO_IP, decapsulate it for the purpose of filter checking.

If we recognise it as PROTO_<anything else> mention this for logging
purposes only.

This change is aimed at people running PPPoUDP where the UDP traffic is
being sent over another PPP link. It's desireable to have the top level
link connected all the time, but to have the bottom level link capable
of decapsulating the traffic and comparing the payload against the filters,
thus allowing ``set filter dial ...'' to work in tunnelled environments.

The caveat here is that the top ppp cannot employ any compression layers
without making the data unreadable for the bottom ppp. ``disable deflate
pred1 vj'' and ``deny deflate pred1 vj'' is suggested.


# 86c5e1ea 19-Jun-2000 Brian Somers <brian@FreeBSD.org>

Remove ``nat pptp'' as this is now done transparently by libalias.


# 6c1d6731 10-Jun-2000 Brian Somers <brian@FreeBSD.org>

Add ``set ifqueue'' to control the size of the outgoing packet
queue. Doing ``set ifqueue 0'' and ``set urgent none'' will allow
full use of luigi's WF2Q code.

Requested by: luigi


# 4c240437 08-Jun-2000 Brian Somers <brian@FreeBSD.org>

Allow ``set urgent none'' to disable all urgent ports and IPTOS_LOWDELAY
prioritisation.

Requested by: luigi


# e9d0dd0a 31-Mar-2000 Brian Somers <brian@FreeBSD.org>

Allow authname to be changed at any phase, just emit a warning
if it's not DEAD or ESTABLISH


# b7d8533c 31-Mar-2000 Brian Somers <brian@FreeBSD.org>

Add the ``nat target'' command.


# 2a30e2ac 13-Mar-2000 Brian Somers <brian@FreeBSD.org>

Understand environment variables in commands

Submitted by: Mark Knight <markk@knigma.org>


# d568d6c4 13-Mar-2000 Brian Somers <brian@FreeBSD.org>

Add the ``resolv'' command for telling ppp how to deal with resolv.conf.
You can now ``resolv restore'' in ppp.linkdown !
Add DNS0 and DNS1 macros.


# 10e629b9 13-Mar-2000 Brian Somers <brian@FreeBSD.org>

Introduce LOCALNAT and LOCALRAD defines so that the sources can stay
exactly the same in FreeBSD & OpenBSD despite libalias and libradius
being local to the ppp sources under OpenBSD.


# 52c9ca19 13-Mar-2000 Brian Somers <brian@FreeBSD.org>

Add ``set log dns'' to log DNS QUERY packets.

This is invaluable for dial-on-demand connections...
In ppp.linkup:

set log -dns -tcp/ip

and in ppp.linkdown

set log +dns +tcp/ip

giving a much better account of why the link came up.


# a19a5c02 29-Dec-1999 Brian Somers <brian@FreeBSD.org>

Correct usages of getuid() and geteuid()

Pointed out by: billf


# 5b78bdf8 27-Dec-1999 Brian Somers <brian@FreeBSD.org>

Don't allowt '#' as a comment when it's embedded in quotes:

set something "xxx yyy # zzz" aaa

shouldn't be interpreted as

set something "xxx yyy" aaa


# abab7303 22-Dec-1999 Brian Somers <brian@FreeBSD.org>

Don't munge ``set dial|login|logout|hangup'' arguments before
ExpandString() has a chance to do its own substitutions.


# ef0a4849 20-Dec-1999 Brian Somers <brian@FreeBSD.org>

Add missing linefeed.


# c39aa54e 20-Dec-1999 Brian Somers <brian@FreeBSD.org>

Notice and warn about unterminated quoted strings in commands.
The entire command is ignored if the syntax is invalid...


# cbee9754 30-Nov-1999 Brian Somers <brian@FreeBSD.org>

Change the way we transfer links (again). The previous
method avoided all race conditions, but suffered from
sometimes running out of buffer space if enough clients
were piled up at the same time.

Now, the client pushes the link descriptor, one end of a
socketpair() and the ppp version via sendmsg() at the
server. The server replies with a pid. The client then
transfers any link lock with uu_lock_txfr() and writev()s
the actual link contents. The socketpair is now the only
place we need to have large socket buffers and the bind()ed
socket can keep the default 4k buffer while still handling
around 90 racing clients.


# fdc29d54 26-Nov-1999 Brian Somers <brian@FreeBSD.org>

Change ``set cd'' so that its default value is device specific. The
default is still 1 second for ttys, but is now 6 seconds for i4b (ISDN)
devices and 5 seconds for ethernet (PPPoE) devices.


# 2cb305af 24-Nov-1999 Brian Somers <brian@FreeBSD.org>

Rewrite the link descriptor transfer code in MP mode.

Previously, ppp attempted to bind() to a local domain tcp socket
based on the peer authname & enddisc. If it succeeded, it listen()ed
and became MP server. If it failed, it connect()ed and became MP
client. The server then select()ed on the descriptor, accept()ed
it and wrote its pid to it then read the link data & link file descriptor,
and finally sent an ack (``!''). The client would read() the server
pid, transfer the link lock to that pid, send the link data & descriptor
and read the ack. It would then close the descriptor and clean up.

There was a race between the bind() and listen() where someone could
attempt to connect() and fail.

This change removes the race. Now ppp makes the RCVBUF big enough on a
socket descriptor and attempts to bind() to a local domain *udp* socket
(same name as before). If it succeeds, it becomes MP server. If it
fails, it sets the SNDBUF and connect()s, becoming MP client. The server
select()s on the descriptor and recvmsg()s the message, insisting on at
least two descriptors (plus the link data). It uses the second descriptor
to write() its pid then read()s an ack (``!''). The client creates a
socketpair() and sendmsg()s the link data, link descriptor and one of
the socketpair descriptors. It then read()s the server pid from the
other socketpair descriptor, transfers any locks and write()s an ack.

Now, there can be no race, and a connect() failure indicates a stale
socket file.

This also fixes MP ppp over ethernet, where the struct msghdr was being
misconstructed when transferring the control socket descriptor.

Also, if we fail to send the link, don't hang around in a ``session
owner'' state, just do the setsid() and fork() if it's required to
disown a tty.

UDP idea suggested by: Chris Bennet from Mindspring at FreeBSDCon


# cf0a3940 17-Nov-1999 Brian Somers <brian@FreeBSD.org>

Fix ``set proctitle'' by using setproctitle().


# e6ee5b39 13-Nov-1999 Brian Somers <brian@FreeBSD.org>

Don't insist on 4 digit umasks in ``set server''.

Pointed out by: joerg


# 87c3786e 06-Nov-1999 Brian Somers <brian@FreeBSD.org>

Support PPPoE

Help (lots) from: julian, archie
Facilities from: ahebert@pubnix.net


# c116e0c0 25-Oct-1999 Brian Somers <brian@FreeBSD.org>

Introduce ``set logout''; another chat script. This is in preparation
for the abstraction of ``set dial'' and ``set hangup''.


# ccd587f0 26-Sep-1999 Brian Somers <brian@FreeBSD.org>

Support ``set cd off'' to tell ppp not to even look for carrier on the
device.


# b9391689 21-Sep-1999 Brian Somers <brian@FreeBSD.org>

Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.
The original report was due to a mis-installation of the NetBS
header files :-/

Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>


# 7e795ebe 20-Sep-1999 Brian Somers <brian@FreeBSD.org>

NetBSD has moved ``extern int errno;'' to signal.h :-/

Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>


# f02c2029 08-Sep-1999 Brian Somers <brian@FreeBSD.org>

Cosmetic:
alias_cmd -> nat_cmd after a repo-copy


# da477886 07-Sep-1999 Brian Somers <brian@FreeBSD.org>

Introduce a forth IP packet queue. Urgent packets with
ip_tos == IPTOS_LOWDELAY now get precidence over urgent
packets with ip_tos != IPTOS_LOWDELAY and non-urgent packets
with ip_tos == IPTOS_LOWDELAY.

Enhance the ``set urgent'' syntax to allow for urgent UDP
packets as well as urgent TCP packets.


# f914f3c0 06-Sep-1999 Brian Somers <brian@FreeBSD.org>

$FreeBSD$ -> __DATE__

This is probably more appropriate that $Date$ anyway


# 2735dafd 06-Sep-1999 Peter Wemm <peter@FreeBSD.org>

$Date$ -> $FreeBSD$


# 442f8495 03-Sep-1999 Brian Somers <brian@FreeBSD.org>

o Split the two IPCP queues into three - one for FSM data
(LCP/CCP/IPCP), one for urgent IP traffic and one for
everything else.
o Add the ``set urgent'' command for adjusting the list of
urgent port numbers. The default urgent ports are 21, 22,
23, 513, 514, 543 and 544 (Ports 80 and 81 have been
removed from the default priority list).
o Increase the buffered packet threshold from 20 to 30.
o Report the number of packets in the IP output queue and the
list of urgent ports under ``show ipcp''.


# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# d40a462a 21-Aug-1999 Brian Somers <brian@FreeBSD.org>

Allow authkey to be changed independently of the current phase.


# 67b072f7 19-Aug-1999 Brian Somers <brian@FreeBSD.org>

o Add the -foreground switch. This switch behaves like -background except
that ppp stays in the foreground.
o Add the -quiet switch to quieten ppps startup
o Add the -nat flag and discourage the use of the -alias flag. Both do
the same thing.
o Correct some nat usage strings.
o Change the internal ``alias'' command to ``nat''.


# dade2407 17-Aug-1999 Brian Somers <brian@FreeBSD.org>

Implement a minimum idle time value as an optional second argument
to ``set timeout''.
This is useful for situations where your minimum call charge is (say)
5 minutes (like mine is)


# 44e73c12 17-Aug-1999 Brian Somers <brian@FreeBSD.org>

Set the close-on-exec flag for all unused descriptors when
exec()ing other programs.


# ab2de065 05-Aug-1999 Brian Somers <brian@FreeBSD.org>

o Obsolete the undocumented ``set weight'' command.
o If we're using RADIUS and the RADIUS mtu is less than our
peers mru/mrru, reduce our mtu to this value for NetBSD too.
o Make struct throughput's sample period dynamic and tweak the ppp
version number to reflect the extra stuff being passed through
the local domain socket as a result (MP mode).
o Measure the current throughput based on the number of samples actually
taken rather than on the full sample period.
o Keep the throughput statisics persistent while being passed to
another ppp invocation through the local domain socket.
o When showing throughput statistics after the timer has stopped, use
the stopped time for overall calculations, not the current time.
Also show the stopped time and how long the current throughput has
been sampled for.
o Use time() consistently in throughput.c
o Tighten up the ``show bundle'' output.
o Introduce the ``set bandwidth'' command.
o Rewrite the ``set autoload'' command. It now takes three arguments
and works based on a rolling bundle throughput average compared against
the theoretical bundle bandwidth over a given period (read: it's now
functional).


# badaf18d 02-Aug-1999 Brian Somers <brian@FreeBSD.org>

Mention that ospf is a possible filter protocol.


# 1f9e5fe5 23-Jun-1999 Brian Somers <brian@FreeBSD.org>

Support `igmp' filters.
Mostly submitted by: Timo Geusch <freebsd@sleepycat.ukpeople.net>


# 5dfb9210 10-Jun-1999 Brian Somers <brian@FreeBSD.org>

Allow reserved substitution strings to be escaped by preceeding them
with a backslash.


# 7063995c 09-Jun-1999 Brian Somers <brian@FreeBSD.org>

Allow our endpoint discriminator to be enabled, disabled, accepted
and denied. This is necessary for some MP implementations that
get confused if you accept their endpoint discriminator but reject
their MRRU.


# 8fb106c6 09-Jun-1999 Brian Somers <brian@FreeBSD.org>

Use the correct pid when substituting PROCESSID.
Problem reported by: Amedeo Beck Peccoz <gea@gressoney.it>


# 68645f39 08-Jun-1999 Brian Somers <brian@FreeBSD.org>

Don't use static variables if we don't have to.


# f5a99677 05-Jun-1999 Brian Somers <brian@FreeBSD.org>

Correct the way ppp transfers links on the server side in MP
mode by padding out the ``struct device'' to the maximum
device size.
Bump the ppp version number to indicate the transfer format
change.

This should make MP over tty and udp devices functional again.


# 0d4fe7a8 02-Jun-1999 Brian Somers <brian@FreeBSD.org>

Mention physical and sync logging in the ``set log''
usage message.


# ac685e31 01-Jun-1999 Brian Somers <brian@FreeBSD.org>

Introduce the ``keep-session'' option. Refer to the man
page for details. This allows MP over non-tty devices where
the original ppp process must not exit (such as sshd-spawned
ppp sessions).


# 1d1fc017 31-May-1999 Brian Somers <brian@FreeBSD.org>

Remember if MYADDR or HISADDR is used in a filter add tweak all
filters any time either value changes.


# 4faec430 14-May-1999 Brian Somers <brian@FreeBSD.org>

Add ``show layers'' to see the protocol layering for a link.


# 6815097b 12-May-1999 Brian Somers <brian@FreeBSD.org>

Allow ``host:port/udp'' devices and support ``host:port/tcp'' as
being the same as the previous (still supported) ``host:port''
syntax for tcp socket devices.

A udp device uses synchronous ppp rather than async, and avoids
the double-retransmit overhead that comes with ppp over tcp (it's
usually a bad idea to transport IP over a reliable transport that
itself is using an unreliable transport). PPP over UDP provides
througput of ** 1.5Mb per second ** with all compression disabled,
maxing out a PPro/200 when running ppp twice, back-to-back.

This proves that PPPoE is plausable in userland....

This change adds a few more handler functions to struct device and
allows derivations of struct device (which may contain their own
data etc) to pass themselves through the unix domain socket for MP.
** At last **, struct physical has lost all the tty crud !

iov2physical() is now smart enough to restore the correct stack of
layers so that MP servers will work again.

The version number has bumped as our MP link transfer contents have
changed (they now may contain a `struct device').

Don't extract the protocol twice in MP mode (resulting in protocol
rejects for every MP packet). This was broken with my original
layering changes.

Add ``Physical'' and ``Sync'' log levels for logging the relevent
raw packets and add protocol-tracking LogDEBUG stuff in various
LayerPush & LayerPull functions.

Assign our physical device name for incoming tcp connections by
calling getpeername().

Assign our physical device name for incoming udp connections from
the address retrieved by the first recvfrom().


# 5d9e6103 08-May-1999 Brian Somers <brian@FreeBSD.org>

o Redesign the layering mechanism and make the aliasing code part of
the layering.

We now ``stack'' layers as soon as we open the device (when we figure
out what we're dealing with). A static set of `dispatch' routines are
also declared for dealing with incoming packets after they've been
`pulled' up through the stacked layers.

Physical devices are now assigned handlers based on the device type
when they're opened. For the moment there are three device types;
ttys, execs and tcps.

o Increment version number to 2.2
o Make an entry in [uw]tmp for non-tty -direct invocations (after
pap/chap authentication).
o Make throughput counters quad_t's
o Account for the absolute number of mbuf malloc()s and free()s in
``show mem''.
o ``show modem'' becomes ``show physical''.


# 7884358f 26-Apr-1999 Brian Somers <brian@FreeBSD.org>

Add support for NetBSD


# fe3094cd 25-Mar-1999 Brian Somers <brian@FreeBSD.org>

Allow port ranges in ``alias port''.


# 521e2a53 18-Mar-1999 Brian Somers <brian@FreeBSD.org>

Don't forget to fully initialise the configured values
for MYADDR and HISADDR in ``set ifaddr'' so that unspecified
values don't end up retaining their `width'.


# 50a63ab9 07-Mar-1999 Brian Somers <brian@FreeBSD.org>

Support PPTP via libalias (``alias pptp addr'').


# d318fe8e 07-Mar-1999 Brian Somers <brian@FreeBSD.org>

Support proxying & transparent proxying curtesy of libalias(3).
Order the alias command descriptions.
Order the SEE ALSO entries.


# c11e57a3 04-Mar-1999 Brian Somers <brian@FreeBSD.org>

Extend the ``set redial'' command to allow incremental
redial timeouts.


# bc76350e 03-Mar-1999 Brian Somers <brian@FreeBSD.org>

Correct some ntohl/htonl bogons in the netmask handling.
This was pretty harmless as netmasks on a POINTOPOINT
interface are pretty much ignored, but it looked funny.

Mention the configured netmask in ``show ipcp''.

Describe in more detail what a proxy arp entry is.


# 479508cf 26-Feb-1999 Brian Somers <brian@FreeBSD.org>

Allow control over the number of ConfigREQ & TermREQ attempts
that are made in each of the FSMs (LCP, CCP & IPCP) and the
number of REQs/Challenges for PAP/CHAP by accepting more arguments
in the ``set {c,ip,l}cpretry'' and ``set {ch,p}apretry'' commands.

Change the non-convergence thresholds to 3 times the number of configured
REQ tries (rather than the previous fixed ``10''). We now notice
repeated NAKs and REJs rather than just REQs.

Don't suggest that CHAP 0x05 isn't supported when it's not configured.

Fix some bugs that expose themselves with smaller numbers of retries:
o Handle instantaneous disconnects (set device /dev/null) correctly
by stopping all fsm timers in fsm2initial.
o Don't forget to uu_unlock() devices that are files but are not
ttys (set device /dev/zero).

Fix a *HORRENDOUS* bug in RFC1661 (already fixed for an Open event in state
``Closed''):
According to the state transition table, a RCR+ or RCR- received in
the ``Stopped'' state are supposed to InitRestartCounter, SendConfigReq
and SendConfig{Ack,Nak}. However, in ``Stopped'', we haven't yet
done a TLS (or the last thing we did is a TLF). We must therefore
do the TLS at this point !

This was never noticed before because LCP and CCP used not use
LayerStart() for anything interesting, and IPCP tends to go into
Stopped then get a Down because of an LCP RTR rather than getting a
RCR again.


# 26baedc5 25-Feb-1999 Brian Somers <brian@FreeBSD.org>

Parse IP addresses more securely - specifically, don't allow
a bum name to return as 0.0.0.0... we don't want ``delete xxx''
to delete the default route when xxx doesn't resolve.

Support IP number specifications as the host when specifying
a tcp-style device (rather than *just* hostnames).


# 5e315498 17-Feb-1999 Brian Somers <brian@FreeBSD.org>

Fully support both NT and LANMan CHAP type 0x80 as both
authenticator and authenticatee.


# 6b4286e0 15-Feb-1999 Brian Somers <brian@FreeBSD.org>

Wait by default for one second after the login script
is complete before checking carrier. If it's there,
the device supports carrier. If it's not it doesn't.

Add the ``set cd'' command for deciding how soon to check
for carrier, and for deciding if carrier is REQUIRED.

The default has changed: Pre 2.0 versions of ppp waited
for 1 second. Version 2 didn't wait, but this causes
problems with some (few?) modems that don't assert carrier
immediately on reporting CONNECT. The one second delay
is back now and can be removed with ``set cd 0''.

Bump the ppp version number in case this needs to be changed
again....


# 58330d7b 11-Feb-1999 Brian Somers <brian@FreeBSD.org>

When resending chap challenges, resend the same challenge
each time rather than making up a new one.

Increase the authname/authkey max sizes to 100 characters.

Allow ``authkey'' specifications beginning with ``!''.
When a challenge is received, the text following the
``!'' is executed as a program (expanding stuff in the same
way that ``sh'' and ``!bg'' do). The program is passed the
peer name, peer challenge and local ``authname'' on standard
input and is expected to output the name/key combination that
should be used to build the CHAP response.

This provides support for Secure ID cards (guess what I was
given at work recently!) using CHAP.

Examples will follow.


# 4026c366 28-Jan-1999 Brian Somers <brian@FreeBSD.org>

Version 2.0 > 2.1 to reflection RADIUS additions.


# 972a1bcf 27-Jan-1999 Brian Somers <brian@FreeBSD.org>

Initial RADIUS support (using libradius). See the man page for
details. Compiling with -DNORADIUS (the default for `release')
removes support.

TODO: The functionality in libradius::rad_send_request() needs
to be supplied as a set of routines so that ppp doesn't
have to wait indefinitely for the radius server(s). Instead,
we need to get a descriptor back, select() on the descriptor,
and ask libradius to service it when necessary.
For now, ppp blocks SIGALRM while in rad_send_request(), so
it misses PAP/CHAP retries & timeouts if they occur.

Only PAP is functional. When CHAP is attempted, libradius
complains that no User-Password has been specified... rfc2138
says that it *mustn't* be used for CHAP :-(

Sponsored by: Internet Business Solutions Ltd., Switzerland


# 87766c56 13-Dec-1998 Brian Somers <brian@FreeBSD.org>

Allow a variable as the first arg to ``set proctitle''.


# c2896afb 05-Nov-1998 Brian Somers <brian@FreeBSD.org>

Don't delete the primary interface address when
``iface clean'' is used in auto mode while there
are no active links.


# 7cf368eb 31-Oct-1998 Brian Somers <brian@FreeBSD.org>

Allow multiple systems (config labels) on the command
line and in the ``load'' & ``dial'' commands. The last
label loaded becomes the current label name.
Only require a label for -auto mode.


# 0f781a72 27-Oct-1998 Brian Somers <brian@FreeBSD.org>

Add ``set proctitle'' for changing argv[0]. All substitutions
are done in the same way as command execution.

For example, ``set proctitle USER INTERFACE PROCESSID'' would
be useful in a -direct profile for identifying who's connected.


# a237dcba 27-Oct-1998 Brian Somers <brian@FreeBSD.org>

Add ``PROCESSID'' as a constant expanded when running
commands.


# 3535dfb0 26-Oct-1998 Brian Somers <brian@FreeBSD.org>

Shuffle the iface-alias option so that's in alphabetical
order like the rest of the options.


# 3afe5ccb 26-Oct-1998 Brian Somers <brian@FreeBSD.org>

Add ``enable proxyall'' support. This adds proxy ARP entries
for every machine on every class C or smaller subnet that we
route to.
Add ``set {send,recv}pipe'' for controlling our socket buffer
sizes.
Mention the IP number with the problem in a few error messages.
All submitted by: Craig Leres <leres@ee.lbl.gov>
Modified slightly by: me


# 17871c5f 26-Oct-1998 Brian Somers <brian@FreeBSD.org>

Fix the interface alias code. Previously, I was expecting something
like

tun0: flags=blah
10.0.0.1 -> 10.0.0.100
10.0.0.2 -> 10.0.0.100
10.0.0.3 -> 10.0.0.100

to DTRT, despite the SIOCAIFADDR for each new alias returning
-1 & EEXIST while adding the alias anyway. In real life, once
we have the second alias with the same destination, nothing will
route any more ! Also, because I was ignoring EEXIST, the
dynamic IP assignment code was assigning duplicate addresses
('cos it was being lied to by iface_inAdd()).

Now we have

tun0: flags=blah
10.0.0.1 -> 255.255.255.255
10.0.0.2 -> 10.0.0.100
10.0.0.3 -> 255.255.255.255

This works - stuff bound to 10.1 & 10.3 will be considered alive
by the kernel, and when they route back to the tun device, the
packets get aliased to 10.2 and go out to 10.100 (as with the
original plan).

We still see the EEXIST in SIOCAIFADDR, but ignore it when our
destination is 255.255.255.255, assuming that the alias *was*
actually added.

Additionally, ``iface add'' may now optionally be given only
the interface address. The mask & destination default to
255.255.255.255.


# 9b5f8ffd 23-Oct-1998 Brian Somers <brian@FreeBSD.org>

Loosen our restrictions on setting enddisc, mrru,
shortseq, authname and authkey.

o Auth{name,key} may additionally be set in PHASE_ESTABLISH.
o The others may be set in PHASE_ESTABLISH as long as no links
have yet reached DATALINK_LCP.


# 8fa6ebe4 21-Oct-1998 Brian Somers <brian@FreeBSD.org>

Solve the ``first connection'' problem that occurs on
demand-dial links with dynamic IP numbers where the program
that causes the dial bind()s to an interface address that is
subsequently changed after ppp negotiation.

The problem is defeated by adding negotiated addresses to the
tun interface as additional alias addresses and providing a set
of ``iface'' commands for managing the interface. Libalias is
also required (and what a name clash!) - it happily IP-aliases
the address so that the source is that of the primary (negotiated)
interface and un-IP-aliases it on the way back.

An ``enable iface-alias'' is done implicitly by the -alias command
line switch. If -alias isn't given, iface-aliasing is disabled by
default and can't be enabled 'till an ``alias enable yes'' is done.
``alias enable no'' silently disables iface-alias.

So, for dynamic-IP-type-connections, running ``ppp -alias -auto blah''
will work for the first connection, although existing bindings will
not survive a disconnect/connect as the TCP peer will be trying to
send to the old IP address - the packets won't route.

It's now a lot easier to add IPXCP to ppp with minor updates to
the new iface.[ch] (if anyone ever gets 'round to it).

It's also now possible to manually add interface aliases with
something like ``iface add 1.2.3.4/24 5.6.7.8''. This allows
multi-homed ppp links :-)


# 571b60bf 16-Oct-1998 Brian Somers <brian@FreeBSD.org>

Move help displays left one column to avoid problems with
broken terminals that can't handle 80 columns followed by
a linefeed.
Pointed out by: bde@FreeBSD.org


# 1595bacd 16-Sep-1998 Brian Somers <brian@FreeBSD.org>

Sync with OpenBSD ifdefs


# 131ef891 29-Aug-1998 Brian Somers <brian@FreeBSD.org>

Add the following word substitutions when running a shell
command:
AUTHNAME: The local authname
ENDDISC: The local endpoint discriminator
LABEL: The configuration label in use
PEER_ENDDISC: The peers endpoint discriminator
USER: The peers authname


# 080a2247 29-Aug-1998 Brian Somers <brian@FreeBSD.org>

Allow the use of HISADDR, MYADDR and INTERFACE as words
embedded in the args of a "shell" or "!bg" command, and
only accept upper case versions.

We can now do:
! sh -c "ifconfig INTERFACE >/tmp/myfile"


# e227fded 29-Aug-1998 Brian Somers <brian@FreeBSD.org>

Mention ``cbcp'' in ``set log ?''


# 37d818fb 26-Aug-1998 Brian Somers <brian@FreeBSD.org>

Fix some OpenBSD/alpha warnings


# 5a72b6ed 26-Aug-1998 Brian Somers <brian@FreeBSD.org>

Put the IP buffer queues into struct ipcp.
Forgotten by: me


# 6f8e9f0a 25-Aug-1998 Brian Somers <brian@FreeBSD.org>

If we've got a full output buffer queue and cannot send
anything for two mintues (see ``set choked'' and ``show
bundle''), nuke the ip, mp and link level buffer queues.

This should fix problems where ``ppp -auto'' seems to stop
responding after failing to connect to the peer a few times.


# 92b09558 07-Aug-1998 Brian Somers <brian@FreeBSD.org>

o Support callback types NONE, E.164, AUTH and CBCP.
(see the new ``set callback'' and ``set cbcp'' commands)
o Add a ``cbcp'' log level and mbuf type.
o Don't dump core when \T is given in ``set login'' or
``set hangup''.
o Allow ``*'' and blanks as placeholders in ppp.secret and
allow a fifth field for specifying auth/cbcp dialback
parameters.
o Remove a few extraneous #includes
o Define the default number of REQs (restart counter) in defs.h
rather than hardcoding ``5'' all over the place.
o Fix a few man page inconsistencies.


# c31ac0b3 31-Jul-1998 Brian Somers <brian@FreeBSD.org>

Always dial immediately on ``open'', ``dial'' and ``call''.
We don't need a ``!''.


# ba23f397 29-Jul-1998 Brian Somers <brian@FreeBSD.org>

Allow an optional ``!'' in the open, dial & call commands.
When used, the redial timer is ignored and the modem is
opened immediately.


# 2062443f 28-Jul-1998 Brian Somers <brian@FreeBSD.org>

Silence ``Network unreachable'' warnings when using
``add .... HISADDR''. The network will never be
reachable at this point unless we're in -auto or reading
the command from ppp.linkup.

We can now run the following lines and get the expected
results:

set ifaddr 1.2.3.4/0 5.6.7.8/0
add default HISADDR

where a route is added immediately in auto mode and the
whole thing is delayed 'till the IP numbers have been
agreed in other modes.

Essentially, ppp.linkup is no longer required.


# 3b09372a 11-Jul-1998 Brian Somers <brian@FreeBSD.org>

Correct enable/disable handling (broken when ironing out
32/64 bit issues recently).


# 0dcb215a 04-Jul-1998 Brian Somers <brian@FreeBSD.org>

Don't require context when there's only one link
for ``open lcp''


# 274211d7 04-Jul-1998 Brian Somers <brian@FreeBSD.org>

Version 2.0-beta becomes 2.0 :-)


# 3a2e4f62 27-Jun-1998 Brian Somers <brian@FreeBSD.org>

o Fix remaining sizeof problems for 64 bit machines.
o Allow ``set ....'' when we have multiple links but aren't in
multilink mode.
o Do a TLS when we receive a ``Open'' event in ``Closed'' state,
despite the rfc state transition table. This is clearly an
error in the RFC as TLS cannot have yet been called (without
TLF) in the ``Closed'' state.
I've posted a message to comp.protocols.ppp for confirmation.


# 10a9be1e 27-Jun-1998 Brian Somers <brian@FreeBSD.org>

Remove redundant includes


# 615ad4f9 27-Jun-1998 Brian Somers <brian@FreeBSD.org>

Don't dlopen()/dlsym() libalias, use it in the same way
as the rest of the world uses libraries.


# 897f9429 25-Jun-1998 Brian Somers <brian@FreeBSD.org>

Add ``ipcp'' as an optional argument to ``open'', and make
open capable of re-negotiatiating the various layers.

It is now possible to change various link options and then
re-open the relevant layer, making the changes effective -
for example, switching off VJ compression or starting ECHO
LQRs on-the-fly.


# 09206a6f 19-Jun-1998 Brian Somers <brian@FreeBSD.org>

Create & use fsm2initial(), a function to bring a
state machine back to ST_INITIAL without going
through any unnecessary TLS/TLF pairs.


# c12b7867 16-Jun-1998 Brian Somers <brian@FreeBSD.org>

o Allow ``set mrru'' or ``set mrru 0'' to disable
multi-link mode.
o Fix a typo in the ``set mrru'' description.


# a33b2ef7 16-Jun-1998 Brian Somers <brian@FreeBSD.org>

Change some log levels. ALERTs are only logged when
something that can't happen happens or when everyone
needs to know. ERRORs are only logged when something
unexpected happens.


# 899011c4 16-Jun-1998 Brian Somers <brian@FreeBSD.org>

Don't bring the modem offline or hangup when ``down lcp''
is done. Instead, behave like ``close lcp''.


# c9e11a11 15-Jun-1998 Brian Somers <brian@FreeBSD.org>

Fix a rather nasty use of `static'. This caused a SEGV
when running ``link * load label'' as we ended up recursing
back into command_Interpret after nuking our command arg list.


# 30291ffb 15-Jun-1998 Brian Somers <brian@FreeBSD.org>

Give ``load'' optional context. It's now possible to
``link 1,2,3 load label'' for people that want to set
up their links in a more mpd-like manner.


# 9c81b87d 15-Jun-1998 Brian Somers <brian@FreeBSD.org>

Make `close lcp' just close the LCP layer and not hangup. This is
useful for slirp users that wish to get their shell back after the
ppp session. `close' with no args still hangs up as expected.
Required by: jmz


# 41dbe0c7 12-Jun-1998 Brian Somers <brian@FreeBSD.org>

Add the ``clear'' function.
Mostly submitted by: "Stephane E. Potvin" <sepotvin@videotron.ca>


# ff0f9439 12-Jun-1998 Brian Somers <brian@FreeBSD.org>

o Maintain a link-type mask for open datalinks as well as
for all datalinks in a bundle. Ppp now deals correctly
with link types that are changed while open
o When changing the type of the last AUTO link, only clear
the interface if we're not in PHASE_NETWORK. This allows
us to switch to -ddial mode while we have a connection
without suddenly unexpectedly throttling ourselves by
clearing the interface configuration.
Problem area noted by: Aaron Jeremias Luz <aaron@csh.rit.edu>


# 5264ca02 09-Jun-1998 Brian Somers <brian@FreeBSD.org>

Fix a couple of warnings noted with -Wall on FreeBSD-2.1.5.
Pointed out by: Charlie Sorsby <crs@hgo.net>


# 645b7985 08-Jun-1998 Brian Somers <brian@FreeBSD.org>

Correct ``set server'' usage and add mention that ``set ns'' changed
in README.changes.
Suggested by: stuart henderson <stuart@internationalschool.co.uk>


# 1c16aba2 06-Jun-1998 Brian Somers <brian@FreeBSD.org>

Make ``set ? log'' more verbose.
Suggested by: Paul Dufresne <dufrp@oricom.ca>


# 81358fa3 29-May-1998 Brian Somers <brian@FreeBSD.org>

o Make modes consistent throughout ppp. The same strings are used
in `set mode', `allow modes', on the command line and when
outputting mode names. The strings are matched so that only
enough characters to uniquely identify the string are required,
so you can now

ppp -a mylabel (for auto mode)
ppp -b mylabel (for background mode)
ppp -dd mylabel (for direct dial mode)

etc.
o Make -ddial dial when specified on the command line (oops).
Pointed out by: Alex <garbanzo@hooked.net>


# 04eaa58c 20-May-1998 Brian Somers <brian@FreeBSD.org>

o Add `set autoload'. You can now set the minimum and maximum
thresholds (in terms of queued packets for a period of time)
where -auto links will be brought up and down. By default,
all auto links come up when we reach NETWORK phase and never
go down.
o Display current autoload state in `show bundle'.
o Disable the idle timer as soon as it's called.
o Disable the idle and autoload timers when exiting (in case
we're abending).


# 368da0a9 19-May-1998 Brian Somers <brian@FreeBSD.org>

o Indicate which commands require context and which have optional
context in the `help' text.
o Remove some redundant code.
o Fix some comments.


# 61bd517d 16-May-1998 Brian Somers <brian@FreeBSD.org>

Don't log the password in ``set server''.


# 58d55334 16-May-1998 Brian Somers <brian@FreeBSD.org>

Add the `rename' command for renaming links.


# dd0645c5 15-May-1998 Brian Somers <brian@FreeBSD.org>

o Add the `set mode' command for change a links current mode. It
is not possible to switch to or from dedicated or direct mode,
but all other combinations are ok (eg. -auto -> -ddial).
o Cope with the fact that commands with optional context may not
be able to obtain a link with command_ChooseLink() (if all links
have been deleted for example).
o Allow `clone'ing in non-multilink mode. We may for example want
to configure two links in unilink mode and dial them both, using
the one that comes up first. It's also possible to rename
``deflink'' by cloning it, deleting the original, then setting
the mode of the new link.


# 0a1b5c9d 15-May-1998 Brian Somers <brian@FreeBSD.org>

o Activate link-level CCPs in multilink mode, by bringing them
into the ST_STOPPED state.
o Allow an optional ccp|lcp argument to `down'. The default is
still lcp (as before). You can now call down with no context
in multilink mode, in which case it'll down the multilink ccp
or the entire bundle (*very* rude).
o Allow an optional `!' after `close ccp' (close ccp!) to tell
ccp to stay in the CLOSED state after the terminate ACK. The
default is now to re-enter STOPPED so that the peer can bring
the layer back up if desired.
o Always handle proto-compressed packets, even if we've agreed
(in LCP) that the peer will not send us 1 byte protocols.
If the peer violates the LCP agreement, log it to the HDLC
log.
o Fix some comments.


# 52ff8cac 10-May-1998 Brian Somers <brian@FreeBSD.org>

Allow /nn specifications in the `add' command.
Suggested by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>

It's now possible to

add myaddr 127.0.0.1 (add myaddr 255.255.255.255 127.0.0.1)
add hisaddr/24 hisaddr (add hisaddr 255.255.255.0 hisaddr)
add 0 hisaddr (add 0 0 hisaddr)
add default hisaddr (add 0 0 hisaddr)


# 846af6dc 08-May-1998 Brian Somers <brian@FreeBSD.org>

o When specifying the diagnostic port (`set server'), replace
the first ``%d'' in the unix-domain socket name with the
current interface unit number. In the case of tcp ports, allow
a ``+'' prefix to add the unit number to the specified port
number.
o Remove all mention of SIGUSR1 (was already #ifdef'd out). We
can't create diagnostic sockets on-the-fly with a signal any
more because there's no way of specifying the password without
confusing matters with the previous ppp.secret scenario.


# b3e3e12e 08-May-1998 Brian Somers <brian@FreeBSD.org>

Make the `link' and `clone' commands understand a comma-separated
list of links, and make `link' understand `*' for all links. This
allows (for example):

clone 1,2,3,4,5
link 1,3 open
link 2,4,5 rm
close
link * rm


# faefde08 06-May-1998 Brian Somers <brian@FreeBSD.org>

Categorize the fields in struct bundle, and make the tunnel
device speed available in ``show bundle''.


# 610b185f 05-May-1998 Brian Somers <brian@FreeBSD.org>

Create `struct sticky_route'.

Any `add' or `delete' command that uses MYADDR or HISADDR
will be added to the sticky route list (show ipcp). When
MYADDR or HISADDR change due to IPCP negotiations, and if
`sroutes' is enabled (the default), all sticky route
entries are updated in the routing table.

The end result is that `add default hisaddr' will ``stick'',
as will ``add myaddr 255.255.255.255 127.0.0.1'' and
``add 1.2.3.4 255.255.255.0 hisaddr''.


# dd7e2610 01-May-1998 Brian Somers <brian@FreeBSD.org>

Cosmetic: Make our external function names consistent.


# b762af4f 01-May-1998 Brian Somers <brian@FreeBSD.org>

o Explicitly set the close-on-exec flag of descriptor 3 before
exec()ing. Tidy up file dups in general prior to exec().
This prevents our tun device (fd 3) from staying open (and
configured) despite handing off all it's links and exiting
(because ``cat'' holds it open).
o Don't bother SIG_DFL'ing signals before exec() as they're
already trapped with specific handlers and will be handled
correctly by the exec.
o Use values from paths.h for "/dev/" and "/dev/tty".
o Don't assert() in physical.c.


# 47723d29 01-May-1998 Brian Somers <brian@FreeBSD.org>

o Use two `cat' processes to connect the modem to an
already-running ppp.
Suggested by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
o Use _PATH_DEVNULL rather than "/dev/null"
o Be more paranoid about nuking running timers when
transferring links.


# 6f384573 30-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Create a new ``timer'' log level. This lets us ``set
log debug'' without filling our filesystem/screen with
junk that we don't really want to see.
o change PHYS_STDIN to PHYS_DIRECT - we can handle incoming
connections that aren't on STDIN_FILENO now.
o Allow return values from our FSM LayerUp functions. If
LayerUp() fails, the FSM does an immediate FsmDown() without
calling the fsm_parent's Layer{Up,Down} functions.
o Clear the close-on-exec flag of file descriptor 3 when executing
chat programs so that our documented ability to communicate with
/dev/tty via that descriptor works. Also document it as
descriptor 3, not 4 :-O
o Allow a ``rm'' command as an alias for ``remove''.
o Fix the bind()/connect()/accept() calls made by the MP server.
o Create bundle_SendDatalink() and bundle_ReceiveDatalink().
This allows `struct datalink's to flatten themselves, pass
through a pipe (read: the eye of a needle !) and come alive
at the other end. The donator then fork()s & exec()s pppmpipe,
``passing'' the connection to another ppp instance.

*** PPP NOW TALKS MULTILINK :-))) ***

Our link utilization is hideous, and lots of code needs
tidying still. It's also probably riddled with bugs !
It's been tested against itself only, and has hung once,
so confidence isn't high....


# 107d62e7 26-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Don't limit our tun device number to 256. As long as there's
another /dev/ entry, keep trying to open them.
o Don't allow ``open ccp'' if lcp isn't open.


# e43ebac1 25-Apr-1998 Brian Somers <brian@FreeBSD.org>

Make gcc-2.8.1 build ppp cleanly.
Support OpenBSD again.


# 6a596579 25-Apr-1998 Brian Somers <brian@FreeBSD.org>

Quieten gcc-2.8.1


# 643f4904 24-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Defer setting up pap/chap based IP numbers & labels until after
we've determined if we're going to join another ppp invocation.
o Make ``show link'' show all link details, and ``show links''
just give a list of links and their current status.
o Show our current label in ``show bundle''.
o Allow link cloning and removal as soon as our MRRU is set.
o Make ``show lcp'' require context as nothing will ever change
in our MP LCP (it's auto-configured as per rfc1990).
o Initialise our LQM owner in hdlc_Init().
o Store our endpoint discriminator and authentication name at both
the datalink and multilink level and compare them when we've
finished AUTHENTICATE phase and before entering NETWORK phase.
If they don't match, close the link again.
Display the information in the appropriate ``show'' command.
o Initialise datalink::phone and datalink::fsmp.object properly
when we're cloning the link.
o Show which link we're passing LQRs on in our diagnostics.
o Reject endpoint discriminator REQs at the logical multilink
level.
o Remove the rest of our CARRIER and LINK logging setup.


# d47dceb8 24-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Remove LINK level logging.
o change the default link name to ``deflink'' rather
than ``default''.
o Prepend the link name to CCP and LCP FSM diagnostics.
o Protect against 0 length options in CCP and IPCP REQ
interpreters (already done for LCP).
o Allow optional context for the `show' command.
o Use MPs link when interpreting commands if the multilink
mrru is configured rather than when multilink is active.
This means that once we've ``set mrru xxx'', we then need
to ``link deflink show ccp'' etc if we want to do link-level
stuff (based on the command requiring optional or manditory
context).
o Use the ifconfig'd interface address in `set enddisc {ip,mac}'
if it's there, otherwise the configuration file value.


# 673903ec 23-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Initialise MP correctly depending on if we're the
first link in mp_Up().
o Bring MP and its CCP down when we enter phase TERMINATE,
and ditch everything in the incoming packet queue.
o Enable MRRU negotiation. Now, we can multilink
mode, but only with one physical link.
o Close the link if the peer PROTO REJs PROTO_MP.
o Prepend our protocol before passing a packet to
struct mp for fragmentation.
o Log info messages to DEBUG, not ERROR (oops).
o Align `show mp' output (again).


# 49052c95 22-Apr-1998 Brian Somers <brian@FreeBSD.org>

Negotiate MRRU, SHORTSEQ and ENDDISC. ENDDISC doesn't imply
multilink ('cos I've seen my ISP REQ it without multilink).

Setting MRRU is ifdef'd out until it's debugged and we can
merge -direct links with other running programs.

Fix MTU setting.


# 1ad3093b 19-Apr-1998 Brian Somers <brian@FreeBSD.org>

Correct the args passed to `shell'.


# ba081e43 18-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Allocate new CCP protocol options if they've been
enabled since we first REQ'd.
o Delete the allocated options when CCP is down (TLF).
o Clean the IPCP interface on the way down when we're
*not* in auto mode (rather than when we are) - typo.
o Don't produce two similar IpcpLayerUp messages.


# 8d9b9867 18-Apr-1998 Brian Somers <brian@FreeBSD.org>

Add the ``open'' command and expand ``close''. It's now
possible to ``close ccp'', change your compression algorithm,
then ``open ccp'' while the link is up without losing data.


# cdbbb6b5 17-Apr-1998 Brian Somers <brian@FreeBSD.org>

Cosmetic: Clean up warnings.


# 3edeb0c6 17-Apr-1998 Brian Somers <brian@FreeBSD.org>

Support client side DNS server negotiation, disabled
and denied by default (POLA).

o Remove ``enable'' msext. Now, doing a ``set nbns'' will
automatically enable a NBNS ACK/NAK rather than a REJ.
o Add accept|disable|deny|enable dns. If we ``accept'',
we'll tell the peer what our nameservers are (if he asks).
The values in resolv.conf can be overridden with the
``set dns'' command. If we ``enable'', we'll REQ using
our resolv.conf entries, and any NAKs are written back to
resolv.conf.
o Remove ``show msext'' and show the relevent IP numbers in
``show ipcp''.


# 63f98b41 16-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Understand ``syn'' and ``finrst'' in filter rules. This
is particularily useful when creating dial filters.
Original work by: Junichi SATOH (junichi@astec.co.jp)
o Parse a filter IP of ``0.0.0.0'' as having a width of 0,
not 32.
o Correct "set filter" usage message.
o Warn about bad filter names.
o Expand and correct a number of the man page sections.


# 1342caed 15-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Move the accept/deny/disable/enable globals either to the
bundle (non-negotiated vars) or to their respective IPCP,
LCP or CCP.
o Enable rolling throughput statistics by default.
o Remove the `display' command. These values now appear in
`show bundle', `show ipcp', `show ccp' and `show lcp'.
o Initialise auth name & key at bundle create time (oops).
o Rename pppd-deflate (the id-24 hack) to deflate24.
o Don't send both a REJ and a NAK to an IPCP or LCP REQ.
Favour the REJ (already done at the CCP level).
o Recurse in datalink_UpdateSet() when we change state, otherwise
we end up setting no descriptors and getting jammed in the
imminent select() instead of doing the dial/login/hangup.
o Display our CHAP encryption method despite being built with DES.
o Display VJ as not negotiated in ``show ipcp'' when necessary.


# 25092092 14-Apr-1998 Brian Somers <brian@FreeBSD.org>

Pass all command arguments around with struct cmdargs rather
than incrementing argv and decrementing argc. Now individual
functions can determine their caller. This also removes the
"prefix" hack in FindExec().


# c08717df 11-Apr-1998 Brian Somers <brian@FreeBSD.org>

Remove ``show timeout'' and ``show auth'' and add ``show bundle''.
Mention ``show timer'' in the man page.


# 99294c8b 10-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Fix chats expect-send-expect - it shouldn't be
expect-send-send !
o Say `disabled' rather than 0s in `show timeout'.
o Set all arguments in ``set device'' rather than just
the first (read: quotes aren't necessary).
o Set the device speed correctly (broken in last commit).


# 565e35e5 10-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Remove the `mode' global - it's now per physical device.
o Shuffle things that live at the datalink level into
``show link'' rather than ``show modem''.
o Make both ``show'' commands prettier and more consistent,
and display carrier status, link type and our name in
``show modem''.
o Show redial and reconnect information in ``show link''
and remove ``show redial'' and ``show reconnect''.
o Down the correct link in bundle_LinkLost().
o Remove stale -direct and -background links at the end
of our main loop, not when we know they're going. This
prevents unexpected pointer-invalidations...
o If we ``set server'' with the same values twice, notice
and don't moan about failure.
o Record dial script despite our link mode. The mode may
be changed later (next mod) :-) We never run scripts
in -direct and -dedicated modes.
o Make ``set server none'' functional again.
o Correct datalink state array so that we don't report an
``unknown'' state.
o Pass struct ipcp to IpcpCleanInterface, not struct fsm.
o Create TUN_PREFIX define rather than hard-coding in main.c
o prompt_TtyInit now handles a NULL prompt for -direct mode
rather than having to create one then destroy it uncleanly.
o Mention our mode in the "PPP Started" LogPHASE message.
o Bring all auto links up when we have something to send.
o Remove some redundant Physical_*() functions.
o Show which connection is running a command when logging
commands.
o Initialise throughput uptime correctly.


# 85602e52 07-Apr-1998 Brian Somers <brian@FreeBSD.org>

Remove MODE_ALIAS and add AliasEnabled() macro.
Remove IsInteractive().


# 2764b86a 06-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Move alias function pointers into loadalias.c
o Move Var*Version into command.c
o Remove struct pppVars (and there was much rejoicing) !
o Forward-decl some structs in .h files to avoid include
ordering requirements and remove a few more redundant
#includes.


# d24f017b 06-Apr-1998 Brian Somers <brian@FreeBSD.org>

Remove unused includes.


# cd7bd93a 05-Apr-1998 Brian Somers <brian@FreeBSD.org>

Add the `clone' and `remove' commands for creating and destroying
links.


# cfb7c5ff 04-Apr-1998 Brian Somers <brian@FreeBSD.org>

Initialise the local log mask.
Only do a prompt_TtyTermMode if we have a prompt.


# 833882f7 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Move VarMSChap into struct chap, and remove `set encrypt'
option. We never ask a client for MSChap when we've got
chap `enabled', and we dynamically answer using MSChap
if the peer demands it.
o Remove all of the bundle2*() series of functions except
bundle2datalink() as they're too expensive. The only
calls to bundle2datalink() are made from command.c when
determining context.
o Write to the correct modem in term mode, and check the
return value, dropping back to command mode if the write
fails.

Cosmetic:
Make the PPP COMMAND LIST section of the man page
prettier, better and more consistent. Alphabeticalise
all command lists and document missing commands.


# b6217683 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

Deglobalise `struct prompt':
o Our diagnostic socket has its password set in the `set socket'
line only (not in ppp.secret).
o Passwords are per server socket (*VarAuthKey are gone)
o Authority is per prompt (VarLocalAuth is gone).
o Local logging is per prompt.
o Add a `show who' command to see who's connected. No identd
routine - just a `where the connection came from' display.
o SIGUSR1 is disabled for now - we have no way of choosing a
password for the socket created :-(

Prompts are attached as a list of `struct descriptor's in
struct bundle, and serviced under the bundles descriptor
service routines. Ultimately, everything should be done
like this.

Cosmetic:
o alphabeticalise SRCS in Makefile.
o Add a few comments in command.h

TODO: Start checking that we don't overflow the descriptor sets
in select() now that we can have any number of descriptors.


# 8390b576 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Drop packets that fail the dial filter when we're in
phase DEAD. They'll almost definitely have timed out
by the time we dial anyway.
o Log dial filters again (LogTCPIP).
o Make DEBUG diagnostics for filter checking actually mean
something to the common observer.
o Do our best to keep any already-configured IP numbers at
IPCP negotiation time. We always first request our configured
IP, and if the peer asks for an invalid IP, we NAK with HISADDR

Cosmetic:
o Add a linefeed to the `set timeout' arg count error message.
o Log unacceptable address errors to LogPHASE if LogIPCP is
switched off.
o Fix ``destination system not found'' error message.
o Get out immediately if we get a fatal error before entering
the main loop.


# 92f4ff1c 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

Move authname and authkey into struct bundle and only allow
their alteration in PHASE_DEAD.
Remove redundant pppConfs array element.


# a0241060 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

Cosmetic:
Sort & tidy command lists.
Give help on command alias, not just command names.


# 0b3acc6e 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

Remove `set loopback' and `show loopback' and add
`enable loopback' and `disable loopback'. Re-write
the explaination of `enable idcheck'.


# cd9647a1 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Move default MRU, MTU, ACCMAP and OPENMODE config values into
struct lcp and display them in `show lcp'.
o Remove `show mru' and `show mtu' and make the data part of
`show lcp'. Also merge `set m[tr]u' and `set openmode'
implementations into the SetVariable function.
o `set timeout' only accepts the idle timer value as an argument.
o Move our lqr period into struct lcp, and create a `set lqrperiod'
command. Display it in `show lcp'.
o Remove VarRetryTimeout, and implement it at the LCP, PAP, CHAP,
CCP and IPCP levels, creating individual `set XXXretry' commands
for each. They must be separate because they have different
context requirements in multilink mode.
o Display default config values in `show ccp'.
o Tart the man page up a bit (wrt PPP/TCP, compression and LQR) and
explain the new commands.


# 3b0f8d2e 03-Apr-1998 Brian Somers <brian@FreeBSD.org>

o Move struct lcp and struct ccp into struct link.
o Remove bundle2lcp(), bundle2ccp() and bundle2link().
They're too resource-hungry and we have `owner pointers'
to do their job.
o Make our FSM understand LCPs that are always ST_OPENED
(with a minimum code that != 1).
o Send FSM code rejects for invalid codes.
o Make our bundle fsm_parent deal with multiple links.
o Make timer diagnostics pretty and allow access via ~t
in `term' mode (not just when logging debug) and
`show timers'. Only show timers every second in debug
mode, otherwise we get too many diagnostics to be useful
(we probably still do). Also, don't restrict ~m in term
mode to depend on debug logging.
o Rationalise our bundles' phases.
o Create struct mp (multilink protocol). This is both an
NCP and a type of struct link. It feeds off other NCPs
for output, passing fragmented packets into the queues
of available datalinks. It also gets PROTO_MP input,
reassembles the fragments into ppp frames, and passes
them back to the HDLC layer that the fragments were passed
from.
** It's not yet possible to enter multilink mode :-( **
o Add `set weight' (requires context) for deciding on a links
weighting in multilink mode. Weighting is simplistic (and
probably badly implemented) for now.
o Remove the function pointers in struct link. They ended up
only applying to physical links.
o Configure our tun device with an MTU equal to the MRU from
struct mp's LCP and a speed equal to the sum of our link
speeds.
o `show {lcp,ccp,proto}' and `set deflate' now have optional
context and use ChooseLink() to decide on which `struct link'
to use. This allows behaviour as before when in non-multilink
mode, and allows access to the MP logical link in multilink
mode.
o Ignore reconnect and redial values when in -direct mode and
when cleaning up. Always redial when in -ddial or -dedicated
mode (unless cleaning up).
o Tell our links to `staydown' when we close them due to a signal.
o Remove remaining `#ifdef SIGALRM's (ppp doesn't function without
alarms).
o Don't bother strdup()ing our physical link name.
o Various other cosmetic changes.


# 1e991daa 24-Mar-1998 Brian Somers <brian@FreeBSD.org>

Remove some more globals:
o int modem was unused.
o StateNames[] is now accessed via State2Nam()
o ipKeepAlive is no more. As a result, we must call FilterCheck()
twice if we're doing TCP/IP logging (once when we queue and log
the packet and once when we transmit it and need to know if the
idle timer should be reset), but this won't be the case
in normal life.


# 2f786681 20-Mar-1998 Brian Somers <brian@FreeBSD.org>

Make struct bundle into a sort of `struct descriptor'.
It does the fdsets/reads/writes for each of it's
datalinks.


# 03036ec7 17-Mar-1998 Brian Somers <brian@FreeBSD.org>

Make all CCP negotiation data dynamic and add a
``set deflate'' command to configure the DEFLATE
default window size.


# eaa4df37 16-Mar-1998 Brian Somers <brian@FreeBSD.org>

Move VJ compression state and stats into struct ipcp.


# 5ca5389a 16-Mar-1998 Brian Somers <brian@FreeBSD.org>

Move filter sets into struct bundle.


# 30c2f2ff 13-Mar-1998 Brian Somers <brian@FreeBSD.org>

Remove more globals


# 5828db6d 13-Mar-1998 Brian Somers <brian@FreeBSD.org>

Move the IPCP into struct bundle.


# a611cad6 13-Mar-1998 Brian Somers <brian@FreeBSD.org>

o Don't immediately reply to the first LQR thinking
it's a duplicate ('cos it compares with our initial
values).
o Move the LCP into struct datalink.


# c4c4aaac 12-Mar-1998 Brian Somers <brian@FreeBSD.org>

Add extraneous braces to stiffle warnings from gcc-2.8


# dc0fdb6b 12-Mar-1998 Brian Somers <brian@FreeBSD.org>

"dial" now may optionally have context.
Tidy up some LcpInfo uses.


# 879ed6fa 12-Mar-1998 Brian Somers <brian@FreeBSD.org>

De-staticise LQR information
Increment OutPackets for any packet - not just LQRs

MFC:
o Fix a few comment typos.
o Fix ``set timeout'' usage message and documentation.
o Change ifOutPackets, ifOutOctets and ifOutLQRs to `u_int32_t's
so that they wrap correctly.
o Put the LQR in network byte order using the correct struct size
(sizeof u_int32_t, not sizeof u_long).
o Wrap LQR ECHO counters correctly.
o Don't increment OutLQR count if the last LQR hasn't been replied
to.
o Initialise last received LQR in StartLqm.
o Don't start the LQR timer if we're `disabled' and `accepted'.
o Generate LQR responses when both sides are using a timer and
we're not going to send our next LQR before the peers max timeout.


# f830032f 11-Mar-1998 Brian Somers <brian@FreeBSD.org>

o Fix a few comment typos.
o Fix ``set timeout'' usage message and documentation.
o Change ifOutPackets, ifOutOctets and ifOutLQRs to `u_int32_t's
so that they wrap correctly.
o Put the LQR in network byte order using the correct struct size
(sizeof u_int32_t, not sizeof u_long).
o Wrap LQR ECHO counters correctly.
o Don't increment OutLQR count if the last LQR hasn't been replied
to.
o Initialise HisLqrData (last received LQR) in StartLqm.
o Don't start the LQR timer if we're `disabled' and `accepted'.
o Generate LQR responses when both sides are using a timer and
we're not going to send our next LQR before the peers max timeout.

LQR should now be fully functional.


# ab886ad0 09-Mar-1998 Brian Somers <brian@FreeBSD.org>

Move the idle timer into struct bundle. There's no
link-level idle timer for the moment.


# f9545805 09-Mar-1998 Brian Somers <brian@FreeBSD.org>

Move phone numbers into struct datalink.
Make "show modem" look a bit prettier.


# 3bf710a4 05-Mar-1998 Brian Somers <brian@FreeBSD.org>

o Move all device names into struct physical.
o Use the correct device name in -direct mode.
o Use a default list of "cuaa1, cuaa0" rather than
just cuaa1 and allow embedded spaces as separators.


# e2ebb036 28-Feb-1998 Brian Somers <brian@FreeBSD.org>

Do authentication at the datalink level, not the bundle level.
The bundle doesn't get a LayerUp 'till we're authenticated.

Introduce DATALINK_LCP and DATALINK_AUTH phases.


# f4768038 22-Feb-1998 Brian Somers <brian@FreeBSD.org>

o Remove the global CcpInfo. It's now part of the datalink.
Struct bundle will have its own struct ccp in the future
too.
o The ``set stopped'' command now requires context and doesn't
work on the IPCP FSM.
o Check if it's time to break out of our top level loop before
doing a select - otherwise, we'll select forever :-(
o Remove `struct link'::ccp (a temporary hack). It turns out
that IpStartOutput() calls link_Output() and link_Output()
incorrectly calls StartOutput() (really modem_StartOutput)
requiring the ccp knowledge so that it can call
IpStartOutput()... The end result is that the whole IP
output queue gets dumped into the modem output queue
and a pile of physical writes are done prematurely. This
makes the (original) code in main() actually work in that
it would not bother selecting() on the tun descriptor when
our modem queue length was 20 or greater. Instead, we now
make that decision based on the overall queue length.

This will need improvement later.


# 503a7782 20-Feb-1998 Brian Somers <brian@FreeBSD.org>

Shuffle around our FSMs a bit. This'll make it
easier to remove the CcpInfo, LcpInfo and IpcpInfo
globals.


# 63258dcc 18-Feb-1998 Brian Somers <brian@FreeBSD.org>

o Create `struct hdlc' - a part of struct physical.
o Move our LCP report timer into struct hdlc - it's really
a hdlc timer (fcs errors etc).
o Make `show hdlc' require context and make the output more
friendly.
o Remove all non-const globals from hdlc.c
o Output peer-rejected protocols by name - not just ones
that we reject.


# 9991562d 18-Feb-1998 Brian Somers <brian@FreeBSD.org>

Make ``show escape'' require context.
De-globalize EscMap[].


# 73a13b5c 17-Feb-1998 Brian Somers <brian@FreeBSD.org>

Cosmetic: Group configuration items in struct datalink.


# c7cc5030 17-Feb-1998 Brian Somers <brian@FreeBSD.org>

Add datalink state DATALINK_READY to indicate when the datalink
is available, but LCP hasn't yet been started. We get to this
state in ``term'' mode.
Remove PacketMode(). LCP startup and shutdown is now controlled
by the datalink.
Add ``show links'' command.
Make ``close'' capable of running with and without a context.
Make ``down'' require a context.
Make ``set parity'' and ``set rtscts'' use the correct context.


# 1b35f8f7 17-Feb-1998 Brian Somers <brian@FreeBSD.org>

Keep a handle on our current ``term'' in struct prompt
so that the `term' command works on the correct link.


# aef795cc 17-Feb-1998 Brian Somers <brian@FreeBSD.org>

Introduce the ``link'' command for controlling
individual links.


# c5a5a6ca 16-Feb-1998 Brian Somers <brian@FreeBSD.org>

Sort out (fix) the `term' command.
datalink_Up() can now be told to skip the dial/login/hangup
scripts and can be told whether to enter packet mode when
entering the DATALINK_OPENED state.


# e718d1d7 16-Feb-1998 Brian Somers <brian@FreeBSD.org>

Move the redial timeouts and max tries into struct datalink.


# abff9bae 16-Feb-1998 Brian Somers <brian@FreeBSD.org>

Move the reconnect timeout and max tries into struct datalink.


# 5b8b8060 16-Feb-1998 Brian Somers <brian@FreeBSD.org>

Move the dial, login and hangup scripts into struct datalink.
Don't set these scripts in -direct mode.
Always set reconnect_tries to zero for -direct mode.


# 3006ec67 15-Feb-1998 Brian Somers <brian@FreeBSD.org>

Create struct datalink.

This is a type of physical link that can chat and talk
LCP & CCP. A bundle contains a list of these (only one
in the list for the moment).

The datalink is a type of descriptor, and dials, enters
LCP (& does CCP), kicks the bundle when its FSMs do
something interesting and does the hangup chat script
on the way down. It also handles redials and reconnects.

There are lots of loose ends, and probably lots of bugs,
but the data structures are getting there !


# b6dec9f0 12-Feb-1998 Brian Somers <brian@FreeBSD.org>

Update to version 2.0-beta
Allow for NULL fd_sets in descriptor_UpdateSet()
Reimplement the entire chat module, creating
`struct chat' - a `type' of struct descriptor.
Remove CARRIER logging.
CONNECT logging now only logs "CONNECT" lines. CHAT logging
masks it with an entire log of the conversation.

Modem dialing is now asynchronous, including pauses
and timeouts :-)

The hooks in DoLoop() in main.c are *very* messy ! I'll have
to rewrite DoLoop fairly soon, so I don't care too much for the
moment. This code is pretty raw.


# 85b542cf 09-Feb-1998 Brian Somers <brian@FreeBSD.org>

Move the terminal/diagnostic socket stuff out of main.c
and into the new `prompt.c'. struct prompt is (of course)
a `sort' of descriptor.


# ea69f16a 09-Feb-1998 Brian Somers <brian@FreeBSD.org>

Typo police.


# 77ff88ad 09-Feb-1998 Brian Somers <brian@FreeBSD.org>

Make the server descriptor into a `sort' of struct descriptor.


# 42d4d396 09-Feb-1998 Brian Somers <brian@FreeBSD.org>

o Introduce struct descriptor.
This will ultimately be a member of a list of descriptors and
their handler functions on which we need to select() in the
main loop.
o Make struct physical into a `sort' of struct descriptor.


# 455aabc3 07-Feb-1998 Brian Somers <brian@FreeBSD.org>

o Hook the FSMs into our bundle.
o The FSM layering is now more sane.
o Move a lot of the NCP stuff into our ipcpstate rather than having it
in the bundle, including control of the configured IP addresses. We
don't need hacks like the global `linkup' variable any more as the
FSM decides when our ppp.link* files get run. This is going to eventually
be configurable based on FSM events anyway.
o Fix a few inconsistencies when both sides require authentication.
o We now have "Ppp..." and "PPp" prompts, reflecting authentication
and network phase. We don't print loads of spurious prompts as we
change phases any more.
o Our phase is part of the bundle now.
o Fix a bug where the FSM wasn't calling LayerFinish.
o Close the FSM down correctly with a signal rather than slamming it
down as if the line was dropped (the undocumented ``down'' command
is still available though).
o Remove the forgotten `tunno' variable and fix references to it.


# 83d1af55 05-Feb-1998 Brian Somers <brian@FreeBSD.org>

Isolate fsm callback functions
Derive {lcp,ipcp,ccp}state structures from struct fsm
where convenient.
Create bundle_Down() and remove LcpDown()


# 2289f246 05-Feb-1998 Brian Somers <brian@FreeBSD.org>

Move pppVars.physical into the bundle (for the moment).


# ecd5172a 05-Feb-1998 Brian Somers <brian@FreeBSD.org>

Shuffle names and args in modem.h


# 6140ba11 02-Feb-1998 Brian Somers <brian@FreeBSD.org>

Create `struct async' and make it part of `struct physical'.
This structure contains the asynchronous state of the physical
link.
Unfortunately, just about every .h file is included in every .c
file now. Fixing this can be one of the last jobs.


# 42e91bc7 02-Feb-1998 Brian Somers <brian@FreeBSD.org>

Cosmetic: Merge the `show vj' command into `show ipcp'
and make it prettier.


# 7a6f8720 02-Feb-1998 Brian Somers <brian@FreeBSD.org>

Create `struct bundle' - the top level control structure.
This structure will eventually contain a list of NCPs (currently
only IPCP is supported) and a list of physical `struct link's.
It will also derive from a struct link itself.
Make ModemTimeout() static - it's way to dangerous to be called
from outside !
Bump version to 1.9. Our first MP release should be 2.0.


# 7308ec68 30-Jan-1998 Brian Somers <brian@FreeBSD.org>

Move the global FSMs into their relevent structures.
IPCP, CCP and LCP are now just derived FSMs.
Comment each of the FSM implementations so that we can
tell what's going on.
Revise the state transitions so that CCP and IPCP actually
send terminate REQs when appropriate.

The OS & IPCP layers are still like spagetti (next job).


# 8c07a7b2 30-Jan-1998 Brian Somers <brian@FreeBSD.org>

Create `struct link' - the logical link from which
`struct physical' (and the future `struct logical')
are derived.


# 29e275ce 29-Jan-1998 Brian Somers <brian@FreeBSD.org>

o Move global/static IPCP data into IpcpInfo.
o Use INADDR_ANY and INADDR_BROADCAST instead of 0 and 0xffffffff
for IP addresses & masks.
o Move struct compreq into ipcp.c (it's none of anyone elses
business).
o Rename MAX_STATES to MAX_VJ_STATES.


# 63b73463 28-Jan-1998 Brian Somers <brian@FreeBSD.org>

Create a new MP branch for `multilink protocol'.

Do lots of initial shuffling and grouping.
Submitted by: Eivind Eklund <perhaps@yes.no>


# 1ae349f5 28-Jan-1998 cvs2svn <cvs2svn@FreeBSD.org>

This commit was manufactured by cvs2svn to create branch 'MP'.


# baef0a69 27-Jan-1998 Brian Somers <brian@FreeBSD.org>

Cosmetic:
Don't mention the authors name at startup. He's already credited
in the man page. Instead, make the message consistent with the
one given to the diagnostic port (and fix the grammar when entering
`term' mode).
Don't credit the zlib author in the man page as ppp isn't linked
directly with zlib (it's shared).
Mention when the OpenBSD port was first made available.


# 0c2bc41c 22-Jan-1998 Brian Somers <brian@FreeBSD.org>

Don't allow manual dialing unless in auto or interactive mode.


# 49b239e0 20-Jan-1998 Brian Somers <brian@FreeBSD.org>

Allow an optional delay when specifying "set openmode active".
The delay defaults to 1 sec (as it always has) unless we've done
a ~p in interactive mode or we've actually detected a HDLC frame.
This is now cleanly implemented (via async timers) so that it is
possible for LCP to come up despite the delay if an LCP REQ is
received.

This will hopefully solve situations with slow servers or slirp
scenarios (where ECHO is left on the port for a second or so before
the peer enters packet mode).

Also, ~p in interactive mode no longer changes the value of the default
openmode delay and -dedicated mode enters packet mode in the right state
according to the value of openmode.


# d1a3ea47 18-Jan-1998 Brian Somers <brian@FreeBSD.org>

Allow "set vj" for changing the default number of slots
and whether slot compression is requested.
Don't show current values with "show ipcp" if IPCP isn't
"opened".


# 3a70c9f7 11-Jan-1998 Brian Somers <brian@FreeBSD.org>

Make things work when sizeof(long) != 32 (hopefully)


# 86ca0623 10-Jan-1998 Brian Somers <brian@FreeBSD.org>

Pause according to the redial setting when dialing manually.
Pointed out by: Berend de Boer <berend@compuserve.com>


# 9c97abd8 04-Jan-1998 Brian Somers <brian@FreeBSD.org>

o Allow the use of HISADDR as the first arg to "add".
o Allow a forth argument in ppp.secret, specifying a new
label. This gives control over which section of
ppp.link{up,down} is used based on the authenticated user.
o Support random address ranges in ppp.secret (not just in ppp.conf).
o Add a AUTHENTICATING INCOMING CONNECTIONS section to the man page.
o Add a bit more about DEFLATE in the man page.
o Fix the incorrect "you must specify a password in interactive
mode" bit of the manual.
o Space things in the man page consistently.
o Be more precice about where you can use MYADDR, HISADDR and INTERFACE
in the "add" command documentation.


# 2a279fed 30-Dec-1997 Brian Somers <brian@FreeBSD.org>

Allow "set device" to close the open modem if we're in
interactive mode.
Use `netfd' in fcntl() and tc[gs]etattr() calls rather than
the hard coded descriptor 0.
Use _FILENO constants from unistd.h

This un-breaks things after my recent `close(0)' in interactive
mode.

Close STDIN_FILENO, and open _PATH_TTY O_RDONLY as `netfd'. This
has the effect of allowing `show route' to output more than about
a page of data (on FreeBSD, not OpenBSD....). I have no idea why,
except that it was a direct consequence of the tcsetattr() in
TtyCommandMode(). My previous fix (closing descriptor 0) `fixed'
this because all calls to tcsetattr() failed :-(


# adac5b72 30-Dec-1997 Brian Somers <brian@FreeBSD.org>

Use inet_aton() before gethostbyname()

Suggested by: Christian Sandberg <christian@yes.no>
Eivind Eklund <perhaps@yes.no>


# 65eea2e0 29-Dec-1997 Brian Somers <brian@FreeBSD.org>

Allow "add! dst mask gw" (note the ``!'') to do an
RTM_CHANGE if the RTM_ADD fails with an EEXIST.
Allow "delete! dst" (note the ``!'') to silently
fail if the RTM_DELETE fails with an ESRCH.
Also, make the ESRCH and EEXIST error conditions
more understandable to the casual observer.


# b2167e32 29-Dec-1997 Brian Somers <brian@FreeBSD.org>

Show how much time is left before timing out in the
`show timeout' output.
Remove ipIdleSecs variable - it's not used.


# e7250038 27-Dec-1997 Brian Somers <brian@FreeBSD.org>

Show who closes the diagnostic connection.
Show the IP range (if specified) in "show ipcp".
Close unused descriptors 0 and 2 in interactive mode.
Pass (size_t *) rather than (int *) to sysctl().


# 313572f3 27-Dec-1997 Brian Somers <brian@FreeBSD.org>

Allow (and document) execution of commands from within
our chat script.
You can now even run chat(8) - see ppp.conf.sample.


# 70ee81ff 24-Dec-1997 Brian Somers <brian@FreeBSD.org>

Cosmetic (style):
sizeof(var) -> sizeof var
sizeof type -> sizeof(type)

Suggested by: J Wunsch <j@uriah.heep.sax.de>


# 6fefd436 23-Dec-1997 Brian Somers <brian@FreeBSD.org>

strncpy(x,y,sizeof(x)) --> strncpy(x,y,sizeof(x)-1)

Suggested by: Philippe Charnier <charnier@lirmm.fr>
Theo de Raadt <deraadt@cvs.openbsd.org>


# 8fe71e06 20-Dec-1997 Brian Somers <brian@FreeBSD.org>

Allow multiple (comma seperated) devices on the "set device" line.
Submitted by: Derek Inksetter <derek@saidev.com>


# 5a76e224 19-Dec-1997 Brian Somers <brian@FreeBSD.org>

Reset our "ifaddr" to zero if the "set ifaddr" fails in
-auto mode. This makes ppp correctly exit if you kick it
off twice in auto mode with the same label (read: interface).


# 16f81f68 17-Dec-1997 Brian Somers <brian@FreeBSD.org>

Replace

strcpy(a, b); /* a and b are the same size */

with

strncpy(a, b, sizeof(a));
a[sizeof(a)-1] = '\0';

Making the code `correct at a glance'.

Suggested by: Theo de Raadt <deraadt@cvs.openbsd.org>


# a09d09cb 17-Dec-1997 Brian Somers <brian@FreeBSD.org>

Don't log the actual password when command-logging
"passwd xxxx".


# 72ca96bf 17-Dec-1997 Brian Somers <brian@FreeBSD.org>

o Log ******** instead of the actual password for "set authkey"
when command logging is switched on.
o Display ******** for the authkey for "show auth"
o Document how \P should be used, and document the other chat escapes
while I'm there.
o Make sure the full command is displayed when a compound command
fails - ie, "set novar rubbish" should say "set novar: Invalid command"
rather than "novar: Invalid command"

Problem pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org> (among others)


# 83c0952d 16-Dec-1997 Brian Somers <brian@FreeBSD.org>

Fix a potential overflow where, if the label passed on the command
line is > LINE_LEN (512 bytes), we scribble (*blush*).

Hinted at by: Theo de Raadt <deraadt@cvs.openbsd.org>

Change sprintf(buf, "fixedstring") to strcpy(buf, "fixedstring").


# abf533d8 15-Dec-1997 Brian Somers <brian@FreeBSD.org>

Use LogWARN for command usage messages and unrecognised
commands, not LogCOMMAND.


# bcc332bd 12-Dec-1997 Brian Somers <brian@FreeBSD.org>

Allow random IP number allocation to peer.
Validate the peers suggested IP by attempting to make a routing table
entry.
Give up IPCP negotiation if the peer NAKs us with an unusable IP.
Always SIOCDIFADDR then SIOCAIFADDR when configuring the tun device.
Using SIOCSIFDSTADDR allows duplicate dst addresses (which we don't
want)!!!
Allow up to 200 interface names (was 50) (now that ppp can play server
properly).
Up the version number (1.5 -> 1.6).

Cosmetic:
Log unexpected CCP packets in the CCP log rather than the ERROR log.
Log unexpected Config Reqs in the appropriate LCP/IPCP/CCP log rather
than the ERROR log.
Log failed route additions and deletions with WARN, not TCPIP.
Log the option id and length for unrecognised IPCP options.
Change some .Sq to .Ar in the man page.


# d4395dc8 08-Dec-1997 Brian Somers <brian@FreeBSD.org>

Correct usage of `add' and `delete'.


# f01e577b 06-Dec-1997 Brian Somers <brian@FreeBSD.org>

Only allow one arg to `delete' - the mask & gateway aren't necessary.
Delete AF_LINK routes as well as AF_INET.
Allow the word `default' as the arg to `delete' or in place of the
first two args (dest & netmask) to `add'.
Accept INTERFACE as the third arg to `add'.

You can now say `add default interface' to create a default route
through the tun interface. It's reported that subsequent bind()s
will bind to a broadcast address and not to the address currently
assigned to the tun device - this is the first step towards
supporting that first connection that was around from before the
dynamic IP negotiation....


# 132502aa 23-Nov-1997 Brian Somers <brian@FreeBSD.org>

Fix the help command (broken when I re-prototyped
all the commands).


# b6e82f33 21-Nov-1997 Brian Somers <brian@FreeBSD.org>

Fix prototypes.
Remove extraneous decls.
Add ``const'' to several places.
Allow ``make NOALIAS=1'' to remove IP aliasing.
Merge with OpenBSD - only the Makefiles vary.

We can now survive a compile with
-Wall -Wbad-function-cast -Wcast-align -Wcast-qual
-Winline -Wmissing-declarations -Wmissing-prototypes
-Wnested-externs -Wpointer-arith -Wredundant-decls
-Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts
(although the Makefile just contains -Wall).


# f9e4a0ca 18-Nov-1997 Brian Somers <brian@FreeBSD.org>

Allow zero args to "cvs log".


# 3b7eb4fb 17-Nov-1997 Brian Somers <brian@FreeBSD.org>

Add and use a DropClient() function for closing the diagnostic port.
Call DropClient() from Cleanup() too.


# d9181b05 13-Nov-1997 Brian Somers <brian@FreeBSD.org>

Fix command logging (broken with the "allow" command).


# c40e02e7 12-Nov-1997 Brian Somers <brian@FreeBSD.org>

Return correct value from "set loopback".
Output "set ?filter deny host|port" rules correctly
with show ?filter.
Submitted by: Dave Bodenstab <imdave@mcs.net>


# 6143f398 12-Nov-1997 Brian Somers <brian@FreeBSD.org>

Don't attempt to dial if "dial label" has specified
a restricted label.


# adbec73e 11-Nov-1997 Brian Somers <brian@FreeBSD.org>

Don't warn that we're waiting for the command to complete if
we've put it in the background (!bg).


# 12ef29a8 11-Nov-1997 Brian Somers <brian@FreeBSD.org>

Finish the security improvements:
o Add "allow" command:
"allow users a b c" gives access to users a, b and c.
"allow modes auto" gives those users access to auto mode only.
"allow users *" and "allow modes *" are accepted.
No users and all modes are allowed by default.
UID 0 can do anything.
o Set the current label with the "load" and "dial" commands
so that the call to ppp.linkdown makes sense.
o Up the verison number.
o Don't OR MODE_AUTO for -background and -ddial.
o Don't OR MODE_INTER when we get a diagnostic connection.
o Allow up to 40 args per line (was 20).
o "set ifaddr" only changes the interface in AUTO mode (with other
modes, it happens after IPCP negotiation).
o Sort command descriptions in the man page.
o Support -dedicated mode where we just talk ppp forever (no login etc).


# bdbc7471 09-Nov-1997 Brian Somers <brian@FreeBSD.org>

Don't Cleanup() in background mode when
we get a "close", the LcpClose() will
eventually do it when we get to PHASE_DEAD.


# 116e558a 09-Nov-1997 Brian Somers <brian@FreeBSD.org>

Initialize VarAltPhone.
PR: 4993


# 8ea8442c 09-Nov-1997 Brian Somers <brian@FreeBSD.org>

Don't create a diagnostic socket by default.
Allow a password spec on the "set server" command line.
Use SIGUSR2 to close the diagnostic socket.
Some man page corrections.


# d025849c 09-Nov-1997 Brian Somers <brian@FreeBSD.org>

Don't ask for a password if it's specified as empty.


# da2a8b4d 09-Nov-1997 Brian Somers <brian@FreeBSD.org>

Add the "!include" syntax.
Return 0 from "show" commands.


# 5106c671 08-Nov-1997 Brian Somers <brian@FreeBSD.org>

Introduce ID0 logging.
Stay as the invoking uid as much as possible.
Execution as a normal user is still forbidden for now,
so these changes are pretty ineffective.
The next commit will implement the modifications suggested
on -hackers a number of days ago.


# 9780ef31 07-Nov-1997 Brian Somers <brian@FreeBSD.org>

Don't pass global vars as args.
Remove local/global conflicts.


# a1e8f937 03-Nov-1997 Brian Somers <brian@FreeBSD.org>

Introduce [local] to "set log [local] ...". This spits
logging out to the screen in terminal mode - should be
good for installation problem diagnosis.


# 6eaa6ac5 25-Oct-1997 Brian Somers <brian@FreeBSD.org>

Cosmetic:
Move prototypes into the correct headers.


# 75240ed1 25-Oct-1997 Brian Somers <brian@FreeBSD.org>

Cosmetic (no functional changes):
o Add missing $Id$s
o Move extern decls from .c -> .h files
o Staticize
o Remove #includes from .h files
o style(9)ify includes
o bcopy -> memcpy
bzero -> memset
bcmp -> memcmp
index -> strchr
rindex -> strrchr
o Move timeout.h -> timer.h (making it consistent w/ timer.c)
o Add -Wmissing-prototypes


# 9a571ec7 24-Oct-1997 Brian Somers <brian@FreeBSD.org>

sleep => nointr_sleep
usleep => nointr_usleep
(not just a #define)
Already done by: ache


# 0ebb52de 11-Oct-1997 Brian Somers <brian@FreeBSD.org>

Cosmetic: Mention that ppp is suspending before
executing a "shell" command.


# 7351f9d8 24-Sep-1997 Brian Somers <brian@FreeBSD.org>

Allow Microsoft CHAP authentication.
This is a combination of MD4 & DES.
Submitted by: Gabor Kincses <gabor@acm.org>


# 35495bec 21-Sep-1997 Brian Somers <brian@FreeBSD.org>

Correct the way the uucp lock file and the ttyXX.if lock
file get created. We don't create lock files over non-tty
connections, but we *do* create lock files in -direct mode.
This leaves us capable of adding utmp/wtmp support for
successful pap & chap logins (coming soon).


# 705c7a18 21-Sep-1997 Brian Somers <brian@FreeBSD.org>

Typo police
Submitted by: Mark Cammidge <mark@gmtunx.ee.uct.ac.za>


# f919b467 17-Sep-1997 Brian Somers <brian@FreeBSD.org>

Support CHAP using MD4
Suggested by: jordan


# bc240299 16-Sep-1997 Brian Somers <brian@FreeBSD.org>

o Fix two unlikely descriptor leaks.
o Output the correct device for "show modem"
while in -direct mode.
o Cosmetic: Moan a bit more when we can't open
the [modem] device.
o Call OpenModem() in a more "natural" way.
o Add some LogDEBUG in OpenModem().


# 23a1cfaa 09-Sep-1997 Brian Somers <brian@FreeBSD.org>

Allow dial to work in non-interactive mode.


# 3732c71b 09-Sep-1997 Brian Somers <brian@FreeBSD.org>

Print errors correctly (don't adjust
argc/argv for commands).


# ff9d9525 09-Sep-1997 Brian Somers <brian@FreeBSD.org>

Don't start an interactive shell from a
telnet prompt.


# 683cef3c 03-Sep-1997 Brian Somers <brian@FreeBSD.org>

Install as group ``network''
Insist that uid == 0 for client ppp
Disallow client sockets if no password is specified
Don't exit on failure to open client socket for listening
Allow specification of null local password
Use reasonable size (smaller) ``vector''s in auth.c
Fix "passwd ..." usage message
Insist on "all" as arg to "quit" (if any)
Drop client socket connection before Cleanup() when "quit all"


# afc7fa2c 31-Aug-1997 Brian Somers <brian@FreeBSD.org>

Cosmetic: Make LogPrintf() calls consistent.


# 944f7098 24-Aug-1997 Brian Somers <brian@FreeBSD.org>

Make the code format more in line with style(9).
Update loadalias to use the new libalias api.
Update to version 1.1.


# 1d205e13 21-Aug-1997 Brian Somers <brian@FreeBSD.org>

Allow the use of HISADDR & MYADDR in ppp.conf.


# de451c68 21-Aug-1997 Brian Somers <brian@FreeBSD.org>

Add "set loopback on|off", defaulting to "on".
This tells ppp to loopback packets addressed to
the ppp interface IP coming *from* the tun
device.

This means that you can ping the tun interface IP
from inside :-)


# 91fc7145 21-Aug-1997 Brian Somers <brian@FreeBSD.org>

Correct online usage message for "set ? stopped"


# cb611434 20-Aug-1997 Brian Somers <brian@FreeBSD.org>

Expand the "set stopped" command so that it can
idependently time out any of the FSMs.

Split LCP logging into LCP, IPCP and CCP logging,
and make room in "struct fsm" for the log level
that the state machine should use.


# 3f6fd923 18-Aug-1997 Brian Somers <brian@FreeBSD.org>

Correct the forth arg to "set ifaddr". If specified,
it gives the IP number that should be used for initial
IPCP config requests, irrespective of MYADDR.


# b48dfe09 18-Aug-1997 Brian Somers <brian@FreeBSD.org>

Introduce the "bg" command. It's pretty
much the same as "shell", but it's in the
background.


# 71144dc5 17-Aug-1997 Brian Somers <brian@FreeBSD.org>

Allow the use of a "stopped" timeout via the
"set stopped" directive. If the timeout occurs
it will cause a "Down" event, hanging up the line
if it's still up. This *isn't* part of the FSM
diagram, but I consider it ok as a "higher level
implementation specific timeout" as specified in
the rfc ;-}

Discussed briefly with: joerg


# c09be724 13-Jul-1997 Brian Somers <brian@FreeBSD.org>

Allow a "hangup" capability.
You can now "ATZ" your modem when it's closed.

Submitted by: peter@citylink.dinoex.sub.org (Peter Much)


# 7cc60a74 12-Jul-1997 Brian Somers <brian@FreeBSD.org>

Allow service names in "set server"


# 01ec2511 29-Jun-1997 Brian Somers <brian@FreeBSD.org>

Allow specification of a umask for local socket
creation in "set server" command.


# 186d0be4 27-Jun-1997 Brian Somers <brian@FreeBSD.org>

Deal with HISADDR/MYADDR in filter rules.
Mostly submitted by: kfurge@worldnet.att.net

Allow MYADDR in add/delete commands to facilitate
dynamic additions of a loopback route to MYADDR.


# 4ef16f24 25-Jun-1997 Brian Somers <brian@FreeBSD.org>

Add "set server" to control the server socket.
Catch SIGUSR1 to re-init listening socket.
Document signal behaviour.

Add missing '\n's to LogPrintf(LogWARN,...)
Main() returns int not void.

AF_LOCAL ideal suggested a long time ago by: joerg


# 2126fb65 24-Jun-1997 Brian Somers <brian@FreeBSD.org>

Allow shell commands (still run as original user)
unless defined out - including while a telnet
session with a -auto ppp is in effect. If you
don't create ppp.secrets, you deserve what you
get.

telnet connection capabilities will be configurable
per system soon.

Suggested by: Terry Dwyer <tdwyer@omen.net.au>


# 368aee2b 23-Jun-1997 Brian Somers <brian@FreeBSD.org>

o Fix uptime for direct connections.
o Style police
o Make hangup abort the current connection, not
necessarily exiting (-auto/-ddial).
o Trap HUP and INT during DoChat and abort the
connection attempt. This means you can now
type "dial" and change your mind with ^C, or
HUP the process to stop it dialing.

Slapped into doing it by: Chuck Robey <chuckr@glue.umd.edu>


# a6ae823c 23-Jun-1997 Brian Somers <brian@FreeBSD.org>

Fix "set parity"

PR: 3881
Actual problem found by: shocking@mailbox.uq.edu.au


# 3b80c319 16-Jun-1997 Brian Somers <brian@FreeBSD.org>

Cosmetic: Fix help syntax.


# 687ee69a 13-Jun-1997 Andrey A. Chernov <ache@FreeBSD.org>

Remove srandomdev fallback code


# e696ee3b 12-Jun-1997 Brian Somers <brian@FreeBSD.org>

Fix "delete ...", it now only insists on
one arg too.

Discovered by: Rikk Salamat <rikks@web-impact.com>


# 58269171 12-Jun-1997 Brian Somers <brian@FreeBSD.org>

Fix "show ?" alignment.

PR: 3830
Submitted by: Josh Gilliam <josh@quick.net>


# 0706ff38 10-Jun-1997 Brian Somers <brian@FreeBSD.org>

Sort out ppp over tcp:
o Allow "set var" with no args to blank var (don't req "").
o Zero VarTerm ASAP if not in interactive mode.
o Never print anything to stdout in -direct mode.
o Count redial when failing to open modem.
o Increase device size to 40 characters (for host:port).
o Remove missed "if (fd == 0) fd = 1;".
o Don't give up on incoming non-terminal connections.


# 927145be 08-Jun-1997 Brian Somers <brian@FreeBSD.org>

Overhaul ppp:
o Use syslog
o Remove references to stdout/stderr (incl perror())
o Introduce VarTerm - the interactive terminal or zero
o Allow "set timeout" to affect current session
o Change "set debug" to "set log"
o Allow "set log [+|-]flag"
o Make MSEXT and PASSWDAUTH stuff the default
o Move all #ifdef DEBUG stuff into the code - this
shouldn't be too much overhead. It's now controlled
with "set log +debug"
o Add "set log command, debug, tun, warn, error, alert"
o Remove cdefs.h, and assume an ansi compiler.
o Improve all diagnostic output
o Don't trap SIGSEGV
o SIGHUP now terminates again (log files are controlled
by syslog)
o Call CloseModem() when changing devices
o Fix parsing of third arg of "delete"

I think this fixes the "magic is same" problems that some
people have been experiencing.
The man page is being rewritten. It'll follow soon.


# da2b73b1 31-May-1997 Brian Somers <brian@FreeBSD.org>

Implement "set mtu" command to allow the client to
reduce the interface mtu.
Allow max mru spec of 16k.
Add "show m[rt]u" ability.


# e81574b5 31-May-1997 Brian Somers <brian@FreeBSD.org>

Remove "set mtu ..." ability. Currently, this is an
"alias" for "set mru ...", but there's no such thing
as setting your mtu in the ppp protocol (rfc1661).


# e83481f9 28-May-1997 Brian Somers <brian@FreeBSD.org>

Correct the return of DialModem()

Suggested by: kfurge <kfurge@worldnet.att.net>


# 6ed9fb2f 25-May-1997 Brian Somers <brian@FreeBSD.org>

De-couple ppp from libalias. If libalias isn't there, the
alias commands simply won't work. Only root may specify the
location of the alias lib (otherwise, it's hard-coded).

Make logprintf silently fail if LogOpen hasn't been called.

Suggested by: eivind


# 25aa96ac 24-May-1997 Brian Somers <brian@FreeBSD.org>

Fix the reconnect option, and add an explanation to vars.h


# 6db75539 22-May-1997 Brian Somers <brian@FreeBSD.org>

Use the latest alias engine - now in libalias.

Submitted by: Charles Mott <cmott@srv.net>


# 6efd9292 18-May-1997 Brian Somers <brian@FreeBSD.org>

Mega update to sort out bad implementations
of reconnect & -background.

o Fix reconnect anomolies.
o Make reconnect apply to failed LQR hangups (& mention in man page).
o Make reconnect effective in -background mode.
o Listen on socket in -background mode.
o Try all phone numbers in -background mode.
o Insist on system arg in -background mode.
o Make a control-connection close command exit in -background mode.
o Output status message to stdout on exit of parent in -background mode.
o Don't notify parent of success too soon.
o Describe termination EX_* code.
o Miscelaneous diagnostic corrections.
o Remove redundant connect_time from modem.c.
o Don't repeatedly DownConnection().


# 298091da 13-May-1997 Brian Somers <brian@FreeBSD.org>

Build pid_filename without a double slash.
Make ``Dial attempt'' diagnostics consistent.

Reset lostCarrier when it has reached max.
Suggested by: Kevin Street <street@iName.com>


# 290281ed 10-May-1997 Andrey A. Chernov <ache@FreeBSD.org>

Cosmetique fixes:
shorten help message to fit the screen
return to prompt from "show ipcp"


# 41c6c543 09-May-1997 Brian Somers <brian@FreeBSD.org>

Add a ttyXX.if file in /var/run that points to
the tunX.pid file. Change the ppp.tunX.pid name
to tunX.pid

Requested by: Daniel O Callaghan <danny@panda.hilink.com.au>


# 274e766c 09-May-1997 Brian Somers <brian@FreeBSD.org>

Tidy up the code - bounds checking, return
value checking etc.

Submitted by: eivind


# 13743c30 09-May-1997 Brian Somers <brian@FreeBSD.org>

Don't reconnect (due to reconnect setting) after
close command.


# cdc86cbc 07-May-1997 Brian Somers <brian@FreeBSD.org>

Allow mixed case commands.
Allow HISADDR, MYADDR, INTERFACE and ALL in mixed case.


# e68d210e 07-May-1997 Brian Somers <brian@FreeBSD.org>

Allow up to 40 args in the chat script (was 20).
Ignore subsequent args rather than scribbling.

PR: 1952
Submitted by: Mikael Hybsch <micke@free.dynas.se>


# 07030d97 20-Apr-1997 Brian Somers <brian@FreeBSD.org>

Add a reconnect capability directing ppp to re-establish
the connection after an unexpected loss of carrier:

set reconnect timer ntries

The man page warns against using this command when your
timeout value is slightly more than the other sides :{}

Suggested by: burton@bsampley.vip.best.com (Burton Sampley)


# 43ea9d19 14-Apr-1997 Brian Somers <brian@FreeBSD.org>

Make the next number redial ability configurable. The
"set redial pause [times]" command becomes
"set redial end-pause[.next-pause] [times]" and next-pause
defaults to 3 seconds. This keeps things backwards
compatable.

Suggested by: ache


# e0d3e233 09-Apr-1997 Andrey A. Chernov <ache@FreeBSD.org>

Ignore SIGPIPE or any user can quit ppp just telnetting to it
and quitting telnet immediately (while phone number dialed)
Log client connection/disconnection with PHASE_BIT now.
Add more error recovery on client disconnection


# 6a95b13d 24-Mar-1997 Andrey A. Chernov <ache@FreeBSD.org>

Use srandomdev() to initialize RNG


# 7b50678a 17-Mar-1997 Andrey A. Chernov <ache@FreeBSD.org>

Convert srandom() arg cast to Lite2 style


# 359ceb95 10-Mar-1997 Andrey A. Chernov <ache@FreeBSD.org>

Do not re-initialize random numbers generator several times.
Use ^ getpid() to produce better initial state.


# 780700e5 09-Mar-1997 Andrey A. Chernov <ache@FreeBSD.org>

Don't waste time scanning tun_in+10 descriptors, scan exactly what
we need now.
Don't assume that file descriptor can't be 0 (many places)
Protect FD_* macros from being used with negative descriptors
Shorten MS EXT show help to fit 80 cols


# 476602a9 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 017a5a7f 22-Feb-1997 Poul-Henning Kamp <phk@FreeBSD.org>

Make it possible to substitute INTERFACE when executing commands.


# 47b213b1 02-Feb-1997 Joerg Wunsch <joerg@FreeBSD.org>

Fix a benign typo (benign by now, since sizeof(VarLoginScript) ==
sizeof(VarDialScript)).

Submitted by: Arjan.deVet@adv.IAEhv.nl (Arjan de Vet) -- or actually by imp?


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 99c02d39 10-Jan-1997 Warner Losh <imp@FreeBSD.org>

Fix many buffer overruns in the code. Specifically, disallow ExpandString
to be used to expand things beyond the size of the buffer passed in. Also
do a general cleanup of sprintf -> snprintf as well as strcpy and strncat
safety. Also expand some buffers to allow for the largest possible data
that might be used.

This is a 2.2 candidate. However, it needs to be vetted on -current
since little testing has been done on this due to my lack of PPP on
this machine.

Reviewed by: Jordan Hubbard, Peter Wemm, Guido van Rooij


# 6d14e2a8 22-Dec-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

For /usr/sbin/ppp, you must choose between running ppp in the background or
connecting to a host immediately in the foreground.

I would like to be able to run ppp from a script so that my script can be
sure that it is connected to the 'net before it continues running:

# Dial up the internet.
ppp -background myprovider || exit 1

do-some-net-command

# Hang up the modem.
kill -HUP `cat /var/run/ppp.tun0.pid`

Another problem is that the current ppp calls its process id file
`/var/run/PPP.server', which may conflict if you have more than one IP
tunnel interface available.

Closes PR#1469
Submitted by: Gord Matzigkeit <gord@enci.ucalgary.ca>


# 17e762ca 22-Dec-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

Make CRTSTS selection a runtime option. Closes PR#1392
Submitted by: Mike McGaughey <mmcg@heraclitus.cs.monash.edu.au>


# 680026d6 03-Dec-1996 Nate Williams <nate@FreeBSD.org>

Added my 'ddial' patches to user-PPP. The new mode tries it's darndest
to keep the link up, so it re-dials whenever it detects the link go
down. This is useful for 'dedicated' links who use PPP.

It's been used for over a year w/out problems at different sites.


# b0856316 13-Oct-1996 Søren Schmidt <sos@FreeBSD.org>

Fixed the security leek I introduced the other day, now
shell command is only executabel from command files, not
from the commandline.


# b0cdb3ce 12-Oct-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

1. Room to calculate MD5 for CHAP negotiation is shorter than
required. a core is not dumped at first connecting time and
dumped at second or third time. (patch I)
2. A routine for "show route" refers out of allocated space.
Values pointed by "lp" should be read as CHAR, I think.
there is also no free() for disallocation. (patch II)

Here is also a patch for an improvement: In current imprementation,
even if PPP connection is disconnected by time out, prompt of
interactive mode does not change from "PPP>" to "ppp>" to
indicate the disconnection on a terminal.
So I modified the code to do that. (patch III)

Submitted-By: NAKAMURA Motonori <motonori@econ.kyoto-u.ac.jp>


# 45768c72 10-Oct-1996 Søren Schmidt <sos@FreeBSD.org>

Allow shell commands in all modes.
Old behavior can be had with define SHELL_ONLY_INTERACTIVELY


# 3d451fd3 07-Oct-1996 Søren Schmidt <sos@FreeBSD.org>

Add the feature to use MYADDR & HISADDR macroes as arguments to
a shell escape.


# d8e55738 06-Oct-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

Add support for the Evil Microsoft ppp extentions. Yes, they did it
on their own without even attempting to get concensus in the IETF, but
there are also lots of Win95/NT boxes out there.

CLoses PR#1494
Submitted-By: Peter Childs <pjchilds@imforei.apana.org.au>


# 552690d2 28-Sep-1996 Bruce Evans <bde@FreeBSD.org>

Moved getdtablesize() out of a loop.


# 113dea91 09-Jun-1996 Andrey A. Chernov <ache@FreeBSD.org>

Prepare for exec properly and check return values
Submitted by: Arjan de Vet <devet@IAEhv.nl>


# 9c749ffb 11-May-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Here is a diff of /usr/src/usr.sbin/ppp against current. The diffs
add some logging functionality which I find very useful.
'set debug link' will record just link up/down and address assignments.
'set debug connect' will record the entire chat dialog
'set debug carrier' will record just chat lines including 'CARRIER'
(so that I can be sure I'm getting a 28.8 line).

There was a global change required to permit LogPrintf to take a bit
mask instead of a bit position value (to permit logging some events
on either of two flags, so that no change in 'set debug lcp' would
result from the code supporting 'link'. Thus the diffs are rather
long for such a small change. The man page is also touched.

Oh, and there was a slight syntax problem in route.c

Reviewed by: phk
Submitted by: Tony Kimball <alk@Think.COM>


# a81c9c68 08-Mar-1996 Andrey A. Chernov <ache@FreeBSD.org>

Prevent dial cycling on the last phone from the list, make phone list copy


# 1dff3fc5 08-Mar-1996 Andrey A. Chernov <ache@FreeBSD.org>

1) Add multi-phone dialing/redialing, several phones separated by ':'
2) Improve on-line help subsystem
3) Make 'term' mode works even carrier dropped (old code
close line forever here)
4) Make 'term' mode 8bit clean.
5) Improve manual page
6) #ifdef DEBUG diagnostic about missing optional files.
7) Don't put interactive dialing info to logfile


# e53374ea 30-Jan-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Use libmd's MD5.
inline hdlc checksum calculation.
make big tables const.


# ed6a16c1 11-Jan-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Final cleanup for now. -Wall is now silent. A couple of bogons found.


# 37d89975 10-Jan-1996 Peter Wemm <peter@FreeBSD.org>

My freshly aborted 'make world' has pointed out that the wait.h include
file is <sys/wait.h>, not <wait.h> as was recently committed.


# 7b64106a 10-Jan-1996 Poul-Henning Kamp <phk@FreeBSD.org>

A random bunch of cleanup changes.


# a9c6b5df 08-Oct-1995 Atsushi Murai <amurai@FreeBSD.org>

1. Add a settable redial timer and logging of the process id in a file.
A settable redial timer helps to avoid the problem where both ends
of a link want to dial at the same time and the line winds up busy
for both ends. The process id is logged in /var/run/PPP.system where
system is the name of the called system. When both ends of a link
are running in demand dial mode, you need an easy way to get the pid
of the ppp on the called end so it can be killed and re-started with
-direct or pppd started to handle the incoming ppp session.

2. Add secret description for "set timeout" to man.

Reviewed by: Atsushi Murai <amurai@spec.co.jp>
Submitted by: John Capo <jc@irbs.com>


# c3899f8d 02-Sep-1995 Atsushi Murai <amurai@FreeBSD.org>

1. Do not log the password itself to ppp.log ( Mr. Rich Murphey )
2. Add ability to execute shell commands and suspend back into
invoking shell (Mr. J Wunsch)

Reviewed by: amurai@spec.co.jp
Submitted by: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
Rich Murphey <rich@lamprey.utmb.edu>


# 60e218e4 08-Jul-1995 Atsushi Murai <amurai@FreeBSD.org>

1. Clean up log message.
2. Optimize ModemQlen.
3. Sending ProtoReject for Unknow protocol (i.e. IPX)
4. Avoid select looping by reading tun under the high system load.
5. Adding Local version String for maintenance.
6. Just more speak rather silent ignore if you type invalid key words.


# 549d663d 08-Jul-1995 Atsushi Murai <amurai@FreeBSD.org>

Some implementation of PPP are required that starting a negotiaion by
sending *special* value as my address, even though the standard of PPP
is defined full negotiation based. (e.g. "0.0.0.0" or Not "0.0.0.0")


# 4a11bffe 16-Jun-1995 Poul-Henning Kamp <phk@FreeBSD.org>

manupilation -> manipulation.


# 709e8f9a 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 38c50f39 16-Apr-1995 Atsushi Murai <amurai@FreeBSD.org>

Fixing follows and John's fruent explnation than my English....

The first problem I found was that descriptor 0 was being closed.
This happens because the modem variable is set to 0 to indicate
that it is not valid but there are not enough tests for the modem
variable being 0. You can see where I have done this in the patch.
Code in OpenModem() dups the modem descriptor if it is < 3. Once
this happened the modem was always open and an incomming call would
have getty and ppp reading the modem.

Descriptor 1 is closed when the quit command was executed from a
telnet connection. The next modem open returns descriptor 1
and this gets duped leaving the modem always open again.

The modem was not being closed when the connection dropped or was
closed from the other end. The UUCP lock was also not removed if
the modem could not be opened.

Reviewed by: Atsushi Murai <amurai@spec.co.jp>
Submitted by: John Capo <jc@irbs.com>


# 41db6564 27-Feb-1995 Atsushi Murai <amurai@FreeBSD.org>

Fixing minor bug and allow help(Not for all command) and quit
but not close line connection by "quit all" command if not
authorized.

Reviewed by: amurai@spec.co.jp
Submitted by: tony-o@iij.ad.jp amurai@spec.co.jp


# 53c9f6c0 25-Feb-1995 Atsushi Murai <amurai@FreeBSD.org>

New user Process PPP based on iij-ppp0.94beta2.

o Supporting SYNC SIO device (But need a device driver)
- add "set speed sync"
o Fixing bug for Predictor-1 function.
o Add new parameter that re-sent interval for set timeout commands.
o Improving RTT (Round Trip Time) and reducing processor time.
- Previous Timer service was using polling, and now using
SIGALRM ;-)
- A 0.94beta2 will not work correctly....

-- Follows are additinal feature not including 0.94beta2
o Support Proxy ARP
- add "enable/disable proxy" commands
o Marging common routine in CHAP/PAP.
o Enhancing LCP/IPCP log information.
o Support local Authfication connection on port 300x and tty.
- You can set up pair of your "hostname -s" and
password in ppp.secret. if either ppp.secret file nor
your hostname line don't exist, It will notify a message
and working as same as previous version.(Backword compatibility)
- If you did set up them, It's allow connection but nothing to do
except help and passwd command.
- add "passwd yourpasswd" commands
o Support afilter - keep Alive filter that a packet can send/receiving
according to ifilter/ofilter but doesn't count it as preventing idle
timer expires.
- Same syntax of other filters.
o Fixing bugs reported by current user for previous one. Thanks !!

Reviewed by: Atsushi Murai (amurai@spec.co.jp)


# af57ed9f 30-Jan-1995 Atsushi Murai <amurai@FreeBSD.org>