summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/pred.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-10/+12
| | | | Notes: svn path=/head/; revision=134789
* Understand the following Microsoft Vendor Specific RADIUS attributes:Brian Somers2002-06-121-4/+6
| | | | | | | | | | | | | | | | | | | | RAD_MICROSOFT_MS_MPPE_ENCRYPTION_POLICY RAD_MICROSOFT_MS_MPPE_ENCRYPTION_TYPES RAD_MICROSOFT_MS_MPPE_RECV_KEY RAD_MICROSOFT_MS_MPPE_SEND_KEY These attributes may be supplied by a RADIUS server when MSCHAPv2 is used to authenticate. It *should* now be possible to build ppp with -DNODES and still support CHAP/MSCHAP/MSCHAPv2/MPPE via a RADIUS server, but the code isn't yet smart enough to do that (building with -DNODES just looses these facilities). Sponsored by: Monzoon Notes: svn path=/head/; revision=98132
* Make the way FSM options are processed easier to read by using structuresBrian Somers2002-04-161-20/+10
| | | | | | | | | | | | | | instead of u_char *. The changes are cosmetic except: RecvConfigAck() now displays the options that are being ACK'd Huge (bogus) options sent from the peer won't cause an infinite loop SendIdent and ReceiveIdent are displayed consistenlty with other FSM data LCP AUTHPROTO options that aren't understood are NAK'd, not REJ'd Notes: svn path=/head/; revision=94894
* Reduce the interface MTU by 2 when MPPE has been successfully negotiated.Brian Somers2001-07-031-0/+1
| | | | | | | | | This is necessary because MPPE will combine the protocol id with the payload received on the tun interface, encrypt it, then prepend its own protocol id, effectively increasing the payload by two bytes. Notes: svn path=/head/; revision=79165
* Add support for stateful MPPE (microsoft encryption) providingBrian Somers2001-06-181-4/+11
| | | | | | | | | | | | | | | | | | encryption compatibility with Windows 2000. Stateful encryption uses less CPU but is bad on lossy transports. The ``set mppe'' command has been expanded. If it's used with any arguments, ppp will insist on encryption, closing LCP if the other end refuses. Unfortunately, Microsoft have abused the CCP reset request so that receiving a reset request does not result in a reset ack when using MPPE... Sponsored by: Monzoon Networks AG and FreeBSD Services Limited Notes: svn path=/head/; revision=78411
* Add a ``Usable'' function to the ccp switch. The functionBrian Somers2001-02-041-0/+1
| | | | | | | | | | | | | | | | is called prior to sending a CCP configure request for a given protocol. The default is to send the request, but this is overridden for MPPE which checks to see if the lcp negotiations agreed CHAP81, and if not fails. Use the same function to decide if we should reject peer requests for MPPE. This should get rid of those boring messages about not being able to initialise MPPE when we don't negotiate CHAP81. Notes: svn path=/head/; revision=72025
* Cosmetic: Make struct mbuf more like kernel mbufs.Brian Somers1999-12-201-19/+19
| | | | Notes: svn path=/head/; revision=54912
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* o Alter the mbuf type as it's processed by different layers.Brian Somers1999-06-021-3/+3
| | | | | | | | | | | o Show more information about missing MP fragments in ``show mp''. o Do away with mbuf_Log(). It was showing mbuf stats twice on receipt of LCP/CCP/IPCP packets.... ???!!? o Pre-allocate a bit extra when creating LQR packets to avoid having to allocate another mbuf in mbuf_Prepend(). Notes: svn path=/head/; revision=47695
* 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-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Detect pred1 packets where the length != the packet lengthBrian Somers1999-03-161-12/+17
| | | | | | | | | Use a maximum of MAX_MRU + 2 bytes for incoming packets, not MAX_MTU + 2. Tidy up some diagnostics. Notes: svn path=/head/; revision=44792
* Tone down the log levels (Log{ERROR,WARN} -> LogCCP)Brian Somers1999-03-111-5/+7
| | | | | | | | | | | | | | | when we've simply missed a packet. When our Predictor1 CRC is wrong (implying we've dropped a packet), don't send a ResetReq(). Instead, send another CCP ConfigReq(). *shrug* My tests show this as being far worse than the ResetReq as we may have further Nak/Rejs etc and we're basically resetting both our incoming and outgoing compression dictionaries, but rfc1978 says the ConfigReq is correct, so we'd better go along... Notes: svn path=/head/; revision=44650
* o Support callback types NONE, E.164, AUTH and CBCP.Brian Somers1998-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. Notes: svn path=/head/; revision=38174
* MFMP: Make ppp multilink capable.Brian Somers1998-05-211-107/+97
|\ | | | | | | | | | | | | See the file README.changes, and re-read the man page. Notes: svn path=/head/; revision=36285
| * Cosmetic: Make our external function names consistent.Brian Somers1998-05-011-22/+22
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35605
| * Make ``show ipcp'' prettier and remove a few redundant includes.Brian Somers1998-04-251-2/+1
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35437
| * Output the correct protocol id from the physical link-level CCPBrian Somers1998-04-241-2/+2
| | | | | | | | | | | | | | layer when we're in multilink mode. Notes: svn path=/cvs2svn/branches/MP/; revision=35430
| * o Move the accept/deny/disable/enable globals either to theBrian Somers1998-04-161-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bundle (non-negotiated vars) or to their respective IPCP, LCP or CCP. o Enable rolling throughput statistics by default. o Remove the `display' command. These values now appear in `show bundle', `show ipcp', `show ccp' and `show lcp'. o Initialise auth name & key at bundle create time (oops). o Rename pppd-deflate (the id-24 hack) to deflate24. o Don't send both a REJ and a NAK to an IPCP or LCP REQ. Favour the REJ (already done at the CCP level). o Recurse in datalink_UpdateSet() when we change state, otherwise we end up setting no descriptors and getting jammed in the imminent select() instead of doing the dial/login/hangup. o Display our CHAP encryption method despite being built with DES. o Display VJ as not negotiated in ``show ipcp'' when necessary. Notes: svn path=/cvs2svn/branches/MP/; revision=35219
| * o Move alias function pointers into loadalias.cBrian Somers1998-04-071-5/+2
| | | | | | | | | | | | | | | | | | | | | | o Move Var*Version into command.c o Remove struct pppVars (and there was much rejoicing) ! o Forward-decl some structs in .h files to avoid include ordering requirements and remove a few more redundant #includes. Notes: svn path=/cvs2svn/branches/MP/; revision=35089
| * Remove unused includes.Brian Somers1998-04-061-5/+1
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35059
| * Make all CCP negotiation data dynamic and add aBrian Somers1998-03-171-71/+66
| | | | | | | | | | | | | | | | ``set deflate'' command to configure the DEFLATE default window size. Notes: svn path=/cvs2svn/branches/MP/; revision=34648
| * De-staticise LQR informationBrian Somers1998-03-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increment OutPackets for any packet - not just LQRs MFC: o Fix a few comment typos. o Fix ``set timeout'' usage message and documentation. o Change ifOutPackets, ifOutOctets and ifOutLQRs to `u_int32_t's so that they wrap correctly. o Put the LQR in network byte order using the correct struct size (sizeof u_int32_t, not sizeof u_long). o Wrap LQR ECHO counters correctly. o Don't increment OutLQR count if the last LQR hasn't been replied to. o Initialise last received LQR in StartLqm. o Don't start the LQR timer if we're `disabled' and `accepted'. o Generate LQR responses when both sides are using a timer and we're not going to send our next LQR before the peers max timeout. Notes: svn path=/cvs2svn/branches/MP/; revision=34530
| * o Remove the global CcpInfo. It's now part of the datalink.Brian Somers1998-02-231-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Struct bundle will have its own struct ccp in the future too. o The ``set stopped'' command now requires context and doesn't work on the IPCP FSM. o Check if it's time to break out of our top level loop before doing a select - otherwise, we'll select forever :-( o Remove `struct link'::ccp (a temporary hack). It turns out that IpStartOutput() calls link_Output() and link_Output() incorrectly calls StartOutput() (really modem_StartOutput) requiring the ccp knowledge so that it can call IpStartOutput()... The end result is that the whole IP output queue gets dumped into the modem output queue and a pile of physical writes are done prematurely. This makes the (original) code in main() actually work in that it would not bother selecting() on the tun descriptor when our modem queue length was 20 or greater. Instead, we now make that decision based on the overall queue length. This will need improvement later. Notes: svn path=/cvs2svn/branches/MP/; revision=33754
| * Move the global FSMs into their relevent structures.Brian Somers1998-01-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | IPCP, CCP and LCP are now just derived FSMs. Comment each of the FSM implementations so that we can tell what's going on. Revise the state transitions so that CCP and IPCP actually send terminate REQs when appropriate. The OS & IPCP layers are still like spagetti (next job). Notes: svn path=/cvs2svn/branches/MP/; revision=32915
| * Create `struct link' - the logical link from whichBrian Somers1998-01-301-4/+5
| | | | | | | | | | | | | | | | `struct physical' (and the future `struct logical') are derived. Notes: svn path=/cvs2svn/branches/MP/; revision=32903
| * Create a new MP branch for `multilink protocol'.Brian Somers1998-01-291-3/+4
| | | | | | | | | | | | | | | | Do lots of initial shuffling and grouping. Submitted by: Eivind Eklund <perhaps@yes.no> Notes: svn path=/cvs2svn/branches/MP/; revision=32863
| * This commit was manufactured by cvs2svn to create branch 'MP'.cvs2svn1998-01-291-0/+342
| | | | Notes: svn path=/cvs2svn/branches/MP/; revision=32861
* Free our input mbuf when the FCS is good (oops, memory leak).Brian Somers1998-01-141-1/+2
| | | | Notes: svn path=/head/; revision=32499
* Add (BSD) copyright headers.Brian Somers1997-12-211-7/+27
| | | | Notes: svn path=/head/; revision=31921
* Abstract the CCP layer a level.Brian Somers1997-12-031-24/+123
| | | | | | | Add DEFLATE support. Notes: svn path=/head/; revision=31514
* Fix prototypes.Brian Somers1997-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). Notes: svn path=/head/; revision=31343
* Introduce ID0 logging.Brian Somers1997-11-091-1/+2
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=31061
* Cosmetic (no functional changes):Brian Somers1997-10-261-11/+21
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=30715
* Make the code format more in line with style(9).Brian Somers1997-08-251-74/+66
| | | | | | | | Update loadalias to use the new libalias api. Update to version 1.1. Notes: svn path=/head/; revision=28679
* Make the man page a little more detailed.Brian Somers1997-06-091-3/+3
| | | | | | | | Update the version number to 1.00. Increase the predictor-1 buffer by 2 bytes. Notes: svn path=/head/; revision=26530
* Overhaul ppp:Brian Somers1997-06-091-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=26516
* Reduce MAX_M[RT]U back to 2048. Even on a null-modemBrian Somers1997-06-011-5/+3
| | | | | | | | | | | ppp link, we gain nothing with a larger mtu. Suggested by: joerg Fix pred1 buffer size (must be == MAX_MTU) Notes: svn path=/head/; revision=26341
* Tidy up the code - bounds checking, returnBrian Somers1997-05-101-7/+4
| | | | | | | | | value checking etc. Submitted by: eivind Notes: svn path=/head/; revision=25630
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22997
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-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. Notes: svn path=/head/; revision=21673
* Reset Pred1 protocol on FCS errors.Poul-Henning Kamp1996-07-211-1/+2
| | | | Notes: svn path=/head/; revision=17240
* Here is a diff of /usr/src/usr.sbin/ppp against current. The diffsPoul-Henning Kamp1996-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=15738
* Some patches to ppp which improve stability. I have been running aDoug Rabson1996-01-301-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=13733
* A random bunch of cleanup changes.Poul-Henning Kamp1996-01-101-2/+1
| | | | Notes: svn path=/head/; revision=13379
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8857
* New user Process PPP based on iij-ppp0.94beta2.Atsushi Murai1995-02-261-22/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=6735
* (no commit message)Atsushi Murai1995-01-311-0/+237
Notes: svn path=/cvs2svn/branches/R093/; revision=6059