aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/hdlc.h
Commit message (Collapse)AuthorAgeFilesLines
* Make ppp WARNS=5 cleanBrian Somers2004-09-051-2/+2
| | | | Notes: svn path=/head/; revision=134789
* Re-implement LQM, this time according to the rfc.Brian Somers2004-06-301-7/+12
| | | | | | | | PR: 11293 MFC after: 4 weeks Notes: svn path=/head/; revision=131327
* Convert IIJ copyrights to BSD copyrights.Brian Somers2001-06-131-16/+24
| | | | | | | Approved by: Toshiharu OHNO <tohno@sirius.ocn.ne.jp> Notes: svn path=/head/; revision=78189
* Increase M_MAXLEN from 2048 - sizeof struct mbuf toBrian Somers1999-12-301-2/+2
| | | | | | | | | | | 4096 - sizeof struct mbuf, and set MAX_MRU and MAX_MTU back to 2048. 2048 is big enough as an MTU/MRU, but we need to be able to allocate larger mbufs after reassembling IP fragments. Notes: svn path=/head/; revision=55272
* Implement mbuf allocation internally by maintaining 8 buckets ofBrian Somers1999-12-201-2/+2
| | | | | | | | | | different sized mbufs, and mallocing them in chunks of 20 mbufs at a time. This improves back-to-back throughput by between 7 and 8% Notes: svn path=/head/; revision=54913
* o Split the two IPCP queues into three - one for FSM dataBrian Somers1999-09-041-13/+0
| | | | | | | | | | | | | | | (LCP/CCP/IPCP), one for urgent IP traffic and one for everything else. o Add the ``set urgent'' command for adjusting the list of urgent port numbers. The default urgent ports are 21, 22, 23, 513, 514, 543 and 544 (Ports 80 and 81 have been removed from the default priority list). o Increase the buffered packet threshold from 20 to 30. o Report the number of packets in the IP output queue and the list of urgent ports under ``show ipcp''. Notes: svn path=/head/; revision=50867
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* o Redesign the layering mechanism and make the aliasing code part ofBrian Somers1999-05-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Handle the detection of frames even if we read themBrian Somers1999-04-031-2/+2
| | | | | | | | | | | | with more than one read(). When we detect one, don't forget to pass it to async_Input() and drop our terminal back into command mode. Don't output an extraneous \r if we're passed \r\n to prompt_vprintf in raw mode. Notes: svn path=/head/; revision=45264
* MFMP: Make ppp multilink capable.Brian Somers1998-05-211-9/+58
|\ | | | | | | | | | | | | 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-5/+5
| | | | | | | | Notes: svn path=/cvs2svn/branches/MP/; revision=35605
| * o Defer setting up pap/chap based IP numbers & labels until afterBrian Somers1998-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we've determined if we're going to join another ppp invocation. o Make ``show link'' show all link details, and ``show links'' just give a list of links and their current status. o Show our current label in ``show bundle''. o Allow link cloning and removal as soon as our MRRU is set. o Make ``show lcp'' require context as nothing will ever change in our MP LCP (it's auto-configured as per rfc1990). o Initialise our LQM owner in hdlc_Init(). o Store our endpoint discriminator and authentication name at both the datalink and multilink level and compare them when we've finished AUTHENTICATE phase and before entering NETWORK phase. If they don't match, close the link again. Display the information in the appropriate ``show'' command. o Initialise datalink::phone and datalink::fsmp.object properly when we're cloning the link. o Show which link we're passing LQRs on in our diagnostics. o Reject endpoint discriminator REQs at the logical multilink level. o Remove the rest of our CARRIER and LINK logging setup. Notes: svn path=/cvs2svn/branches/MP/; revision=35432
| * o Move alias function pointers into loadalias.cBrian Somers1998-04-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | 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
| * Add the `clone' and `remove' commands for creating and destroyingBrian Somers1998-04-051-5/+3
| | | | | | | | | | | | | | links. Notes: svn path=/cvs2svn/branches/MP/; revision=35051
| * o Move struct lcp and struct ccp into struct link.Brian Somers1998-04-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Remove bundle2lcp(), bundle2ccp() and bundle2link(). They're too resource-hungry and we have `owner pointers' to do their job. o Make our FSM understand LCPs that are always ST_OPENED (with a minimum code that != 1). o Send FSM code rejects for invalid codes. o Make our bundle fsm_parent deal with multiple links. o Make timer diagnostics pretty and allow access via ~t in `term' mode (not just when logging debug) and `show timers'. Only show timers every second in debug mode, otherwise we get too many diagnostics to be useful (we probably still do). Also, don't restrict ~m in term mode to depend on debug logging. o Rationalise our bundles' phases. o Create struct mp (multilink protocol). This is both an NCP and a type of struct link. It feeds off other NCPs for output, passing fragmented packets into the queues of available datalinks. It also gets PROTO_MP input, reassembles the fragments into ppp frames, and passes them back to the HDLC layer that the fragments were passed from. ** It's not yet possible to enter multilink mode :-( ** o Add `set weight' (requires context) for deciding on a links weighting in multilink mode. Weighting is simplistic (and probably badly implemented) for now. o Remove the function pointers in struct link. They ended up only applying to physical links. o Configure our tun device with an MTU equal to the MRU from struct mp's LCP and a speed equal to the sum of our link speeds. o `show {lcp,ccp,proto}' and `set deflate' now have optional context and use ChooseLink() to decide on which `struct link' to use. This allows behaviour as before when in non-multilink mode, and allows access to the MP logical link in multilink mode. o Ignore reconnect and redial values when in -direct mode and when cleaning up. Always redial when in -ddial or -dedicated mode (unless cleaning up). o Tell our links to `staydown' when we close them due to a signal. o Remove remaining `#ifdef SIGALRM's (ppp doesn't function without alarms). o Don't bother strdup()ing our physical link name. o Various other cosmetic changes. Notes: svn path=/cvs2svn/branches/MP/; revision=35009
| * De-staticise LQR informationBrian Somers1998-03-131-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Create `struct hdlc' - a part of struct physical.Brian Somers1998-02-181-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | o Move our LCP report timer into struct hdlc - it's really a hdlc timer (fcs errors etc). o Make `show hdlc' require context and make the output more friendly. o Remove all non-const globals from hdlc.c o Output peer-rejected protocols by name - not just ones that we reject. Notes: svn path=/cvs2svn/branches/MP/; revision=33582
| * Make ``show escape'' require context.Brian Somers1998-02-181-3/+1
| | | | | | | | | | | | | | De-globalize EscMap[]. Notes: svn path=/cvs2svn/branches/MP/; revision=33581
| * o Introduce struct descriptor.Brian Somers1998-02-091-1/+2
| | | | | | | | | | | | | | | | | | | | This will ultimately be a member of a list of descriptors and their handler functions on which we need to select() in the main loop. o Make struct physical into a `sort' of struct descriptor. Notes: svn path=/cvs2svn/branches/MP/; revision=33194
| * Create `struct bundle' - the top level control structure.Brian Somers1998-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
| * Create `struct link' - the logical link from whichBrian Somers1998-01-301-2/+4
| | | | | | | | | | | | | | | | `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/+5
| | | | | | | | | | | | | | | | 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/+66
| | | | 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
* Abstract the CCP layer a level.Brian Somers1997-12-031-1/+2
| | | | | | | Add DEFLATE support. Notes: svn path=/head/; revision=31514
* Fix prototypes.Brian Somers1997-11-221-4/+3
| | | | | | | | | | | | | | | | | 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
* Cosmetic (no functional changes):Brian Somers1997-10-261-13/+10
| | | | | | | | | | | | | | | | | | 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-10/+11
| | | | | | | | Update loadalias to use the new libalias api. Update to version 1.1. Notes: svn path=/head/; revision=28679
* Overhaul ppp:Brian Somers1997-06-091-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+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
* Implement "set mtu" command to allow the client toBrian Somers1997-06-011-2/+6
| | | | | | | | | reduce the interface mtu. Allow max mru spec of 16k. Add "show m[rt]u" ability. Notes: svn path=/head/; revision=26326
* 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
* Some patches to ppp which improve stability. I have been running aDoug Rabson1996-01-301-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Final cleanup for now. -Wall is now silent. A couple of bogons found.Poul-Henning Kamp1996-01-111-2/+4
| | | | Notes: svn path=/head/; revision=13389
* New user Process PPP based on iij-ppp0.94beta2.Atsushi Murai1995-02-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+58
Notes: svn path=/cvs2svn/branches/R093/; revision=6059