Commit Graph

81 Commits

Author SHA1 Message Date
Brian Somers
30c2f2ffe2 Remove more globals 1998-03-13 21:08:05 +00:00
Brian Somers
5828db6d2d Move the IPCP into struct bundle. 1998-03-13 21:07:46 +00:00
Brian Somers
a611cad61d 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.
1998-03-13 21:07:14 +00:00
Brian Somers
2c995c5332 Don't send LQRs when the peer has LCP REJ'd them. Send
ECHO LQRs instead.
1998-03-13 00:44:56 +00:00
Brian Somers
dc0fdb6bc1 "dial" now may optionally have context.
Tidy up some LcpInfo uses.
1998-03-13 00:44:51 +00:00
Brian Somers
5563ebde73 Remove the second bundle_NewPhase argument and do
the tun config from bundle_LayerUp.
1998-03-13 00:44:33 +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
9364152520 Cosmetic 1998-03-11 02:21:59 +00:00
Brian Somers
fc1141b27b Move `Utmp' into struct physical. We can be logged in
once for every -direct physical connection.
1998-03-10 03:06:07 +00:00
Brian Somers
ab886ad0f6 Move the idle timer into struct bundle. There's no
link-level idle timer for the moment.
1998-03-09 19:26:41 +00:00
Brian Somers
b3ae3fc83d Show how to use "*" as the password and mention the forth field. 1998-03-09 19:26:17 +00:00
Brian Somers
d501527213 o Allow "*" in the password field in ppp.secret (forcing a
getpwnam() lookup).
o Don't use chat_ExpandString on the password field in ppp.secret.
  It's still possible to quote the string for embedded spaces.
o Don't allow multiple entries with the same name in ppp.secret.
1998-03-09 19:25:35 +00:00
Brian Somers
f95458053f Move phone numbers into struct datalink.
Make "show modem" look a bit prettier.
1998-03-09 19:24:58 +00:00
Brian Somers
f8543b9e45 MFC: Explicitly call caused' an int'.
Sugested by: gcc-2.8
1998-03-08 23:44:48 +00:00
Brian Somers
3bf710a4ba 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.
1998-03-06 00:34:47 +00:00
Brian Somers
d2fd8d772f Force IPCP back to initial in bundle_Close().
Add a few un-necessary includes to make us build under
2.2.5.  These'll go when the code is cleaned up at the
end.
1998-03-02 17:25:30 +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
27084c858c Don't require CD to enter packet mode.
Remove some extraneous #if 0 stuff.
1998-02-27 21:46:00 +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
486f40c95c Implement ABORT strings. 1998-02-26 17:54:43 +00:00
Brian Somers
4bc1da96a9 Don't enter DATALINK_HANGUP state if we're currently in
DATALINK_OPENING.... we'll hang there forever with no
open device.
1998-02-26 17:53:15 +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
68f7a8cdcc Remove forgotten lcp report timer. 1998-02-19 19:56:39 +00:00
Brian Somers
f1316a8643 Allow 8 character login names.
Pointed out by: Forgotten

Do the login()/logwtmp()/logout() as id 0.
1998-02-19 02:08:53 +00:00
Brian Somers
8282a07e16 LogWARN rather than LogERROR when we can't create
our diagnostic socket.
1998-02-18 20:39:08 +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
63258dccc5 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.
1998-02-18 19:35:59 +00:00
Brian Somers
9991562d36 Make ``show escape'' require context.
De-globalize EscMap[].
1998-02-18 19:35:20 +00:00
Brian Somers
56c9cf9d98 Fix empty string skipping when chatting. 1998-02-18 00:28:06 +00:00
Brian Somers
d345321b7e Close the link(s) properly from bundle_Close() even
if we're in PHASE_DEAD already.
Don't modem_Raw() 'till we're in packet mode.
1998-02-18 00:27:49 +00:00
Brian Somers
81b6b8982d Merge LcpOpen functionality into datalink_LoginDone 1998-02-17 19:29:14 +00:00
Brian Somers
d585f8f51b Cosmetic: Group configuration items in struct physical. 1998-02-17 19:29:03 +00:00
Brian Somers
73a13b5c4d Cosmetic: Group configuration items in struct datalink. 1998-02-17 19:28:49 +00:00
Brian Somers
c7cc50305f 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.
1998-02-17 19:28:35 +00:00
Brian Somers
1b35f8f703 Keep a handle on our current ``term'' in struct prompt
so that the `term' command works on the correct link.
1998-02-17 19:28:13 +00:00
Brian Somers
aef795cc3b Introduce the ``link'' command for controlling
individual links.
1998-02-17 19:28:01 +00:00
Brian Somers
c5a5a6ca93 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.
1998-02-17 01:05:47 +00:00
Brian Somers
eaf65a3609 Remove some unused stuff from pppVars. 1998-02-17 01:05:22 +00:00
Brian Somers
e718d1d7d8 Move the redial timeouts and max tries into struct datalink. 1998-02-16 19:11:10 +00:00
Brian Somers
abff9bae14 Move the reconnect timeout and max tries into struct datalink. 1998-02-16 19:10:44 +00:00
Brian Somers
5b8b8060c1 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.
1998-02-16 19:10:03 +00:00
Brian Somers
310c3bab77 Cosmetic: Stop a warning 1998-02-16 00:18:52 +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
c78db105b5 Remove some unused variables. 1998-02-13 05:31:03 +00:00
Brian Somers
b6dec9f07f 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.
1998-02-13 05:10:26 +00:00
Brian Somers
6b5fb63d1e Oops - put that handle_signals() call back. 1998-02-10 22:28:51 +00:00