Commit Graph

46 Commits

Author SHA1 Message Date
Brian Somers
dae8dd31bf Implement mbuf allocation internally by maintaining 8 buckets of
different sized mbufs, and mallocing them in chunks of 20 mbufs
at a time.

This improves back-to-back throughput by between 7 and 8%
1999-12-20 20:29:51 +00:00
Brian Somers
26af0ae966 Cosmetic: Make struct mbuf more like kernel mbufs. 1999-12-20 20:29:47 +00:00
Brian Somers
aa4e734249 Learn to do pointer arithmatic (doh!) 1999-12-18 02:31:36 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Brian Somers
6fd578c435 Aligh mbufs to sizeof(long), not 4 1999-08-26 06:37:53 +00:00
Brian Somers
67b072f732 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''.
1999-08-19 18:15:52 +00:00
Brian Somers
e531f89a62 Change printf formats %q[du] -> %ll[du] 1999-08-09 22:56:18 +00:00
Brian Somers
411675bae3 o Alter the mbuf type as it's processed by different layers.
o Show more information about missing MP fragments in ``show mp''.
o Do away with mbuf_Log().  It was showing mbuf stats twice on
  receipt of LCP/CCP/IPCP packets.... ???!!?
o Pre-allocate a bit extra when creating LQR packets to avoid having
  to allocate another mbuf in mbuf_Prepend().
1999-06-02 15:59:09 +00:00
Brian Somers
3377c28cd9 Deal with the fact that as we now mbuf_Read the fsm
header in fsm_Input() we often end up with a NULL mbuf.

Deal with a possible NULL mbuf being passed into
mbuf_Prepend().

Adjust some spacing to make things more consistent.
1999-05-09 20:02:29 +00:00
Brian Somers
5d9e610366 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''.
1999-05-08 11:07:56 +00:00
Brian Somers
aad80d9f1b Ensure that the thing we're casting to struct ip
is aligned for non-i386 architectures.
1999-03-29 08:21:28 +00:00
Brian Somers
f0cdd9c021 Decouple pap & chap output routines from the corresponding
input routines and take advantage of the new init/continue
interface in libradius.  This allows a timely response on
other links in an MP setup while RADIUS requests are in
progress as well as the ability to handle other data from
the peer in parallel.  It should also make the future addition
of PAM support trivial.

While I'm in there, validate pap & chap header IDs if
``idcheck'' is enabled (the default) for other FSM packet
types.

NOTE: This involved integrating the generation of chap
      challenges and the validation of chap responses
      (and commenting what's going on in those routines).
      I currently have no way of testing ppps ability
      to respond to M$Chap CHALLENGEs correctly, so if
      someone could do the honours, it'd be much
      appreciated (it *looks* ok!).

Sponsored by: Internet Business Solutions Ltd., Switzerland
1999-02-06 02:54:47 +00:00
Brian Somers
6f8e9f0a8a 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.
1998-08-25 17:48:43 +00:00
Brian Somers
9773f8c0c8 Consolidate the two malloc()s that are done when allocating
an mbuf.
1998-08-21 18:10:15 +00:00
Brian Somers
3f37462e61 Make ``show mem'' display the number of packets allocated as well as the
number of octets.
1998-08-21 18:09:57 +00:00
Brian Somers
92b0955883 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.
1998-08-07 18:42:51 +00:00
Brian Somers
3a2e4f621c 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.
1998-06-27 23:48:54 +00:00
Brian Somers
9ef0938e40 Zero mbuf::pnext when Dequeue()ing. 1998-06-16 19:40:20 +00:00
Brian Somers
f7704be7d3 o Don't dump core with ~m in term mode.
o Always put a '\r' before a '\n' at the end of a line
  in prompt_vPrintf() in term mode, and make prompt_Printf()
  use prompt_vPrintf().
o Fix ~? message.
1998-06-16 07:15:11 +00:00
Brian Somers
c9e11a112d 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.
1998-06-15 19:06:25 +00:00
Brian Somers
d91d286164 MFMP: Make ppp multilink capable.
See the file README.changes, and re-read the man page.
1998-05-21 21:49:08 +00:00
Brian Somers
dd7e261079 Cosmetic: Make our external function names consistent. 1998-05-01 19:26:12 +00:00
Brian Somers
322cffa298 Print mbuf type names in `show mem'. 1998-04-07 01:29:44 +00:00
Brian Somers
2764b86afd 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.
1998-04-07 00:54:26 +00:00
Brian Somers
d24f017be8 Remove unused includes. 1998-04-06 09:12:38 +00:00
Brian Somers
b6217683dc 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.
1998-04-03 19:26:02 +00:00
Brian Somers
3b0f8d2ed6 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.
1998-04-03 19:21:56 +00:00
Brian Somers
3006ec67fe 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 !
1998-02-16 00:01:12 +00:00
Brian Somers
85b542cf4f 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.
1998-02-10 03:23:50 +00:00
Brian Somers
77ff88ad4b Make the server descriptor into a `sort' of struct descriptor. 1998-02-09 19:24:03 +00:00
Brian Somers
2289f24698 Move pppVars.physical into the bundle (for the moment). 1998-02-06 02:23:48 +00:00
Brian Somers
8c07a7b2e0 Create `struct link' - the logical link from which
`struct physical' (and the future `struct logical')
are derived.
1998-01-30 19:46:07 +00:00
cvs2svn
1ae349f52c This commit was manufactured by cvs2svn to create branch 'MP'. 1998-01-29 00:44:16 +00:00
Brian Somers
aa8e05197c Remove unused #includes.
Make various bits static.
Remove unused variables.
Submitted by: eivind
1998-01-21 02:15:33 +00:00
Brian Somers
09411a5af3 Initialize mbuf::pnext.
Complain to LogERROR if we have internal inconsistency (not LogDEBUG).
1997-12-28 02:56:43 +00:00
Brian Somers
b6e82f33ef 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).
1997-11-22 03:37:54 +00:00
Brian Somers
75240ed178 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
1997-10-26 01:04:02 +00:00
Brian Somers
944f709824 Make the code format more in line with style(9).
Update loadalias to use the new libalias api.
Update to version 1.1.
1997-08-25 00:29:32 +00:00
Brian Somers
4ef16f24f2 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
1997-06-25 19:30:05 +00:00
Brian Somers
927145be97 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.
1997-06-09 03:27:43 +00:00
Brian Somers
274e766c99 Tidy up the code - bounds checking, return
value checking etc.

Submitted by:	eivind
1997-05-10 01:22:19 +00:00
Peter Wemm
476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Jordan K. Hubbard
1130b656e5 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.
1997-01-14 07:20:47 +00:00
Rodney W. Grimes
709e8f9ae1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
Atsushi Murai
53c9f6c0c4 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)
1995-02-26 12:18:08 +00:00
Atsushi Murai
af57ed9fdc 1995-01-31 06:29:58 +00:00