aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/systems.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-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 (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* 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
* Make ppp WARNS=5 cleanBrian Somers2004-09-051-3/+4
| | | | Notes: svn path=/head/; revision=134789
* o Clean up some #includesBrian Somers2002-05-141-1/+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
* Convert IIJ copyrights to BSD copyrights.Brian Somers2001-06-131-18/+25
| | | | | | | Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp> Notes: svn path=/head/; revision=78189
* Change _PATH_PPP to PPP_CONFDIR and allow it to be overridden at compile timeBrian Somers2001-03-231-3/+3
| | | | Notes: svn path=/head/; revision=74687
* MAXPATHLEN -> PATH_MAXBrian Somers2001-03-081-1/+1
| | | | | | | | | Don't assume MAXHOSTNAMELEN includes the NUL Correct a diagnostic Use "localhost" in our prompt instead of "" Notes: svn path=/head/; revision=74001
* Permit multiple ``allow user'' lines in any given sectionBrian Somers2000-07-121-2/+11
| | | | | | | | This avoids line length limits when large numbers of users are allowed access to ppp. Notes: svn path=/head/; revision=63052
* Plug two file descriptor leaksBrian Somers2000-04-031-2/+6
| | | | Notes: svn path=/head/; revision=58983
* Don't treat # specially hereBrian Somers2000-03-281-6/+0
| | | | Notes: svn path=/head/; revision=58744
* Understand environment variables in commandsBrian Somers2000-03-141-60/+84
| | | | | | | Submitted by: Mark Knight <markk@knigma.org> Notes: svn path=/head/; revision=58045
* Correct usages of getuid() and geteuid()Brian Somers1999-12-301-2/+2
| | | | | | | Pointed out by: billf Notes: svn path=/head/; revision=55252
* Don't allowt '#' as a comment when it's embedded in quotes:Brian Somers1999-12-271-19/+12
| | | | | | | | | | | set something "xxx yyy # zzz" aaa shouldn't be interpreted as set something "xxx yyy" aaa Notes: svn path=/head/; revision=55145
* Understand double-quotes anywhere on a command line in the sameBrian Somers1999-12-231-1/+1
| | | | | | | | way that a shell does. The previous way ppp did it just didn't make any sense. Notes: svn path=/head/; revision=55065
* Correct warning about unindented commands when the unindented commandBrian Somers1999-12-231-27/+34
| | | | | | | is actually a new label with a comment at the end of the line. Notes: svn path=/head/; revision=55064
* Don't munge ``set dial|login|logout|hangup'' arguments beforeBrian Somers1999-12-221-1/+1
| | | | | | | ExpandString() has a chance to do its own substitutions. Notes: svn path=/head/; revision=55013
* Fix my '#'-at-end-of-lines change, spammed by a subsequent commit.Brian Somers1999-12-201-3/+10
| | | | Notes: svn path=/head/; revision=54921
* Use getpwuid()->pw_dir instead of $HOME when expanding ``~''.Brian Somers1999-12-201-10/+6
| | | | Notes: svn path=/head/; revision=54919
* Use getpwuid() instead of getlogin() in ``allow users''.Brian Somers1999-12-201-4/+5
| | | | Notes: svn path=/head/; revision=54918
* Cosmetic: clean up some parenthesis confusionBrian Somers1999-12-201-10/+5
| | | | Notes: svn path=/head/; revision=54916
* Handle comments at the end of lines.Brian Somers1999-12-201-6/+30
| | | | Notes: svn path=/head/; revision=54915
* Notice and warn about unterminated quoted strings in commands.Brian Somers1999-12-201-13/+16
| | | | | | | The entire command is ignored if the syntax is invalid... Notes: svn path=/head/; revision=54914
* When logging warning messages, there are now three scenarios:Brian Somers1999-09-061-1/+10
| | | | | | | | | | | o If a prompt is executing the command, only display the warning to that prompt o If a prompt is executing a ``load'' command, display the warning to all prompts *and* syslog o Otherwise, display the warning to all prompts *and* syslog. Notes: svn path=/head/; revision=51005
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* Don't warn about ``!'' lines being unindented commands in ppp.conf.Brian Somers1999-05-241-5/+7
| | | | Notes: svn path=/head/; revision=47453
* Deal with the fact that as we now mbuf_Read the fsmBrian Somers1999-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. Notes: svn path=/head/; revision=46828
* o Redesign the layering mechanism and make the aliasing code part ofBrian Somers1999-05-081-1/+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
* If /etc/ppp/ppp.conf doesn't exist, mention that theBrian Somers1999-03-091-7/+19
| | | | | | | | | configuration file can't be found rather than saying that the label can't be found. Pointed out by: Greg Black <gjb@comkey.com.au> Notes: svn path=/head/; revision=44612
* Don't allow root to specify non-existent labels onBrian Somers1999-02-021-18/+25
| | | | | | | | | the command line. Revise the error diagnostics so that invalid labels are reported immediately. Notes: svn path=/head/; revision=43526
* Allow multiple systems (config labels) on the commandBrian Somers1998-10-311-9/+28
| | | | | | | | | line and in the ``load'' & ``dial'' commands. The last label loaded becomes the current label name. Only require a label for -auto mode. Notes: svn path=/head/; revision=40797
* Warn if we encounter an unindented line that isn'tBrian Somers1998-10-171-2/+7
| | | | | | | terminated with a ``:''. Notes: svn path=/head/; revision=40481
* Fix a rather nasty use of `static'. This caused a SEGVBrian Somers1998-06-151-5/+5
| | | | | | | | when running ``link * load label'' as we ended up recursing back into command_Interpret after nuking our command arg list. Notes: svn path=/head/; revision=37009
* Give ``load'' optional context. It's now possible toBrian Somers1998-06-151-8/+9
| | | | | | | | ``link 1,2,3 load label'' for people that want to set up their links in a more mpd-like manner. Notes: svn path=/head/; revision=37008
* MFMP: Make ppp multilink capable.Brian Somers1998-05-211-129/+126
|\ | | | | | | | | | | | | See the file README.changes, and re-read the man page. Notes: svn path=/head/; revision=36285
| * o Add the `set mode' command for change a links current mode. ItBrian Somers1998-05-151-36/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is not possible to switch to or from dedicated or direct mode, but all other combinations are ok (eg. -auto -> -ddial). o Cope with the fact that commands with optional context may not be able to obtain a link with command_ChooseLink() (if all links have been deleted for example). o Allow `clone'ing in non-multilink mode. We may for example want to configure two links in unilink mode and dial them both, using the one that comes up first. It's also possible to rename ``deflink'' by cloning it, deleting the original, then setting the mode of the new link. Notes: svn path=/cvs2svn/branches/MP/; revision=36088
| * Cosmetic: Make our external function names consistent.Brian Somers1998-05-011-17/+16
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35605
| * o Create a new ``timer'' log level. This lets us ``setBrian Somers1998-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | log debug'' without filling our filesystem/screen with junk that we don't really want to see. o change PHYS_STDIN to PHYS_DIRECT - we can handle incoming connections that aren't on STDIN_FILENO now. o Allow return values from our FSM LayerUp functions. If LayerUp() fails, the FSM does an immediate FsmDown() without calling the fsm_parent's Layer{Up,Down} functions. o Clear the close-on-exec flag of file descriptor 3 when executing chat programs so that our documented ability to communicate with /dev/tty via that descriptor works. Also document it as descriptor 3, not 4 :-O o Allow a ``rm'' command as an alias for ``remove''. o Fix the bind()/connect()/accept() calls made by the MP server. o Create bundle_SendDatalink() and bundle_ReceiveDatalink(). This allows `struct datalink's to flatten themselves, pass through a pipe (read: the eye of a needle !) and come alive at the other end. The donator then fork()s & exec()s pppmpipe, ``passing'' the connection to another ppp instance. *** PPP NOW TALKS MULTILINK :-))) *** Our link utilization is hideous, and lots of code needs tidying still. It's also probably riddled with bugs ! It's been tested against itself only, and has hung once, so confidence isn't high.... Notes: svn path=/cvs2svn/branches/MP/; revision=35568
| * Pass all command arguments around with struct cmdargs ratherBrian Somers1998-04-141-3/+3
| | | | | | | | | | | | | | | | | | than incrementing argv and decrementing argc. Now individual functions can determine their caller. This also removes the "prefix" hack in FindExec(). Notes: svn path=/cvs2svn/branches/MP/; revision=35200
| * o Remove the `mode' global - it's now per physical device.Brian Somers1998-04-101-39/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Shuffle things that live at the datalink level into ``show link'' rather than ``show modem''. o Make both ``show'' commands prettier and more consistent, and display carrier status, link type and our name in ``show modem''. o Show redial and reconnect information in ``show link'' and remove ``show redial'' and ``show reconnect''. o Down the correct link in bundle_LinkLost(). o Remove stale -direct and -background links at the end of our main loop, not when we know they're going. This prevents unexpected pointer-invalidations... o If we ``set server'' with the same values twice, notice and don't moan about failure. o Record dial script despite our link mode. The mode may be changed later (next mod) :-) We never run scripts in -direct and -dedicated modes. o Make ``set server none'' functional again. o Correct datalink state array so that we don't report an ``unknown'' state. o Pass struct ipcp to IpcpCleanInterface, not struct fsm. o Create TUN_PREFIX define rather than hard-coding in main.c o prompt_TtyInit now handles a NULL prompt for -direct mode rather than having to create one then destroy it uncleanly. o Mention our mode in the "PPP Started" LogPHASE message. o Bring all auto links up when we have something to send. o Remove some redundant Physical_*() functions. o Show which connection is running a command when logging commands. o Initialise throughput uptime correctly. Notes: svn path=/cvs2svn/branches/MP/; revision=35118
| * Remove unused includes.Brian Somers1998-04-061-9/+1
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35059
| * Deglobalise `struct prompt':Brian Somers1998-04-031-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Our diagnostic socket has its password set in the `set socket' line only (not in ppp.secret). o Passwords are per server socket (*VarAuthKey are gone) o Authority is per prompt (VarLocalAuth is gone). o Local logging is per prompt. o Add a `show who' command to see who's connected. No identd routine - just a `where the connection came from' display. o SIGUSR1 is disabled for now - we have no way of choosing a password for the socket created :-( Prompts are attached as a list of `struct descriptor's in struct bundle, and serviced under the bundles descriptor service routines. Ultimately, everything should be done like this. Cosmetic: o alphabeticalise SRCS in Makefile. o Add a few comments in command.h TODO: Start checking that we don't overflow the descriptor sets in select() now that we can have any number of descriptors. Notes: svn path=/cvs2svn/branches/MP/; revision=35016
| * Make the server descriptor into a `sort' of struct descriptor.Brian Somers1998-02-091-1/+2
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=33195
| * Parse configuration files a bit better.Brian Somers1998-02-041-53/+99
| | | | | | | | | | | | | | Allow continuation lines ('\' as the last char on a line). Notes: svn path=/cvs2svn/branches/MP/; revision=33061
| * Create `struct bundle' - the top level control structure.Brian Somers1998-02-021-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | This structure will eventually contain a list of NCPs (currently only IPCP is supported) and a list of physical `struct link's. It will also derive from a struct link itself. Make ModemTimeout() static - it's way to dangerous to be called from outside ! Bump version to 1.9. Our first MP release should be 2.0. Notes: svn path=/cvs2svn/branches/MP/; revision=33029
| * This commit was manufactured by cvs2svn to create branch 'MP'.cvs2svn1998-01-291-0/+366
| | | | Notes: svn path=/cvs2svn/branches/MP/; revision=32861
* Remove unused #includes.Brian Somers1998-01-211-3/+1
| | | | | | | | | Make various bits static. Remove unused variables. Submitted by: eivind Notes: svn path=/head/; revision=32663
* Cosmetic (style):Brian Somers1997-12-241-3/+3
| | | | | | | | | | sizeof(var) -> sizeof var sizeof type -> sizeof(type) Suggested by: J Wunsch <j@uriah.heep.sax.de> Notes: svn path=/head/; revision=31962
* Cosmetic: Test for comment lines after the lenght has been established.Brian Somers1997-12-211-4/+2
| | | | | | | Pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org> Notes: svn path=/head/; revision=31918