aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* ppp: Use valid prototypes for function declarations with no arguments.John Baldwin2023-04-241-1/+1
| | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39730
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* Add "iface name" and "iface description" commands.Brian Somers2011-02-071-5/+6
| | | | | | | | | PR: 151400 Submitted by: Aragon Gouveia - aragon at phat dot za dot net with minor fixes MFC after: 3 weeks Notes: svn path=/head/; revision=218397
* When ``ppp -direct'' is invoked by a program that uses pipe(2) toBrian Somers2009-08-241-2/+4
| | | | | | | | | | | | | | | | create stdin and stdout, don't blindly try to use stdin as a bi-directional channel. Instead, detect the pipe and set up a special exec handler that indirects write() calls through stdout. This fixes the problem where ``set device "!ssh -e none host ppp -direct label"'' no longer works with an openssh-5.2 server side as that version of openssh ignores the USE_PIPES config setting and *always* uses pipes (rather than socketpair) for stdin/stdout channels. MFC after: 3 days Notes: svn path=/head/; revision=196514
* Update to the "new" libalias API (and thus fix world breakage).Paolo Pisati2008-03-121-1/+2
| | | | Notes: svn path=/head/; revision=177100
* The C define is NONAT.Ruslan Ermilov2004-12-211-1/+1
| | | | Notes: svn path=/head/; revision=139116
* Send NAS-IP-Address as well as NAS-IdentifierBrian Somers2004-11-291-1/+1
| | | | | | | | | | | Add ``disable NAS-IP-Address'' and ``disable NAS-Identifier'' options to support pre-rfc2865 RADIUS servers. This pushes our enable/disable items over the 32 bit limit, so reoganise things to allow a bunch more options. Go to version 3.4.1 so that any compatability problems can be identified. Notes: svn path=/head/; revision=138198
* Make ppp WARNS=5 cleanBrian Somers2004-09-051-7/+8
| | | | Notes: svn path=/head/; revision=134789
* Include the correct file (stdarg.h) and use va_list rather than _BSD_VA_LIST_Brian Somers2002-08-271-0/+1
| | | | | | | Suggested by: mike Notes: svn path=/head/; revision=102500
* Don't use SignalBundle if it's not setBrian Somers2002-06-281-3/+6
| | | | | | | Submitted by: Federico G. Schwindt <fgsch@olimpo.com.br> Notes: svn path=/head/; revision=98970
* Add some missing #includes that weren't required due to namespace polutionBrian Somers2002-05-221-0/+1
| | | | | | | | | in our headers. Submitted by: bde Notes: svn path=/head/; revision=97140
* o Clean up some #includesBrian Somers2002-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> Notes: svn path=/head/; revision=96582
* Usage style sweep: spell "usage" with a small 'u'.Dag-Erling Smørgrav2002-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}/. Notes: svn path=/head/; revision=95258
* Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's lineBrian Somers2002-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. Notes: svn path=/head/; revision=93418
* Probe for the availability of AF_INET6 at startup. If it's notBrian Somers2001-08-151-3/+2
| | | | | | | | available, default ipv6cp to disabled and refuse to let the user enable it. Notes: svn path=/head/; revision=81697
* o Add ipv6 support, abstracting most NCP addresses into opaqueBrian Somers2001-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> Notes: svn path=/head/; revision=81634
* Make the last fix work properly on descriptors 1 and 2 (not just 0)Brian Somers2001-07-041-1/+1
| | | | Notes: svn path=/head/; revision=79186
* Handle any of descriptors 0, 1 or 2 being closed when we'reBrian Somers2001-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 Notes: svn path=/head/; revision=79173
* Convert IIJ copyrights to BSD copyrights.Brian Somers2001-06-131-18/+24
| | | | | | | Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp> Notes: svn path=/head/; revision=78189
* Don't say ``PPP enabled'' if we're given the -quiet switchBrian Somers2001-04-031-2/+4
| | | | Notes: svn path=/head/; revision=75120
* Change _PATH_PPP to PPP_CONFDIR and allow it to be overridden at compile timeBrian Somers2001-03-231-1/+1
| | | | Notes: svn path=/head/; revision=74687
* Allow ``set server closed'' to close the diagnostic socket.Brian Somers2001-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. Notes: svn path=/head/; revision=71657
* Various whitespace changes.Brian Somers2000-10-301-2/+2
| | | | | | | Make some functions static. Notes: svn path=/head/; revision=67912
* Create fd_sets big enough to handle getdtablesize() descriptors.Brian Somers2000-10-091-34/+42
| | | | Notes: svn path=/head/; revision=66898
* Add a missing ``break''Brian Somers2000-04-091-0/+1
| | | | Notes: svn path=/head/; revision=59104
* When running ppp -background, show comfort messages showingBrian Somers2000-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. Notes: svn path=/head/; revision=59084
* Call bundle_CleanDatalinks() after UpdateSet() in case we'reBrian Somers2000-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. Notes: svn path=/head/; revision=58453
* Correct some typos introduced in the descriptor -> fdescriptor change.Brian Somers2000-03-141-2/+2
| | | | Notes: svn path=/head/; revision=58038
* Introduce LOCALNAT and LOCALRAD defines so that the sources can stayBrian Somers2000-03-141-3/+4
| | | | | | | | exactly the same in FreeBSD & OpenBSD despite libalias and libradius being local to the ppp sources under OpenBSD. Notes: svn path=/head/; revision=58037
* The interface list that comes back from the PF_ROUTE/NET_RT_IFLIST mibBrian Somers2000-03-141-0/+2
| | | | | | | | | is aligned. Teach this to ``show route''. Clean up some of the sockaddr parsing routines. Notes: svn path=/head/; revision=58032
* To avoid namespace polution in NetBSD:Brian Somers2000-03-141-2/+2
| | | | | | | ``struct descriptor'' -> ``struct fdescriptor'' Notes: svn path=/head/; revision=58028
* Use TUNSIFPID when we change our PID (if it exists).Brian Somers2000-01-211-0/+1
| | | | Notes: svn path=/head/; revision=56350
* Add a bunch of `const's and fix a typo.Brian Somers1999-12-271-1/+1
| | | | | | | Submitted by: Rich Neswold <rneswold@MCS.Net> Notes: svn path=/head/; revision=55146
* depricated -> deprecated + mention the -alias flag status in README.changesBrian Somers1999-11-291-2/+2
| | | | Notes: svn path=/head/; revision=53889
* Make -foreground a proper option (allowing ``allow mode foreground'',Brian Somers1999-11-281-3/+2
| | | | | | | ``set mode foreground'' etc. Notes: svn path=/head/; revision=53830
* Fix ``set proctitle'' by using setproctitle().Brian Somers1999-11-171-5/+3
| | | | Notes: svn path=/head/; revision=53298
* Don't recurse into datalink_UpdateSet() afterBrian Somers1999-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. Notes: svn path=/head/; revision=53070
* Correct the ``-unix X'' parsing (last time I only correctedBrian Somers1999-11-091-1/+2
| | | | | | | | | ``-unitX''. Pointed out twice by: Gert-Jan Vons <gert-jan@bigfoot.com> Notes: svn path=/head/; revision=53067
* Don't treat -unit as a mode flag when counting mode flags.Brian Somers1999-11-091-0/+1
| | | | | | | Submitted by: Gert-Jan Vons <gert-jan@bigfoot.com> Notes: svn path=/head/; revision=53043
* Add the -unit command line switch for specifying the tun device.Brian Somers1999-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. Notes: svn path=/head/; revision=52396
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* o Add the -foreground switch. This switch behaves like -background exceptBrian Somers1999-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''. Notes: svn path=/head/; revision=50059
* Insist that ppp.conf and it's parent directories aren't `other'Brian Somers1999-08-091-2/+5
| | | | | | | | | | writable rather than not being writable at all. PR: 13009 Kind-of submitted by: Anthony Kimball <alk@pobox.com> Notes: svn path=/head/; revision=49581
* Ignore repeated signals sent to the parent in backgroundBrian Somers1999-05-131-1/+2
| | | | | | | mode. Notes: svn path=/head/; revision=47119
* o Redesign the layering mechanism and make the aliasing code part ofBrian Somers1999-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''. Notes: svn path=/head/; revision=46686
* Add support for NetBSDBrian Somers1999-04-261-4/+4
| | | | Notes: svn path=/head/; revision=46086
* Maintain a `necessary' marker to indicate that we *probably*Brian Somers1999-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. Notes: svn path=/head/; revision=45126
* Reopen descriptor 0 as /dev/tty when in interactive modeBrian Somers1999-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. Notes: svn path=/head/; revision=44539