summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/lcp.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix PAP, CHAP & LQR req (I broke the byte ordering whenbrian1997-12-071-12/+51
| | | | | | | | I did the deflate re-org). Make PAP & CHAP negotiation prettier in the log file. If both PAP & CHAP are `enabled' and the peer NAKs CHAP suggesting PAP, be friendly and REQ PAP the next time. This is in line with the rfc.
* Abstract the CCP layer a level.brian1997-12-031-75/+153
| | | | Add DEFLATE support.
* Fix prototypes.brian1997-11-221-10/+12
| | | | | | | | | | | | | | 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 throughput logging (disabled by default).brian1997-11-181-2/+1
| | | | | Use "enable throughput" to see modem & IPCP throughput. Removed an extraneous prompt()
* Abstract data read from and written to the tun device,brian1997-11-161-2/+9
| | | | | | | | | | | | | | allowing for a possible header on the front of all packets. In OpenBSD, there's a structure containing the address family here. If we're building under OpenBSD, set up the ``flags'' part of struct tuninfo (not there under FreeBSD) so that we config the interface as POINTOPOINT. Prefix prototypes with ``extern'' in os.c for consistency. These changes are cosmetic under FreeBSD, but allow ppp to build & work under OpenBSD (bar the srandomdev() stuff, the inclusing of <net/if_var.h> and some Makefile symantecs).
* Update the cftypes arrays according to rfc1700.brian1997-11-141-16/+41
| | | | Log IPCP reqests as IPCP.
* Fix typo that causes CHAP RESPONSEs to *always*brian1997-11-111-2/+2
| | | | be damned M$ responses if you've got DES.
* Don't pass global vars as args.brian1997-11-081-13/+13
| | | | Remove local/global conflicts.
* o Bump version to 1.3 to reflect major changesbrian1997-10-291-11/+7
| | | | | | | | | | | | 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:brian1997-10-261-1/+2
| | | | Move prototypes into the correct headers.
* Cosmetic (no functional changes):brian1997-10-261-81/+43
| | | | | | | | | | | | | | | 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
* Initialise LCP, IPCP and CCP as soon as LCP is down.brian1997-10-151-1/+4
| | | | | | | | Without this, in -auto mode, we stay in ST_STOPPING and never check our dial filters to see if it's time to bring the line up again. This may make "set stopped" redundant.
* Change things around a bit when bringing down the layers.brian1997-10-051-3/+12
| | | | | | | | | | | | | | | | o LcpLayerDown() no longer does a NewPhase(PHASE_TERMINATE). Instead, it's done in LcpLayerFinish(). LayerFinish() gets called by the FSM after the LCP FSM goes through the Stopping and Stopped states. o -direct and -background mode exit at PHASE_TERMINATE, not PHASE_DEAD. The result is that LCP, CCP & IPCP are brought down cleanly on both sides of the link (not just our side). Killing ppp rather than just closing it still makes it get out after the LCP SendTerminateReq(). I'll have a look at that soon. We're probably not actually sending the REQ :-(
* If "set mtu" is used, *and* the mtu is less than thebrian1997-09-291-4/+7
| | | | | | value requested by the peer, NAK using this value rather than silently just changing the interface mtu.
* Don't depend on time.h including sys/types.hbrian1997-09-271-1/+2
|
* Allow Microsoft CHAP authentication.brian1997-09-251-3/+15
| | | | | This is a combination of MD4 & DES. Submitted by: Gabor Kincses <gabor@acm.org>
* Undo botched commit (local changes got in)brian1997-09-231-4/+3
|
* Don't allow accept/deny when it's not appropriate.brian1997-09-221-3/+4
| | | | | Log PAP/CHAP users in utmp & wtmp, allowing it to be avoided with "disable utmp"
* Don't pause for one second before starting LCPbrian1997-09-221-4/+12
| | | | | | | | | | | negotiation. Instead, incrementally pause after receiving LCPs with the same magic. We can now suffer a server that waits more than 1 second before responding. Pauses greater than a second get hopelessly confusing as when the server eventually starts, it sees a flood of Config Requests followed by config NAKs and changes of magic. This causes the server to change its magic over and over.....
* Sleep for a second before sending the first LCPbrian1997-09-211-1/+3
| | | | | | | config request. This stops us from squirting stuff down a line that still has ECHO turned on because the peer hasn't had a chance to start yet. Lead to the cause by: Greg Lehey <grog@lemis.com>
* Bring CCP and IPCP layers down properly when LCPbrian1997-09-031-2/+2
| | | | | comes down. Give a count of bytes sent/received in IPCP log.
* Allow the transition from an idle timeout valuebrian1997-09-031-4/+4
| | | | | | of zero (no timeout) while IPCP is up. Move some prototypes into .h files and re-order some includes.
* Cosmetic: Make LogPrintf() calls consistent.brian1997-08-311-2/+2
|
* Make the code format more in line with style(9).brian1997-08-251-105/+105
| | | | | Update loadalias to use the new libalias api. Update to version 1.1.
* Expand the "set stopped" command so that it canbrian1997-08-201-2/+3
| | | | | | | | idependently time out any of the FSMs. Split LCP logging into LCP, IPCP and CCP logging, and make room in "struct fsm" for the log level that the state machine should use.
* Remove extraneous prototypes.brian1997-08-011-3/+1
|
* Remove srandomdev fallback codeache1997-06-141-3/+2
|
* Overhaul ppp:brian1997-06-091-61/+56
| | | | | | | | | | | | | | | | | | | | | | | | | 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-7/+11
| | | | Make "same magic" error send a NAK (as per rfc).
* De-couple ppp from libalias. If libalias isn't there, thebrian1997-05-261-1/+2
| | | | | | | | | 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-2/+2
|
* Mega update to sort out bad implementationsbrian1997-05-191-11/+4
| | | | | | | | | | | | | | | | | | 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().
* Cosmetiqueache1997-05-111-3/+3
|
* Print out reject masks on "show lcp"ache1997-05-111-5/+9
|
* Use random() for GenerateMagic()ache1997-05-111-9/+9
|
* Tidy up the code - bounds checking, returnbrian1997-05-101-4/+4
| | | | | | value checking etc. Submitted by: eivind
* Make ppp exit on loss of carrier in -background mode.brian1997-05-051-2/+2
| | | | Submitted by: Jim Carroll <jim@carroll.com>
* Closes pr 2711brian1997-03-131-1/+10
| | | | | | Fix -background option. Parent returns after the line is established (or not established). Definitely a candidate for 2.2
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* 1. Room to calculate MD5 for CHAP negotiation is shorter thanjkh1996-10-121-1/+8
| | | | | | | | | | | | | | | | required. a core is not dumped at first connecting time and dumped at second or third time. (patch I) 2. A routine for "show route" refers out of allocated space. Values pointed by "lp" should be read as CHAR, I think. there is also no free() for disallocation. (patch II) Here is also a patch for an improvement: In current imprementation, even if PPP connection is disconnected by time out, prompt of interactive mode does not change from "PPP>" to "ppp>" to indicate the disconnection on a terminal. So I modified the code to do that. (patch III) Submitted-By: NAKAMURA Motonori <motonori@econ.kyoto-u.ac.jp>
* Here is a diff of /usr/src/usr.sbin/ppp against current. The diffsphk1996-05-111-30/+30
| | | | | | | | | | | | | | | | | | | add some logging functionality which I find very useful. 'set debug link' will record just link up/down and address assignments. 'set debug connect' will record the entire chat dialog 'set debug carrier' will record just chat lines including 'CARRIER' (so that I can be sure I'm getting a 28.8 line). There was a global change required to permit LogPrintf to take a bit mask instead of a bit position value (to permit logging some events on either of two flags, so that no change in 'set debug lcp' would result from the code supporting 'link'. Thus the diffs are rather long for such a small change. The man page is also touched. Oh, and there was a slight syntax problem in route.c Reviewed by: phk Submitted by: Tony Kimball <alk@Think.COM>
* Some patches to ppp which improve stability. I have been running adfr1996-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ppp based on these patches for about 3 weeks with no downtime. The original submitters comments: Two features iijppp has over kernel ppp that I like are predictor1 compression and demand dialing. Here are a few bug fixes. I expanded the priority queueing scheme and discovered it was broken due to the assignment at ip.c line 300. All packets were being queued at the same priority. Fixing priority queueing broke predictor1 compression. Packets were compressed before being queued and predictor1 worked as long as the packets were popped off the queue in the same order they were pushed onto the queue. There were a few byte order problems in IP header tests also. There is a recursion problem in SendLqrReport(). LcpClose() is called when "Too many echo packets are lost" which winds up in SendLqrReport() again. I believe the original intention was to just stop the LQR timer with the call to StopLqr() but the side effects hurt. Submitted by: John Capo <jc@irbs.com>
* Final cleanup for now. -Wall is now silent. A couple of bogons found.phk1996-01-111-6/+10
|
* 1. All fragments (except the first one) of a fragmented packet wereamurai1995-09-171-1/+2
| | | | | | | | | | | | | dropped - devet@adv.IAEhv.nl (Arjan de Vet) 2. Will not read data from telnet connection - John Capo <jc@irbs.com> 3. Using LQM option could be drop the link due to LcpLayerDown() doesn't stop LQR timer. - Brian <brian@awfulhak.demon.co.uk> 4. Allow to describe a syntax of filters that is not only port number but also by name in /etc/service. - Rich Murphey <rich@lamprey.utmb.edu> Reviewed by: Atsushi Murai <amurai@spec.co.jp> Submitted by: devet@adv.IAEhv.nl, jc@irbs.com, brian@awfulhak.demon.co.uk, rich@lamprey.utmb.edu
* >Number: 591amurai1995-07-081-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | >Category: bin >Synopsis: SPAP request REJexted in stead of NAKed >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs (FreeBSD bugs mailing list) >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 5 01:40:01 1995 >Originator: Dick van den Burg >Organization: >Release: FreeBSD 2.0.5-RELEASE i386 >Environment: >Description: When trying to connect with ppp to a Shiva Lanrover (version 3.2) the authentication fails because the SPAP (Shiva Secure PAP) configuration request the is sent by Shive is REJected by ppp in stead of NAKed. Reviewed by: amurai@spec.c.jp and friends Submitted by: burg@is.ge.com
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* 1.Reducing cpu usage at off connection.amurai1995-03-111-1/+3
| | | | | | | | | 2.Implment Redail function as working correctly. 3.Clean up a code as I notice. 4.Now, RTT getting close to 50ms with ISDN/TA 38400bps !! Reviewed by: amurai@spec.co.jp Submitted by: amurai@spec.co.jp
* New user Process PPP based on iij-ppp0.94beta2.amurai1995-02-261-44/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Supporting SYNC SIO device (But need a device driver) - add "set speed sync" o Fixing bug for Predictor-1 function. o Add new parameter that re-sent interval for set timeout commands. o Improving RTT (Round Trip Time) and reducing processor time. - Previous Timer service was using polling, and now using SIGALRM ;-) - A 0.94beta2 will not work correctly.... -- Follows are additinal feature not including 0.94beta2 o Support Proxy ARP - add "enable/disable proxy" commands o Marging common routine in CHAP/PAP. o Enhancing LCP/IPCP log information. o Support local Authfication connection on port 300x and tty. - You can set up pair of your "hostname -s" and password in ppp.secret. if either ppp.secret file nor your hostname line don't exist, It will notify a message and working as same as previous version.(Backword compatibility) - If you did set up them, It's allow connection but nothing to do except help and passwd command. - add "passwd yourpasswd" commands o Support afilter - keep Alive filter that a packet can send/receiving according to ifilter/ofilter but doesn't count it as preventing idle timer expires. - Same syntax of other filters. o Fixing bugs reported by current user for previous one. Thanks !! Reviewed by: Atsushi Murai (amurai@spec.co.jp)
* (no commit message)amurai1995-01-311-0/+656
OpenPOWER on IntegriCloud