summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/defs.h
Commit message (Collapse)AuthorAgeFilesLines
* When it's necessary to kldload tun(4), don't forget to re-try to openbrian2002-04-151-1/+1
| | | | | | tun0. Submitted by: qhwt@myrealbox.com
* Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's linebrian2002-03-301-0/+5
| | | | | | | | 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.
* Add a ``log'' command for logging specific information.brian2001-11-031-0/+1
| | | | | | | | | | | | | | Add an ``UPTIME'' variable to indicate the bundle uptime. It's now possible to put something like this in ppp.linkdown for a server setup: MYADDR: log Session closing: User USER, address HISADDR, up UPTIME Fixed some memory leakage with commands that expand words. Made some functions static. Fixed a diagnostic bug (iface add .... SIOCDIFADDR)
* Convert IIJ copyrights to BSD copyrights.brian2001-06-131-16/+24
| | | | Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp>
* Change _PATH_PPP to PPP_CONFDIR and allow it to be overridden at compile timebrian2001-03-231-1/+3
|
* Allow LQR periods of 1 second and FSM retry periods of 1 second. This allows usroger2001-03-191-2/+2
| | | | | | | | to run PPP over Radiocontact T-Link Radio Modems which run best when something is transmitted at least every 1.5 seconds. Tested by: Jennifer Clark <jen@telepresence.strath.ac.uk> Approved by: Brian
* Add MPPE and MSChap v2 support (denied and disabled by default)brian2000-10-301-0/+1
| | | | Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>
* Create fd_sets big enough to handle getdtablesize() descriptors.brian2000-10-091-0/+2
|
* Use arc4random() instead of random()brian2000-08-311-0/+6
|
* setproctitle() doesn't need to be called with root privs, so movebrian2000-08-161-0/+1
| | | | it from id.c into defs.c
* Add ``set ifqueue'' to control the size of the outgoing packetbrian2000-06-111-0/+1
| | | | | | | queue. Doing ``set ifqueue 0'' and ``set urgent none'' will allow full use of luigi's WF2Q code. Requested by: luigi
* When running ppp -background, show comfort messages showingbrian2000-04-071-4/+8
| | | | | | | | 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.
* When ppp can't identify the relevant name, don't use "???", usebrian2000-03-141-0/+2
| | | | <nnn> or <0xxxx> instead.
* 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.
* Don't allowt '#' as a comment when it's embedded in quotes:brian1999-12-271-0/+5
| | | | | | | | set something "xxx yyy # zzz" aaa shouldn't be interpreted as set something "xxx yyy" aaa
* Understand double-quotes anywhere on a command line in the samebrian1999-12-231-1/+1
| | | | | way that a shell does. The previous way ppp did it just didn't make any sense.
* Don't munge ``set dial|login|logout|hangup'' arguments beforebrian1999-12-221-2/+2
| | | | ExpandString() has a chance to do its own substitutions.
* Handle comments at the end of lines.brian1999-12-201-0/+1
|
* Make -foreground a proper option (allowing ``allow mode foreground'',brian1999-11-281-1/+2
| | | | ``set mode foreground'' etc.
* Change ``set cd'' so that its default value is device specific. Thebrian1999-11-261-2/+1
| | | | | default is still 1 second for ttys, but is now 6 seconds for i4b (ISDN) devices and 5 seconds for ethernet (PPPoE) devices.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* o Obsolete the undocumented ``set weight'' command.brian1999-08-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 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).
* Increase the length of an individual device name to LINE_LEN.brian1999-06-011-3/+4
| | | | | Adjust the base physical device name correctly after a link transfer (allowing correct multilink callbacks).
* o Redesign the layering mechanism and make the aliasing code part ofbrian1999-05-081-1/+4
| | | | | | | | | | | | | | | | | | | | | 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''.
* Change ``set device'' so that it parses its arguments as onebrian1999-04-271-4/+5
| | | | | | | | | | device per argument rather than the old way of concatenating everything then splitting the result at commas and whitespace. Old syntax of ``set device /dev/cuaa0, /dev/cuaa1'' may no longer contain the comma, but syntax such as ``set device "!ssh host ppp -direct label"'' is now possible.
* Allow control over the number of ConfigREQ & TermREQ attemptsbrian1999-02-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Parse IP addresses more securely - specifically, don't allowbrian1999-02-251-1/+2
| | | | | | | | a bum name to return as 0.0.0.0... we don't want ``delete xxx'' to delete the default route when xxx doesn't resolve. Support IP number specifications as the host when specifying a tcp-style device (rather than *just* hostnames).
* Wait by default for one second after the login scriptbrian1999-02-161-1/+2
| | | | | | | | | | | | | | | | | is complete before checking carrier. If it's there, the device supports carrier. If it's not it doesn't. Add the ``set cd'' command for deciding how soon to check for carrier, and for deciding if carrier is REQUIRED. The default has changed: Pre 2.0 versions of ppp waited for 1 second. Version 2 didn't wait, but this causes problems with some (few?) modems that don't assert carrier immediately on reporting CONNECT. The one second delay is back now and can be removed with ``set cd 0''. Bump the ppp version number in case this needs to be changed again....
* When resending chap challenges, resend the same challengebrian1999-02-111-2/+2
| | | | | | | | | | | | | | | | | | | each time rather than making up a new one. Increase the authname/authkey max sizes to 100 characters. Allow ``authkey'' specifications beginning with ``!''. When a challenge is received, the text following the ``!'' is executed as a program (expanding stuff in the same way that ``sh'' and ``!bg'' do). The program is passed the peer name, peer challenge and local ``authname'' on standard input and is expected to output the name/key combination that should be used to build the CHAP response. This provides support for Secure ID cards (guess what I was given at work recently!) using CHAP. Examples will follow.
* Initial RADIUS support (using libradius). See the man page forbrian1999-01-281-1/+4
| | | | | | | | | | | | | | | | | | | 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
* If we've got a full output buffer queue and cannot sendbrian1998-08-251-2/+3
| | | | | | | | 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.
* Change MIN_LQRPERIOD from 5 to 2.brian1998-07-111-3/+3
|
* o Fix remaining sizeof problems for 64 bit machines.brian1998-06-271-1/+3
| | | | | | | | | | 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.
* o Make modes consistent throughout ppp. The same strings are usedbrian1998-05-291-9/+9
| | | | | | | | | | | | | | | 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 #define the name "tun" in defs.h against the future possibilitybrian1998-05-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | of supporting architectures with different device names. o Close /dev/tunX when destroying the bundle. o Don't forget to close the parent end of the pipe in the child process when exec'ing a program from a chat script. o If we close our controlling terminal, ditch the current session with it, allowing getty(8) (or whatever) to regain control. o After transferring our controlling terminal descriptor to another ppp instance, we now fork a new ppp to continue where we left off, transferring ownership of all uucp locks and the /var/run/tunX.pid file. Meanwhile the parent closes all file descriptors, defaults all signals and does a pause() to wait for a HUP after the transferred descriptor is finally closed. We don't run /bin/cat any more (again!). Suggested by: bde TODO: It seems clocal devices need their pause()d session leader to be given a manual HUP, as closing the last open descriptor doesn't do the job.
* MFMP: Make ppp multilink capable.brian1998-05-211-38/+30
| | | | See the file README.changes, and re-read the man page.
* Show who closes the diagnostic connection.brian1997-12-271-2/+2
| | | | | | Show the IP range (if specified) in "show ipcp". Close unused descriptors 0 and 2 in interactive mode. Pass (size_t *) rather than (int *) to sysctl().
* Fix prototypes.brian1997-11-221-1/+2
| | | | | | | | | | | | | | Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall).
* Add and use a DropClient() function for closing the diagnostic port.brian1997-11-181-1/+2
| | | | Call DropClient() from Cleanup() too.
* Add id strings to tun.[ch].brian1997-11-171-1/+2
| | | | Don't try to open ppp.secret if we're never going to use it.
* Finish the security improvements:brian1997-11-111-2/+6
| | | | | | | | | | | | | | | | | | | o Add "allow" command: "allow users a b c" gives access to users a, b and c. "allow modes auto" gives those users access to auto mode only. "allow users *" and "allow modes *" are accepted. No users and all modes are allowed by default. UID 0 can do anything. o Set the current label with the "load" and "dial" commands so that the call to ppp.linkdown makes sense. o Up the verison number. o Don't OR MODE_AUTO for -background and -ddial. o Don't OR MODE_INTER when we get a diagnostic connection. o Allow up to 40 args per line (was 20). o "set ifaddr" only changes the interface in AUTO mode (with other modes, it happens after IPCP negotiation). o Sort command descriptions in the man page. o Support -dedicated mode where we just talk ppp forever (no login etc).
* Increase chat script sizes to 512brian1997-11-091-1/+3
| | | | Requested by: Michael Reifenberger <root@totum.plaut.de>
* Cosmetic:brian1997-10-261-6/+1
| | | | Move prototypes into the correct headers.
* Cosmetic (no functional changes):brian1997-10-261-45/+23
| | | | | | | | | | | | | | | o Add missing $Id$s o Move extern decls from .c -> .h files o Staticize o Remove #includes from .h files o style(9)ify includes o bcopy -> memcpy bzero -> memset bcmp -> memcmp index -> strchr rindex -> strrchr o Move timeout.h -> timer.h (making it consistent w/ timer.c) o Add -Wmissing-prototypes
* sleep => nointr_sleepbrian1997-10-241-5/+3
| | | | | | usleep => nointr_usleep (not just a #define) Already done by: ache
* Restore back non-interruptable sleep/usleep just redefine them to notache1997-10-231-1/+9
| | | | mix with standard library functions
* Cosmetic: Remove unused variables and build on OpenBSD.brian1997-09-101-2/+7
|
* Make the code format more in line with style(9).brian1997-08-251-8/+8
| | | | | Update loadalias to use the new libalias api. Update to version 1.1.
* o Fix uptime for direct connections.brian1997-06-231-1/+2
| | | | | | | | | | | | o Style police o Make hangup abort the current connection, not necessarily exiting (-auto/-ddial). o Trap HUP and INT during DoChat and abort the connection attempt. This means you can now type "dial" and change your mind with ^C, or HUP the process to stop it dialing. Slapped into doing it by: Chuck Robey <chuckr@glue.umd.edu>
OpenPOWER on IntegriCloud