summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Include the correct file (stdarg.h) and use va_list rather than _BSD_VA_LIST_brian2002-08-271-0/+1
| | | | Suggested by: mike
* Don't use SignalBundle if it's not setbrian2002-06-281-3/+6
| | | | Submitted by: Federico G. Schwindt <fgsch@olimpo.com.br>
* Add some missing #includes that weren't required due to namespace polutionbrian2002-05-221-0/+1
| | | | | | in our headers. Submitted by: bde
* o Clean up some #includesbrian2002-05-141-2/+0
| | | | | | | | | | | | | | | | | | o Bump version number to 3.0.4 o When talking to a RADIUS server, provide a NAS-Port-Type. When the NAS-Port-Type is Ethernet, provide a NAS-Port value equal to the SESSIONID from the environment in direct mode or the NGM_PPPOE_SESSIONID message in other modes. If no SESSIONID is found, default to the interface index in client mode or zero in server mode. When the NAS-Port-Type is ISDN, set the NAS-Port to the minor number of the physical device (ie, the N in /dev/i4brbchN). This makes it easier for the RADIUS server to identify the client WRT accounting data etc. Prompted by: lsz8425 <lsz8425@mail.cd.hn.cn>
* Usage style sweep: spell "usage" with a small 'u'.des2002-04-221-1/+1
| | | | | Also change one case of blatant __progname abuse (several more remain) This commit does not touch anything in src/{contrib,crypto,gnu}/.
* Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's linebrian2002-03-301-2/+2
| | | | | | | | discipline to do the async escaping, but no other benefits are available yet. Change ``ifdef HAVE_DES'' to ``ifndef NODES'' for consistency. Make the Makefile a little more sane WRT RELEASE_CRUNCH.
* Probe for the availability of AF_INET6 at startup. If it's notbrian2001-08-151-3/+2
| | | | | available, default ipv6cp to disabled and refuse to let the user enable it.
* o Add ipv6 support, abstracting most NCP addresses into opaquebrian2001-08-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | structures (well, they're treated as opaque). It's now possible to manage IPv6 interface addresses and routing table entries and to filter IPV6 traffic whether encapsulated or not. IPV6CP support is crude for now, and hasn't been tested against any other implementations. RADIUS and IPv6 are independent of eachother for now. ppp.linkup/ppp.linkdown aren't currently used by IPV6CP o Understand all protocols(5) in filter rules rather than only a select few. o Allow a mask specification for the ``delete'' command. It's now possible to specifically delete one of two conflicting routes. o When creating and deleting proxy arp entries, do it for all IPv4 interface addresses rather than doing it just for the ``current'' peer address. o When iface-alias isn't in effect, don't blow away manually (via ``iface add'') added interface addresses. o When listening on a tcp server (diagnostic) socket, bind so that a tcp46 socket is created -- allowing both IPv4 and IPv6 connections. o When displaying ICMP traffic, don't display the icmp type twice. When display traffic, display at least some information about unrecognised traffic. o Bump version Inspired after filtering work by: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
* Make the last fix work properly on descriptors 1 and 2 (not just 0)brian2001-07-041-1/+1
|
* Handle any of descriptors 0, 1 or 2 being closed when we'rebrian2001-07-041-1/+18
| | | | | | | | | | envoked -- don't use them (as return values from open()), then (say) close(STDIN_FILENO) when daemonising. This is done by grabbing 3 descriptors to /dev/null at startup and releasing them after we've daemonised. MFC after: 1 week
* Convert IIJ copyrights to BSD copyrights.brian2001-06-131-18/+24
| | | | Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp>
* Don't say ``PPP enabled'' if we're given the -quiet switchbrian2001-04-031-2/+4
|
* Change _PATH_PPP to PPP_CONFDIR and allow it to be overridden at compile timebrian2001-03-231-1/+1
|
* Allow ``set server closed'' to close the diagnostic socket.brian2001-01-261-1/+10
| | | | | | | | | Allow ``set server open'' to re-open the diagnostic socket. Handle SIGUSR1 by re-opening the diagnostic socket When receiving SIGUSR2 (and in ``set server none''), don't forget the socket details so that ``set server open'' and SIGUSR1 open it again. Don't create the diagnostic socket as uid 0 ! It's far to dangerous.
* Various whitespace changes.brian2000-10-301-2/+2
| | | | Make some functions static.
* Create fd_sets big enough to handle getdtablesize() descriptors.brian2000-10-091-34/+42
|
* Add a missing ``break''brian2000-04-091-0/+1
|
* When running ppp -background, show comfort messages showingbrian2000-04-071-24/+23
| | | | | | | | when we're redialing/reconnecting. While we're here, log redial, reconnect and phone number announcements to LogCHAT, and reduce some other logging to LogDEBUG.
* Call bundle_CleanDatalinks() after UpdateSet() in case we'rebrian2000-03-221-0/+1
| | | | | | | | dropping out of background/foreground/direct mode. This avoids either having to wait for the redial timer before exiting or jaming up in select() waiting for something that'll never happen.
* Correct some typos introduced in the descriptor -> fdescriptor change.brian2000-03-141-2/+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.
* The interface list that comes back from the PF_ROUTE/NET_RT_IFLIST mibbrian2000-03-141-0/+2
| | | | | | is aligned. Teach this to ``show route''. Clean up some of the sockaddr parsing routines.
* To avoid namespace polution in NetBSD:brian2000-03-141-2/+2
| | | | ``struct descriptor'' -> ``struct fdescriptor''
* Use TUNSIFPID when we change our PID (if it exists).brian2000-01-211-0/+1
|
* Add a bunch of `const's and fix a typo.brian1999-12-271-1/+1
| | | | Submitted by: Rich Neswold <rneswold@MCS.Net>
* depricated -> deprecated + mention the -alias flag status in README.changesbrian1999-11-291-2/+2
|
* Make -foreground a proper option (allowing ``allow mode foreground'',brian1999-11-281-3/+2
| | | | ``set mode foreground'' etc.
* Fix ``set proctitle'' by using setproctitle().brian1999-11-171-5/+3
|
* Don't recurse into datalink_UpdateSet() afterbrian1999-11-091-2/+2
| | | | | | | | | | | doing a HangupDone(). The HangupDone() may fuel bundle_CleanDatalinks(), and if so, the bogus UpdateSet() ends up select()ing on a closed descriptor..... Change the main `do/while' loop to a `for' loop so that any `continue's do the bundle_CleanDatalinks() & bundle_IsDead() bit.
* Correct the ``-unix X'' parsing (last time I only correctedbrian1999-11-091-1/+2
| | | | | | ``-unitX''. Pointed out twice by: Gert-Jan Vons <gert-jan@bigfoot.com>
* Don't treat -unit as a mode flag when counting mode flags.brian1999-11-091-0/+1
| | | | Submitted by: Gert-Jan Vons <gert-jan@bigfoot.com>
* Add the -unit command line switch for specifying the tun device.brian1999-10-191-38/+66
| | | | | | Warn about -alias being depricated (but still allow it). Don't moan twice about failing to open any tun device. Fix a diagnostic and add the -quiet switch to the usage message.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* o Add the -foreground switch. This switch behaves like -background exceptbrian1999-08-191-62/+75
| | | | | | | | | 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''.
* Insist that ppp.conf and it's parent directories aren't `other'brian1999-08-091-2/+5
| | | | | | | writable rather than not being writable at all. PR: 13009 Kind-of submitted by: Anthony Kimball <alk@pobox.com>
* Ignore repeated signals sent to the parent in backgroundbrian1999-05-131-1/+2
| | | | mode.
* o Redesign the layering mechanism and make the aliasing code part ofbrian1999-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | | 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
|
* Maintain a `necessary' marker to indicate that we *probably*brian1999-03-301-1/+12
| | | | | | | | | | | | | | | need to process a signal (usually a SIGALRM). Check to see if we need to process a signal both before *and* after calling select() as older (pre-2.0) versions of ppp used to. This handles the possibility that ppp may block at some point (maybe due to an open() of a misconfigured device). Previously, we'd potentially lock up in select(). The `necessary' marker reduces the increased signal checking overhead so that at full speed with no compression transferring an 83Mb file via a ``!ppp -direct'' device, we get a 1% throughput gain.
* Reopen descriptor 0 as /dev/tty when in interactive modebrian1999-03-071-6/+4
| | | | | | in OpenBSD as well as FreeBSD (I still don't know why). Add a debug diagnostic when creating a child process as a link.
* Decouple pap & chap output routines from the correspondingbrian1999-02-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Don't allow root to specify non-existent labels onbrian1999-02-021-5/+4
| | | | | | the command line. Revise the error diagnostics so that invalid labels are reported immediately.
* 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
* Don't SEGV when ``set proctitle'' is used in the defaultbrian1999-01-251-4/+10
| | | | | | section. Submitted by: Dan Lukes <dan@obluda.cz> PR: 9669
* When using ``set device !someprogram'', when ``someprogram''brian1998-12-101-3/+7
| | | | | | | exits, it causes a select() exception. Handle these select() exceptions on link descriptors in pretty much the same way as loss of carrier rather than dropping out in confusion.
* Allow multiple systems (config labels) on the commandbrian1998-10-311-58/+51
| | | | | | line and in the ``load'' & ``dial'' commands. The last label loaded becomes the current label name. Only require a label for -auto mode.
* Solve the ``first connection'' problem that occurs onbrian1998-10-221-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 forget to call PacketAliasInit().brian1998-08-091-1/+7
| | | | PR: 7515
* 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.
OpenPOWER on IntegriCloud