summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* On receipt of a sig 15, do a full bundle_Close() even ifbrian1998-08-021-3/+2
| | | | | our current phase is PHASE_DEAD as it's possible that there are links stuck in OPENING waiting for a redial timer.
* Remove redundant includesbrian1998-06-271-5/+1
|
* Don't dlopen()/dlsym() libalias, use it in the same waybrian1998-06-271-7/+10
| | | | as the rest of the world uses libraries.
* ``struct tunnel_header'' -> u_int32_t in OpenBSD.brian1998-06-271-2/+1
| | | | | | struct tunnel_header is going soon. Suggested by: Theo
* o If we come out of select() with only write descriptors thatbrian1998-06-241-6/+28
| | | | | | | | | | | 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.
* Change some log levels. ALERTs are only logged whenbrian1998-06-161-3/+4
| | | | | | something that can't happen happens or when everyone needs to know. ERRORs are only logged when something unexpected happens.
* Don't bring the modem offline or hangup when ``down lcp''brian1998-06-161-2/+2
| | | | is done. Instead, behave like ``close lcp''.
* 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.
* Give ``load'' optional context. It's now possible tobrian1998-06-151-3/+3
| | | | | ``link 1,2,3 load label'' for people that want to set up their links in a more mpd-like manner.
* Make `close lcp' just close the LCP layer and not hangup. This isbrian1998-06-151-3/+3
| | | | | | useful for slirp users that wish to get their shell back after the ppp session. `close' with no args still hangs up as expected. Required by: jmz
* Put the correct pid in /var/run/tunX.pidbrian1998-06-061-1/+3
| | | | Suggested by: many
* o If there's a session leader left running for a descriptorbrian1998-05-291-5/+3
| | | | | | | | | | | that we're now closing, manually HUP that session leader so that the tty is fully released. o Always restart our carrier detect timer in the receiving process if it was running in the sending process (as we now *always* pass the descriptor). o Tweak argv when we go into pause() mode to keep our session so that ps can see what's going on (without checking for a `pause' state in `ps -l').
* o Make modes consistent throughout ppp. The same strings are usedbrian1998-05-291-46/+36
| | | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud