summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ipcp.c
Commit message (Collapse)AuthorAgeFilesLines
* Support radius accounting, and add a packet count to throughputbrian2000-08-281-0/+11
| | | | | | | | | statistics as a side effect. Submitted by: Marcin Cieslak <saper@system.pl> with some tweaks to RAD_ACCT_SESSION_ID and RAD_ACCT_MULTI_SESSION_ID generation by me.
* Don't delete sticky routes when unconfiguring the interface.brian2000-08-141-2/+0
| | | | Deleting all routes that match the interface is sufficient.
* Support link identification from rfc1570brian2000-07-191-1/+1
| | | | Two new commands are available; ``ident'' and ``sendident''.
* Allow ``set urgent none'' to disable all urgent ports and IPTOS_LOWDELAYbrian2000-06-081-1/+3
| | | | | | prioritisation. Requested by: luigi
* Fix a topy (if (expr); command;)brian2000-05-251-1/+1
| | | | Submitted by: Renaud Waldura <renaud@guppy.evolunet.com>
* Don't attempt to fputs(NULL, fp) when ``enable dns'' is given andbrian2000-05-241-2/+3
| | | | | there's no resolv.conf. Use a umask of 022 when creating resolv.conf, not 0644 !
* Add the ``resolv'' command for telling ppp how to deal with resolv.conf.brian2000-03-141-118/+221
| | | | | You can now ``resolv restore'' in ppp.linkdown ! Add DNS0 and DNS1 macros.
* Fix some printf-style argument bugsbrian2000-03-141-1/+2
|
* Introduce LOCALNAT and LOCALRAD defines so that the sources can staybrian2000-03-141-3/+4
| | | | | exactly the same in FreeBSD & OpenBSD despite libalias and libradius being local to the ppp sources under OpenBSD.
* When ppp can't identify the relevant name, don't use "???", usebrian2000-03-141-24/+23
| | | | <nnn> or <0xxxx> instead.
* Add a bunch of `const's and fix a typo.brian1999-12-271-3/+3
| | | | Submitted by: Rich Neswold <rneswold@MCS.Net>
* Cosmetic: Make struct mbuf more like kernel mbufs.brian1999-12-201-2/+2
|
* Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.brian1999-09-211-3/+0
| | | | | | | The original report was due to a mis-installation of the NetBS header files :-/ Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>
* NetBSD has moved ``extern int errno;'' to signal.h :-/brian1999-09-201-0/+3
| | | | Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp>
* Introduce a forth IP packet queue. Urgent packets withbrian1999-09-071-43/+68
| | | | | | | | | ip_tos == IPTOS_LOWDELAY now get precidence over urgent packets with ip_tos != IPTOS_LOWDELAY and non-urgent packets with ip_tos == IPTOS_LOWDELAY. Enhance the ``set urgent'' syntax to allow for urgent UDP packets as well as urgent TCP packets.
* o Split the two IPCP queues into three - one for FSM databrian1999-09-041-1/+112
| | | | | | | | | | | | (LCP/CCP/IPCP), one for urgent IP traffic and one for everything else. o Add the ``set urgent'' command for adjusting the list of urgent port numbers. The default urgent ports are 21, 22, 23, 513, 514, 543 and 544 (Ports 80 and 81 have been removed from the default priority list). o Increase the buffered packet threshold from 20 to 30. o Report the number of packets in the IP output queue and the list of urgent ports under ``show ipcp''.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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).
* Don't use static variables if we don't have to.brian1999-06-081-3/+2
|
* Don't IPCP TLD if we're already doing it. This preventsbrian1999-06-081-19/+23
| | | | | recursion by doing something like ``down'' or ``quit all'' in ppp.linkdown.
* o Alter the mbuf type as it's processed by different layers.brian1999-06-021-3/+5
| | | | | | | | 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().
* Remember if MYADDR or HISADDR is used in a filter add tweak allbrian1999-05-311-3/+6
| | | | filters any time either value changes.
* Deal with the fact that as we now mbuf_Read the fsmbrian1999-05-091-2/+2
| | | | | | | | | header in fsm_Input() we often end up with a NULL mbuf. Deal with a possible NULL mbuf being passed into mbuf_Prepend(). Adjust some spacing to make things more consistent.
* o Redesign the layering mechanism and make the aliasing code part ofbrian1999-05-081-19/+12
| | | | | | | | | | | | | | | | | | | | | 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''.
* Add support for NetBSDbrian1999-04-261-4/+4
|
* #include <errno.h>, not <sys/errno.h>brian1999-04-261-2/+2
|
* Correct some ntohl/htonl bogons in the netmask handling.brian1999-03-031-11/+23
| | | | | | | | | This was pretty harmless as netmasks on a POINTOPOINT interface are pretty much ignored, but it looked funny. Mention the configured netmask in ``show ipcp''. Describe in more detail what a proxy arp entry is.
* Allow control over the number of ConfigREQ & TermREQ attemptsbrian1999-02-261-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that are made in each of the FSMs (LCP, CCP & IPCP) and the number of REQs/Challenges for PAP/CHAP by accepting more arguments in the ``set {c,ip,l}cpretry'' and ``set {ch,p}apretry'' commands. Change the non-convergence thresholds to 3 times the number of configured REQ tries (rather than the previous fixed ``10''). We now notice repeated NAKs and REJs rather than just REQs. Don't suggest that CHAP 0x05 isn't supported when it's not configured. Fix some bugs that expose themselves with smaller numbers of retries: o Handle instantaneous disconnects (set device /dev/null) correctly by stopping all fsm timers in fsm2initial. o Don't forget to uu_unlock() devices that are files but are not ttys (set device /dev/zero). Fix a *HORRENDOUS* bug in RFC1661 (already fixed for an Open event in state ``Closed''): According to the state transition table, a RCR+ or RCR- received in the ``Stopped'' state are supposed to InitRestartCounter, SendConfigReq and SendConfig{Ack,Nak}. However, in ``Stopped'', we haven't yet done a TLS (or the last thing we did is a TLF). We must therefore do the TLS at this point ! This was never noticed before because LCP and CCP used not use LayerStart() for anything interesting, and IPCP tends to go into Stopped then get a Down because of an LCP RTR rather than getting a RCR again.
* Decouple pap & chap output routines from the correspondingbrian1999-02-061-4/+1
| | | | | | | | | | | | | | | | | | | | | | | input routines and take advantage of the new init/continue interface in libradius. This allows a timely response on other links in an MP setup while RADIUS requests are in progress as well as the ability to handle other data from the peer in parallel. It should also make the future addition of PAM support trivial. While I'm in there, validate pap & chap header IDs if ``idcheck'' is enabled (the default) for other FSM packet types. NOTE: This involved integrating the generation of chap challenges and the validation of chap responses (and commenting what's going on in those routines). I currently have no way of testing ppps ability to respond to M$Chap CHALLENGEs correctly, so if someone could do the honours, it'd be much appreciated (it *looks* ok!). Sponsored by: Internet Business Solutions Ltd., Switzerland
* Encode & Decode the PROTOCOMP fields correctly.brian1999-02-021-14/+41
| | | | | | | When NAKing the peer, get as close as we can to what he REQd. When the peer NAKs us, get as close as we can to what they NAKd with on our next REQ.
* Initial RADIUS support (using libradius). See the man page forbrian1999-01-281-16/+41
| | | | | | | | | | | | | | | | | | | 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
* Add ``enable proxyall'' support. This adds proxy ARP entriesbrian1998-10-261-5/+47
| | | | | | | | | | for every machine on every class C or smaller subnet that we route to. Add ``set {send,recv}pipe'' for controlling our socket buffer sizes. Mention the IP number with the problem in a few error messages. All submitted by: Craig Leres <leres@ee.lbl.gov> Modified slightly by: me
* Solve the ``first connection'' problem that occurs onbrian1998-10-221-144/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | demand-dial links with dynamic IP numbers where the program that causes the dial bind()s to an interface address that is subsequently changed after ppp negotiation. The problem is defeated by adding negotiated addresses to the tun interface as additional alias addresses and providing a set of ``iface'' commands for managing the interface. Libalias is also required (and what a name clash!) - it happily IP-aliases the address so that the source is that of the primary (negotiated) interface and un-IP-aliases it on the way back. An ``enable iface-alias'' is done implicitly by the -alias command line switch. If -alias isn't given, iface-aliasing is disabled by default and can't be enabled 'till an ``alias enable yes'' is done. ``alias enable no'' silently disables iface-alias. So, for dynamic-IP-type-connections, running ``ppp -alias -auto blah'' will work for the first connection, although existing bindings will not survive a disconnect/connect as the TCP peer will be trying to send to the old IP address - the packets won't route. It's now a lot easier to add IPXCP to ppp with minor updates to the new iface.[ch] (if anyone ever gets 'round to it). It's also now possible to manually add interface aliases with something like ``iface add 1.2.3.4/24 5.6.7.8''. This allows multi-homed ppp links :-)
* Sync with OpenBSD ifdefsbrian1998-09-171-4/+8
|
* Don't cast potentially unaligned addresses to pointers tobrian1998-09-041-14/+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/+4
| | | | Forgotten by: me
* o Support callback types NONE, E.164, AUTH and CBCP.brian1998-08-071-2/+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.
* o Fix remaining sizeof problems for 64 bit machines.brian1998-06-271-11/+8
| | | | | | | | | | o Allow ``set ....'' when we have multiple links but aren't in multilink mode. o Do a TLS when we receive a ``Open'' event in ``Closed'' state, despite the rfc state transition table. This is clearly an error in the RFC as TLS cannot have yet been called (without TLF) in the ``Closed'' state. I've posted a message to comp.protocols.ppp for confirmation.
* More u_long -> u_int32_tbrian1998-06-271-3/+3
|
* Remove redundant includesbrian1998-06-271-2/+1
|
* Don't dlopen()/dlsym() libalias, use it in the same waybrian1998-06-271-3/+6
| | | | as the rest of the world uses libraries.
* Add ``ipcp'' as an optional argument to ``open'', and makebrian1998-06-251-7/+13
| | | | | | | | | open capable of re-negotiatiating the various layers. It is now possible to change various link options and then re-open the relevant layer, making the changes effective - for example, switching off VJ compression or starting ECHO LQRs on-the-fly.
* Change some log levels. ALERTs are only logged whenbrian1998-06-161-4/+4
| | | | | | something that can't happen happens or when everyone needs to know. ERRORs are only logged when something unexpected happens.
* 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.
* Give ``load'' optional context. It's now possible tobrian1998-06-151-10/+10
| | | | | ``link 1,2,3 load label'' for people that want to set up their links in a more mpd-like manner.
* o Maintain a link-type mask for open datalinks as well asbrian1998-06-121-2/+2
| | | | | | | | | | | for all datalinks in a bundle. Ppp now deals correctly with link types that are changed while open o When changing the type of the last AUTO link, only clear the interface if we're not in PHASE_NETWORK. This allows us to switch to -ddial mode while we have a connection without suddenly unexpectedly throttling ourselves by clearing the interface configuration. Problem area noted by: Aaron Jeremias Luz <aaron@csh.rit.edu>
* o Make modes consistent throughout ppp. The same strings are usedbrian1998-05-291-4/+4
| | | | | | | | | | | | | | | in `set mode', `allow modes', on the command line and when outputting mode names. The strings are matched so that only enough characters to uniquely identify the string are required, so you can now ppp -a mylabel (for auto mode) ppp -b mylabel (for background mode) ppp -dd mylabel (for direct dial mode) etc. o Make -ddial dial when specified on the command line (oops). Pointed out by: Alex <garbanzo@hooked.net>
* o Move our prompt descriptor list outside of the bundle.brian1998-05-231-2/+2
| | | | | | | | | | | | | | | | | | | | 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.
* MFMP: Make ppp multilink capable.brian1998-05-211-380/+786
| | | | See the file README.changes, and re-read the man page.
OpenPOWER on IntegriCloud