Commit Graph

20 Commits

Author SHA1 Message Date
Brian Somers
dc0fdb6bc1 "dial" now may optionally have context.
Tidy up some LcpInfo uses.
1998-03-13 00:44:51 +00:00
Brian Somers
879ed6fa82 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.
1998-03-13 00:44:26 +00:00
Brian Somers
e2ebb036fd 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.
1998-03-01 01:07:49 +00:00
Brian Somers
5454ccd9e0 Reset fsm.maxconfig in the *_Setup() routines. 1998-02-27 21:46:26 +00:00
Brian Somers
6d6667755e Create struct fsm_parent. FSMs are created with one of these,
and the FSM passes subsequent events to them.

The datalink now hides its CCP from the bundle layer.
1998-02-27 01:22:39 +00:00
Brian Somers
6eddf53ee8 Move our Layer*() FSM callbacks into their own structure. 1998-02-24 03:36:50 +00:00
Brian Somers
f4768038f0 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.
1998-02-23 00:38:44 +00:00
Brian Somers
503a7782d8 Shuffle around our FSMs a bit. This'll make it
easier to remove the CcpInfo, LcpInfo and IpcpInfo
globals.
1998-02-21 01:45:26 +00:00
Brian Somers
7e80369b76 Move some FSM initialisation into FsmInit(). 1998-02-19 19:57:01 +00:00
Brian Somers
ee6c193f92 o Fix an obscure memory leak (if the peer sends PROTO_COMPD
packets when we haven't agreed a protocol).
o Move the complication of passing incoming data to the
  PROTO_COMPD input or dictionary setup routine into ccp.c
1998-02-18 19:36:13 +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
aad81d1ecf Rename ccpstate to ccp, ipcpstate to ipcp and lcpstate to lcp. 1998-02-08 11:05:01 +00:00
Brian Somers
455aabc3f8 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.
1998-02-07 20:50:08 +00:00
Brian Somers
83d1af558c Isolate fsm callback functions
Derive {lcp,ipcp,ccp}state structures from struct fsm
where convenient.
Create bundle_Down() and remove LcpDown()
1998-02-06 02:24:29 +00:00
Brian Somers
7a6f872047 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.
1998-02-02 19:32:16 +00:00
Brian Somers
7308ec6890 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).
1998-01-31 02:48:30 +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
Brian Somers
247ab36d28 o Move in_algorithm and out_algorithm into CcpInfo.
o Take note of the return value of the compression layers
  init routine, and if it fails, bring the whole layer
  cleanly back down again.
o Only use srandomdev() if ``__FreeBSD__ > 2'' - this makes
  these sources buildable on 2.2 (where I'm testing).
1998-01-29 20:45:16 +00:00
Brian Somers
63b7346316 Create a new MP branch for `multilink protocol'.
Do lots of initial shuffling and grouping.
Submitted by: Eivind Eklund <perhaps@yes.no>
1998-01-29 00:49:32 +00:00
cvs2svn
1ae349f52c This commit was manufactured by cvs2svn to create branch 'MP'. 1998-01-29 00:44:16 +00:00