Commit Graph

175 Commits

Author SHA1 Message Date
Brian Somers
6f38457323 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....
1998-04-30 23:53:56 +00:00
Brian Somers
9c281ab21b Don't forget to set up our ppp.secret IP numbers & label
in non-MP mode.
1998-04-30 23:52:53 +00:00
Brian Somers
97fec20198 Create ``pppmpipe''.
This is a *very* small program that acts as a pipe between
stdin & stdout.
1998-04-30 23:51:51 +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
107d62e7ac 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.
1998-04-27 01:40:38 +00:00
Brian Somers
e43ebac1c2 Make gcc-2.8.1 build ppp cleanly.
Support OpenBSD again.
1998-04-25 10:49:52 +00:00
Brian Somers
9592529e9d Use the link name for modem throughput logging. 1998-04-25 00:09:28 +00:00
Brian Somers
184d1da22a Show our link name when we fail to mp_Up(). 1998-04-25 00:09:22 +00:00
Brian Somers
50abd4c820 Make ``show ipcp'' prettier and remove a few redundant includes. 1998-04-25 00:09:14 +00:00
Brian Somers
93cc258625 Remove carrier logging 1998-04-24 19:16:23 +00:00
Brian Somers
259a619199 Choose the correct IP number in ``set enddisc {ip,mac}''. 1998-04-24 19:16:20 +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
d47dceb8ab 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.
1998-04-24 19:15:48 +00:00
Brian Somers
ed32233ca5 Output the correct protocol id from the physical link-level CCP
layer when we're in multilink mode.
1998-04-24 19:15:26 +00:00
Brian Somers
086760227f Create #defines for all endpoint discriptor classes,
and allow `set enddisc mac'.
1998-04-23 23:50:40 +00:00
Brian Somers
673903ec42 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).
1998-04-23 21:50:13 +00:00
Brian Somers
6e3ef61465 Get the alignment right in ``show mp''. 1998-04-23 18:58:04 +00:00
Brian Somers
ce828a6ecc o Add ipcp_SetLink() for attaching IPCP to the correct link, and
call it after link authentication.
o Pretty print our bundle MTU.
o Correct MP header encoding and decoding (should be network byte order).
o Add some debug diagnostics so that we can see MP fragment sending and
  re-assembly.
1998-04-23 18:56:21 +00:00
Brian Somers
789de69642 Mention how to set an ACCMAP for ^Q & ^S. 1998-04-23 18:56:00 +00:00
Brian Somers
dbf60d74f8 o Don't go multilink if the peer hasn't asked for it
o Don't go multilink if the peer hasn't agreed
o When negotiating multilink, don't try to push the peers
  MRU up according to our `set mtu' setting.  Instead, accept
  whatever MRU they want and push their MRRU up instead.
o When *not* negotiating multilink, REJ short sequence number
  REQs.
1998-04-23 18:55:50 +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
fdf6117177 o Remove some unused #includes.
o Make sure our ipcp throughput timer is stopped before being nuked
  with a memset.
o Don't initialise struct async & struct hdlc twice in modem_Create().
o Clarify some comments.
1998-04-21 01:02:32 +00:00
Brian Somers
a7a615faaa Indent Auth name properly. 1998-04-20 00:21:24 +00:00
Brian Somers
f45c790690 Do away with the static struct timeoutArg. Move the
struct pppTimer from struct link to struct physical
for doing carrier checking.
1998-04-20 00:20:41 +00:00
Brian Somers
fe3125a0c3 o Use __attribute__ (#ifdef __GNUC__) to type-check
LogPrintf() and prompt_Printf(), and fix the bits
  identified as being wrong as a result.
1998-04-19 23:09:03 +00:00
Brian Somers
c02f378706 Add "ABORT NO\\sCARRIER" to ``set login'' examples. 1998-04-19 18:52:03 +00:00
Brian Somers
d6c2ac49e3 Show examples of how to use various new features. 1998-04-19 15:25:21 +00:00
Brian Somers
e3c70ce931 Tidy up the use of struct pppTimer. 1998-04-19 15:24:50 +00:00
Brian Somers
1ad3093b3f Correct the args passed to `shell'. 1998-04-19 07:22:31 +00:00
Brian Somers
ba081e4360 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.
1998-04-19 03:41:01 +00:00
Brian Somers
8d9b9867cc 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.
1998-04-19 02:23:21 +00:00
Brian Somers
9dee069d8d Initialise our async escape map (oops, that hurt !). 1998-04-19 01:18:51 +00:00
Brian Somers
39d946522c Destroy struct chat when it's finished in struct datalink.
Initialise chat timers correctly as they're malloc()ed as
part of struct datalink, and initially contain garbage.
1998-04-18 23:17:26 +00:00
Brian Somers
cdbbb6b571 Cosmetic: Clean up warnings. 1998-04-18 01:01:28 +00:00
Brian Somers
3edeb0c69e 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''.
1998-04-17 22:05:37 +00:00
Brian Somers
030e4ebba8 o Remove bundle_LinkLost() and have the modem routines simply
call datalink_Down() where appropriate rather than
  modem_Hangup().
o Now, when something horrible happens (failed read/write, loss
  of carrier etc), we go offline and run any hangup scripts etc
  in a controlled manner - exactly the same as if someone says
  ``down'' at the prompt or sends us a HUP.
o -dedicated links that fail to make the modem raw close it,
  suffer the redial timeout then try to open it again.
o Add a ``carrier lost'' warning diagnostic.
1998-04-17 22:04:36 +00:00
Brian Somers
50e5c17d3b Fix the worst sort of bug - a SEGV in a diagnostic !
Also, use sizeof sockaddr_in instead of 16 when writing
to the routing socket.
1998-04-16 23:06:53 +00:00
Brian Somers
ee084ab956 Stop the idle timer if the timeout is disabled while
the timer is active.
1998-04-16 22:11:46 +00:00
Brian Somers
26afeaa28b o FsmDown() and FsmClose() any NCP that's still around before
going into phase DEAD when the last physical link disappears.
o Don't go to phase TERMINATE if we're already phase DEAD.
1998-04-16 21:19:05 +00:00
Brian Somers
63f98b41d4 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.
1998-04-16 18:30:54 +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
250920922b 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().
1998-04-14 23:17:24 +00:00
Brian Somers
7f717ec1b8 Use datalink_Down when LQR fails, not bundle_Close(). 1998-04-14 07:25:37 +00:00
Brian Somers
c08717df31 Remove `show timeout'' and show auth'' and add `show bundle''.
Mention ``show timer'' in the man page.
1998-04-11 21:50:47 +00:00
Brian Somers
99294c8bfa 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).
1998-04-10 23:51:33 +00:00
Brian Somers
c8dc575810 Nuke the device name *after* unlocking it. 1998-04-10 14:55:11 +00:00
Brian Somers
73406cdfd5 Oops - fix alignment in `show modem'. 1998-04-10 13:22:38 +00:00
Brian Somers
565e35e50e 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.
1998-04-10 13:19:23 +00:00
Brian Somers
c06d604b03 We don't require a newline before the prompt if we've done
a prompt_*Printf().
1998-04-08 18:27:29 +00:00
Brian Somers
ce6694a567 Correct (yesterdays) broken -background flag. 1998-04-08 18:27:22 +00:00