summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't create a diagnostic socket by default.brian1997-11-091-6/+17
| | | | | | Allow a password spec on the "set server" command line. Use SIGUSR2 to close the diagnostic socket. Some man page corrections.
* Don't ask for a password if it's specified as empty.brian1997-11-091-2/+2
|
* Increase chat script sizes to 512brian1997-11-091-4/+2
| | | | Requested by: Michael Reifenberger <root@totum.plaut.de>
* Introduce ID0 logging.brian1997-11-091-9/+7
| | | | | | | | Stay as the invoking uid as much as possible. Execution as a normal user is still forbidden for now, so these changes are pretty ineffective. The next commit will implement the modifications suggested on -hackers a number of days ago.
* Don't pass global vars as args.brian1997-11-081-5/+5
| | | | Remove local/global conflicts.
* Introduce [local] to "set log [local] ...". This spitsbrian1997-11-041-5/+12
| | | | | logging out to the screen in terminal mode - should be good for installation problem diagnosis.
* o Bump version to 1.3 to reflect major changesbrian1997-10-291-5/+3
| | | | | | | | | | | | o Report modem connect time properly o Report bytes in/out over physical media o Fix phases (TERMINATE is *higher than* DEAD) o Do a LayerFinish from LcpDown o Bring down IPCP & CCP when we enter PHASE_TERMINATE o Give a new prompt when we go to PHASE_DEAD o Stop the modem timer properly when idle o Treat sig 15 like an exiting carrier loss o Log (DEBUG) offline & online transitions
* Cosmetic (no functional changes):brian1997-10-261-42/+48
| | | | | | | | | | | | | | | 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-6/+6
| | | | | | usleep => nointr_usleep (not just a #define) Already done by: ache
* cosmetic:brian1997-10-161-1/+3
| | | | | | o Log client connection commands when "set log +command" o Don't display PAP password in the log unless we're "set log +debug".
* Support VJ maximum slot identifiers != 15.brian1997-10-071-3/+3
| | | | | | | | | Support VJ slot id compression. Previously, ppp would negotiate a max slot between 2 & 15 (if asked), and would agree to slot id compression (if asked). It would then proceed to use 16 slots and no compression anyway. The result was a rather unusable connection.
* Correct the way the uucp lock file and the ttyXX.if lockbrian1997-09-221-22/+13
| | | | | | | file get created. We don't create lock files over non-tty connections, but we *do* create lock files in -direct mode. This leaves us capable of adding utmp/wtmp support for successful pap & chap logins (coming soon).
* It turns out that the following:brian1997-09-211-2/+1
| | | | | | | | | | | | close(1); close(2); x = open(ctermid(NULL), O_RDWR|O_NONBLOCK); close(0) on a tty causes select() to return an exception for descriptor x ! This is the case in RELENG_2_2, but not in 2.2.2. I'm not sure why. Instead of doing the x=open() and close(0), we just do x=0 now. Problem pointed out by: Greg Lehey <grog@lemis.com> Tomi Vainio <tomppa@fidata.fi>
* Don't close(1) in direct mode and then proceed tobrian1997-09-181-3/+4
| | | | | | | | | isatty(1) ! Keep 0 open for this till the modem's been set up by either dup()ing 0 or by opening ctermid(NULL) (if isatty(0)). Discussed problem with: Tomi Vainio <tomppa@fidata.fi> Made it finally dawn on me: Angelo Turetta <ATuretta@stylo.it>
* o Fix two unlikely descriptor leaks.brian1997-09-161-5/+6
| | | | | | | | | o Output the correct device for "show modem" while in -direct mode. o Cosmetic: Moan a bit more when we can't open the [modem] device. o Call OpenModem() in a more "natural" way. o Add some LogDEBUG in OpenModem().
* Install as group ``network''brian1997-09-041-38/+14
| | | | | | | | | | | Insist that uid == 0 for client ppp Disallow client sockets if no password is specified Don't exit on failure to open client socket for listening Allow specification of null local password Use reasonable size (smaller) ``vector''s in auth.c Fix "passwd ..." usage message Insist on "all" as arg to "quit" (if any) Drop client socket connection before Cleanup() when "quit all"
* Cosmetic: Make LogPrintf() calls consistent.brian1997-08-311-7/+7
|
* Remove use of login_progok()brian1997-08-311-9/+1
| | | | Suggested by: guido
* Use login_progok().brian1997-08-271-38/+3
|
* Check the "prog.deny" login.conf capability andbrian1997-08-261-1/+44
| | | | | refuse to run if "ppp" is in the list. Suggested by: "Daniel O'Callaghan" <danny@panda.hilink.com.au>
* Lose a couple of extraneous backslashes.brian1997-08-251-5/+3
|
* Make the code format more in line with style(9).brian1997-08-251-244/+233
| | | | | Update loadalias to use the new libalias api. Update to version 1.1.
* Add "set loopback on|off", defaulting to "on".brian1997-08-211-1/+23
| | | | | | | | | This tells ppp to loopback packets addressed to the ppp interface IP coming *from* the tun device. This means that you can ping the tun interface IP from inside :-)
* Make HUP cause an exit (as it used to), and makebrian1997-07-011-5/+5
| | | | | | | | | | INT cause a hangup - not exiting for -ddial & -auto. HUP must exit because init sends this at system shutdown time (why, I don't know), and we don't want to end up redialing after the HUP (due to another dfilter packet). Pointed out by and discussed with: ache
* Fix HUP handling while dialing.brian1997-06-291-3/+6
| | | | Pointed out by: ache
* Add "set server" to control the server socket.brian1997-06-251-60/+48
| | | | | | | | | | Catch SIGUSR1 to re-init listening socket. Document signal behaviour. Add missing '\n's to LogPrintf(LogWARN,...) Main() returns int not void. AF_LOCAL ideal suggested a long time ago by: joerg
* Fix ~? output in "term" mode.brian1997-06-241-9/+9
| | | | Spotted by: Harry Starr <starr@gccs.com.au>
* o Fix uptime for direct connections.brian1997-06-231-27/+15
| | | | | | | | | | | | 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>
* Handle redial tries correctly under -ddialbrian1997-06-171-10/+11
|
* Set netfd to STDOUT_FILENO rather than STDIN_FILENO.brian1997-06-161-2/+2
|
* Remove call to daemon(). Just call setsid() and closebrian1997-06-161-7/+10
| | | | | any relevent descriptors (0,2,[1]). We've already fork()d. PR: 3874
* Sort out ppp over tcp:brian1997-06-111-13/+31
| | | | | | | | | | o Allow "set var" with no args to blank var (don't req ""). o Zero VarTerm ASAP if not in interactive mode. o Never print anything to stdout in -direct mode. o Count redial when failing to open modem. o Increase device size to 40 characters (for host:port). o Remove missed "if (fd == 0) fd = 1;". o Don't give up on incoming non-terminal connections.
* Overhaul ppp:brian1997-06-091-140/+129
| | | | | | | | | | | | | | | | | | | | | | | | | o Use syslog o Remove references to stdout/stderr (incl perror()) o Introduce VarTerm - the interactive terminal or zero o Allow "set timeout" to affect current session o Change "set debug" to "set log" o Allow "set log [+|-]flag" o Make MSEXT and PASSWDAUTH stuff the default o Move all #ifdef DEBUG stuff into the code - this shouldn't be too much overhead. It's now controlled with "set log +debug" o Add "set log command, debug, tun, warn, error, alert" o Remove cdefs.h, and assume an ansi compiler. o Improve all diagnostic output o Don't trap SIGSEGV o SIGHUP now terminates again (log files are controlled by syslog) o Call CloseModem() when changing devices o Fix parsing of third arg of "delete" I think this fixes the "magic is same" problems that some people have been experiencing. The man page is being rewritten. It'll follow soon.
* Remove initial startup printf's in -direct mode.brian1997-06-011-5/+8
| | | | Make "same magic" error send a NAK (as per rfc).
* Correct the return of DialModem()brian1997-05-291-2/+2
| | | | Suggested by: kfurge <kfurge@worldnet.att.net>
* De-couple ppp from libalias. If libalias isn't there, thebrian1997-05-261-6/+8
| | | | | | | | | alias commands simply won't work. Only root may specify the location of the alias lib (otherwise, it's hard-coded). Make logprintf silently fail if LogOpen hasn't been called. Suggested by: eivind
* Fix the reconnect option, and add an explanation to vars.hbrian1997-05-241-5/+8
|
* Add SO_REUSEADDR socket opt in case the last telnetbrian1997-05-231-1/+2
| | | | | | connection is in a time_wait. Submitted by: Brian Campbell <brianc@pobox.com>
* Use the latest alias engine - now in libalias.brian1997-05-231-5/+5
| | | | Submitted by: Charles Mott <cmott@srv.net>
* Output exit status description of child in background mode.brian1997-05-191-3/+4
|
* Mega update to sort out bad implementationsbrian1997-05-191-51/+70
| | | | | | | | | | | | | | | | | | of reconnect & -background. o Fix reconnect anomolies. o Make reconnect apply to failed LQR hangups (& mention in man page). o Make reconnect effective in -background mode. o Listen on socket in -background mode. o Try all phone numbers in -background mode. o Insist on system arg in -background mode. o Make a control-connection close command exit in -background mode. o Output status message to stdout on exit of parent in -background mode. o Don't notify parent of success too soon. o Describe termination EX_* code. o Miscelaneous diagnostic corrections. o Remove redundant connect_time from modem.c. o Don't repeatedly DownConnection().
* Make openmode active by default (for both client/server).brian1997-05-171-5/+2
| | | | Requested by: The masses.
* Build pid_filename without a double slash.brian1997-05-141-5/+9
| | | | | | | Make ``Dial attempt'' diagnostics consistent. Reset lostCarrier when it has reached max. Suggested by: Kevin Street <street@iName.com>
* Create ttyXX.if and tunX.pid irrespective ofbrian1997-05-111-23/+24
| | | | | | whether we're -dedicated. Required by: David Nugent <davidn@labs.usn.blaze.net.au>
* Add a ttyXX.if file in /var/run that points tobrian1997-05-101-9/+19
| | | | | | | the tunX.pid file. Change the ppp.tunX.pid name to tunX.pid Requested by: Daniel O Callaghan <danny@panda.hilink.com.au>
* Tidy up the code - bounds checking, returnbrian1997-05-101-26/+23
| | | | | | value checking etc. Submitted by: eivind
* Log each ppp line to separate /var/log/ppp.tunX.log instead mixing ofache1997-05-041-6/+2
| | | | all lines into single /var/log/ppp.log
* Add a reconnect capability directing ppp to re-establishbrian1997-04-211-3/+17
| | | | | | | | | | | the connection after an unexpected loss of carrier: set reconnect timer ntries The man page warns against using this command when your timeout value is slightly more than the other sides :{} Suggested by: burton@bsampley.vip.best.com (Burton Sampley)
* Make the next number redial ability configurable. Thebrian1997-04-141-15/+15
| | | | | | | | | "set redial pause [times]" command becomes "set redial end-pause[.next-pause] [times]" and next-pause defaults to 3 seconds. This keeps things backwards compatable. Suggested by: ache
* Make -background option attempt each phone number at mostbrian1997-04-131-3/+8
| | | | | once. Make -background ignore redial. Output exit value to syslog with "PPP Terminated" message.
OpenPOWER on IntegriCloud