summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mp.c
Commit message (Collapse)AuthorAgeFilesLines
* o Add the -foreground switch. This switch behaves like -background exceptbrian1999-08-191-4/+4
| | | | | | | | | 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''.
* o Obsolete the undocumented ``set weight'' command.brian1999-08-051-17/+75
| | | | | | | | | | | | | | | | | | | | | | | o If we're using RADIUS and the RADIUS mtu is less than our peers mru/mrru, reduce our mtu to this value for NetBSD too. o Make struct throughput's sample period dynamic and tweak the ppp version number to reflect the extra stuff being passed through the local domain socket as a result (MP mode). o Measure the current throughput based on the number of samples actually taken rather than on the full sample period. o Keep the throughput statisics persistent while being passed to another ppp invocation through the local domain socket. o When showing throughput statistics after the timer has stopped, use the stopped time for overall calculations, not the current time. Also show the stopped time and how long the current throughput has been sampled for. o Use time() consistently in throughput.c o Tighten up the ``show bundle'' output. o Introduce the ``set bandwidth'' command. o Rewrite the ``set autoload'' command. It now takes three arguments and works based on a rolling bundle throughput average compared against the theoretical bundle bandwidth over a given period (read: it's now functional).
* Allow our endpoint discriminator to be enabled, disabled, acceptedbrian1999-06-091-1/+4
| | | | | | and denied. This is necessary for some MP implementations that get confused if you accept their endpoint discriminator but reject their MRRU.
* Fix some MP sequence number comparison bogons that are tickled bybrian1999-06-031-6/+8
| | | | | | | having different speed links in a bundle. This would manifest itself by having the link occasionally hang, but revive when a new connection is made.... Make ``show mp'' a bit prettier.
* Oops, quieten a compiler warning.brian1999-06-021-1/+2
|
* o Alter the mbuf type as it's processed by different layers.brian1999-06-021-7/+24
| | | | | | | | 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().
* Don't forget to free the mbufs that get processed bybrian1999-05-281-1/+2
| | | | | mp_Assemble(). Leak spotted by: louqi
* Allow ``host:port/udp'' devices and support ``host:port/tcp'' asbrian1999-05-121-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | being the same as the previous (still supported) ``host:port'' syntax for tcp socket devices. A udp device uses synchronous ppp rather than async, and avoids the double-retransmit overhead that comes with ppp over tcp (it's usually a bad idea to transport IP over a reliable transport that itself is using an unreliable transport). PPP over UDP provides througput of ** 1.5Mb per second ** with all compression disabled, maxing out a PPro/200 when running ppp twice, back-to-back. This proves that PPPoE is plausable in userland.... This change adds a few more handler functions to struct device and allows derivations of struct device (which may contain their own data etc) to pass themselves through the unix domain socket for MP. ** At last **, struct physical has lost all the tty crud ! iov2physical() is now smart enough to restore the correct stack of layers so that MP servers will work again. The version number has bumped as our MP link transfer contents have changed (they now may contain a `struct device'). Don't extract the protocol twice in MP mode (resulting in protocol rejects for every MP packet). This was broken with my original layering changes. Add ``Physical'' and ``Sync'' log levels for logging the relevent raw packets and add protocol-tracking LogDEBUG stuff in various LayerPush & LayerPull functions. Assign our physical device name for incoming tcp connections by calling getpeername(). Assign our physical device name for incoming udp connections from the address retrieved by the first recvfrom().
* o Redesign the layering mechanism and make the aliasing code part ofbrian1999-05-081-13/+44
| | | | | | | | | | | | | | | | | | | | | 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''.
* Initial RADIUS support (using libradius). See the man page forbrian1999-01-281-2/+5
| | | | | | | | | | | | | | | | | | | details. Compiling with -DNORADIUS (the default for `release') removes support. TODO: The functionality in libradius::rad_send_request() needs to be supplied as a set of routines so that ppp doesn't have to wait indefinitely for the radius server(s). Instead, we need to get a descriptor back, select() on the descriptor, and ask libradius to service it when necessary. For now, ppp blocks SIGALRM while in rad_send_request(), so it misses PAP/CHAP retries & timeouts if they occur. Only PAP is functional. When CHAP is attempted, libradius complains that no User-Password has been specified... rfc2138 says that it *mustn't* be used for CHAP :-( Sponsored by: Internet Business Solutions Ltd., Switzerland
* Loosen our restrictions on setting enddisc, mrru,brian1998-10-241-4/+15
| | | | | | | | shortseq, authname and authkey. o Auth{name,key} may additionally be set in PHASE_ESTABLISH. o The others may be set in PHASE_ESTABLISH as long as no links have yet reached DATALINK_LCP.
* Don't cast potentially unaligned addresses to pointers tobrian1998-09-041-13/+16
| | | | | non-char types on non-i386 architectures. On Alpha and Sparc we get a bus error if we do.
* Put the IP buffer queues into struct ipcp.brian1998-08-261-3/+3
| | | | Forgotten by: me
* If we've got a full output buffer queue and cannot sendbrian1998-08-251-1/+7
| | | | | | | | 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.
* o Support callback types NONE, E.164, AUTH and CBCP.brian1998-08-071-1/+2
| | | | | | | | | | | | | | (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.
* The CCP layer now behaves as follows:brian1998-06-301-4/+5
| | | | | | | | | | | | | o If we've denied and disabled all compression protocols, stay in ST_INITIAL and do an LCP protocol reject if we receive any CCP packets. o If we've disabled all compression protocols, go to ST_STOPPED and wait for the other side to ask for something. o If we've got anything enabled, start REQing as soon as the auth layer is up. o If we're in multilink mode, than the link level CCP goes straight to ST_STOPPED irrespective of what's configured so that we never try to compress compressed stuff by default.
* o If we come out of select() with only write descriptors thatbrian1998-06-241-2/+3
| | | | | | | | | | | end up writing zero bytes, sleep for 1/10 of a second so that we don't end up using up too much cpu. This should only ever happen on systems that wrongly report a descriptor as writable despite the tty buffer being full. Discussed with: Jeff Evarts o Do an initial run-time check to see if select() alters the passed timeval. This knowledge isn't yet used, but will be soon.
* Create & use fsm2initial(), a function to bring abrian1998-06-201-3/+2
| | | | | state machine back to ST_INITIAL without going through any unnecessary TLS/TLF pairs.
* Change some log levels. ALERTs are only logged whenbrian1998-06-161-3/+3
| | | | | | something that can't happen happens or when everyone needs to know. ERRORs are only logged when something unexpected happens.
* o De-staticise things that don't need to be static.brian1998-06-151-2/+2
| | | | | | | | | | 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.
* Fix a rather nasty use of `static'. This caused a SEGVbrian1998-06-151-2/+2
| | | | | when running ``link * load label'' as we ended up recursing back into command_Interpret after nuking our command arg list.
* o Don't try to transfer tty device descriptors as there's no way ofbrian1998-05-251-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | transferring session rights with them. Instead, create two `/bin/cat' processes. A new child is spawned and disassociated from the terminal and the parent, which continues with the rest of the ppp process. Meanwhile, the parent spawns another child, and both the parent and child exec the `/bin/cat' commands with the appropriate descriptors. This way, the session is owned by the parent, and the tty is held open. o Close LCPs that have done a TLF and are now in ST_STOPPED before calling Down. This prevents them from trying to come back up again after the peer has shut them down (it seems a bit strange that the rfc says that a Down in ST_STOPPED will cause a TLS etc). o Don't try to set the physical link name pointer when we're receiving and renaming a datalink. The physical hasn't been created yet, and as it happens, the garbage physical pointer happens to be the value of another physical - so we're pointing that other physical name at ourselves. yeuck. o Re-arrange the order of things in main (DoLoop()). We now handle signals only after the select and not before the UpdateSet. It's possible that either a signal (FSM timeout) or a descriptor_Read() brings a link down, after which we'd better tidy up any dead direct and 1off descriptors before calling UpdateSet() again. o Mention when we detect a PPP packet when we see one before the link is up (then start LCP as before).
* o Move our prompt descriptor list outside of the bundle.brian1998-05-231-6/+7
| | | | | | | | | | | | | | | | | | | | It's now dealt with by the `server' object. This simplifies things as we only have one list of prompt descriptors and the log_ routines check prompt::logactive to determine whether it should be used for output. o Include the MP socket UpdateSet() result in bundle::UpdateSet(). o Don't select on the tun device unless we're in NETWORK phase or AUTO mode. o Stop the idle timer when we go to DEAD phase. We may have transferred a link and not had a chance to kill it. o Don't fail when trying to unlink our transferred datalink from our descriptor lists just before the transfer. o Add our link descriptor to the write set if we got a short write the last time (physical::out is set). o Log the connection source address when a connection is closed. o Remove descriptor::next field. Descriptor lists are not required any more.
* o Make sure we adjust our min seq and process any outstanding queuedbrian1998-05-231-6/+27
| | | | | | | | incoming fragments when a link goes down. o Don't use the minimum sequence numbers of links that aren't open. o Understand sequence number wrapping when determining the minimum sequence number. o Add & adjust a few comments.
* o If all CCPs are disabled & denied, don't send a REQ - just enterbrian1998-05-231-1/+2
| | | | STOPPED state waiting for the peer to say something.
* MFMP: Make ppp multilink capable.brian1998-05-211-0/+992
See the file README.changes, and re-read the man page.
OpenPOWER on IntegriCloud