Commit Graph

60 Commits

Author SHA1 Message Date
Brian Somers
5a72b6eda3 Put the IP buffer queues into struct ipcp.
Forgotten by: me
1998-08-26 17:39:37 +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
501f548011 Add missing braces - without them, the IP & label were mis-selected
from ppp.secret.
Problem reported by: Dom Mitchell <dom@phmit.demon.co.uk>
1998-07-19 21:07:24 +00:00
Brian Somers
d93d3a9c32 o De-staticise things that don't need to be static.
o Bring the static ``ttystate'' into struct prompt so that
  the tilde context is per prompt and not global.
o Comment the remaining static variables so that it's
  clear why they're static.
o Add some XXX comments suggesting that our interface list
  and our hostname should be re-generated after a signal
  (say SIGUSR1) so that a machine with PCCARDs has a chance.
1998-06-15 19:06:58 +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
1fa665f5b3 o Add the link name to modem diagnostics.
o Create struct mpserver as part of struct mp.
  mpserver creates a unix-domain socket based on the
  peers auth name and endpoint discriminator.  If it
  already exists, ppp will ``pass the link'' over to
  the owner of the socket, joining it into the bundle
  of another ppp invocation, otherwise ppp waits for
  other invocations to pass it links through this
  socket.
  The final piece of code will be the code that flattens
  our datalink info and passes it down this channel
  (not yet implemented).
1998-04-28 01:25:46 +00:00
Brian Somers
643f49047e 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.
1998-04-24 19:16:15 +00:00
Brian Somers
49052c9523 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.
1998-04-23 03:23:03 +00:00
Brian Somers
e3c70ce931 Tidy up the use of struct pppTimer. 1998-04-19 15:24:50 +00:00
Brian Somers
1342caed9c 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.
1998-04-16 00:26:21 +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
cd9647a100 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.
1998-04-03 19:24:07 +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
eaa4df37f4 Move VJ compression state and stats into struct ipcp. 1998-03-16 22:54:35 +00:00
Brian Somers
5ca5389af4 Move filter sets into struct bundle. 1998-03-16 22:52:54 +00:00
Brian Somers
5828db6d2d Move the IPCP into struct bundle. 1998-03-13 21:07:46 +00:00
Brian Somers
c4c4aaacea Add extraneous braces to stiffle warnings from gcc-2.8 1998-03-13 01:36:10 +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
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
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
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
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
42d4d39668 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.
1998-02-09 19:21:11 +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
6140ba1177 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.
1998-02-02 19:33:40 +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
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
29e275cee4 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.
1998-01-29 23:11:44 +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
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
9c97abd8c3 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.
1998-01-05 01:35:20 +00:00
Brian Somers
70ee81ff6b Cosmetic (style):
sizeof(var) -> sizeof var
  sizeof type -> sizeof(type)

Suggested by: J Wunsch <j@uriah.heep.sax.de>
1997-12-24 09:29:17 +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
c7d4711f9e Add id strings to tun.[ch].
Don't try to open ppp.secret if we're never going to use it.
1997-11-17 00:42:41 +00:00
Brian Somers
12ef29a81a 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).
1997-11-11 22:58:14 +00:00
Brian Somers
8ea8442c9a 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.
1997-11-09 22:07:29 +00:00
Brian Somers
d025849c64 Don't ask for a password if it's specified as empty. 1997-11-09 18:51:23 +00:00
Brian Somers
86e0293468 Increase chat script sizes to 512
Requested by: Michael Reifenberger <root@totum.plaut.de>
1997-11-09 14:18:55 +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
d40f8a5a61 Correct ppp authentication defaults in interactive
mode.  We don't want to be forced to type a password
here :-(
Pointed out by: mouth@ibm.net (John Kelly)

While I'm there, don't allow a "set server" in
interactive mode.
1997-09-09 21:51:39 +00:00
Brian Somers
683cef3c33 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"
1997-09-04 00:38:22 +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
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
6ed9fb2fc9 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
1997-05-26 00:44:10 +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
Brian Somers
e68d210e8f 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>
1997-05-07 23:01:25 +00:00