summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/deflate.c
Commit message (Collapse)AuthorAgeFilesLines
* Add ISDN support via isdnd & i4b. This requires versionbrian1999-08-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 0.81.1 of the i4b code - namely support of the I4B_VR_REQ ioctl via the i4brbchX device. Ppp controls the phone number, but idle timers and SYNC/RAW decisions are still made by isdnd (in isdnd.rc). This involves a new datalink state machine phase. The ``wait for carrier'' phase happens after dialing but before logging in. The whole dial state should really be abstracted so that each device type can deal with it in its own way (thinking about PPPoE) - but that'll have to wait. The ``set cd'' symantics remain the same for tty devices, but we now delay until we either get CD or timeout waiting (at which time we drop the link if we require CD). For i4b devices we always insist on carrier. Thanks to hm@ for his help, and especially for pointing out that I *don't* need to re-implement isdnd (that was a huge waste of time !) :-]
* o Alter the mbuf type as it's processed by different layers.brian1999-06-021-7/+7
| | | | | | | | 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().
* o Redesign the layering mechanism and make the aliasing code part ofbrian1999-05-081-15/+16
| | | | | | | | | | | | | | | | | | | | | 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''.
* Tone down the log levels (Log{ERROR,WARN} -> LogCCP)brian1999-03-111-6/+6
| | | | | | | | | | | | 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...
* o Support callback types NONE, E.164, AUTH and CBCP.brian1998-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.
* Change some log levels. ALERTs are only logged whenbrian1998-06-161-5/+5
| | | | | | something that can't happen happens or when everyone needs to know. ERRORs are only logged when something unexpected happens.
* o De-staticise things that don't need to be static.brian1998-06-151-2/+2
| | | | | | | | | | o Bring the static ``ttystate'' into struct prompt so that the tilde context is per prompt and not global. o Comment the remaining static variables so that it's clear why they're static. o Add some XXX comments suggesting that our interface list and our hostname should be re-generated after a signal (say SIGUSR1) so that a machine with PCCARDs has a chance.
* MFMP: Make ppp multilink capable.brian1998-05-211-246/+220
| | | | See the file README.changes, and re-read the man page.
* Add extraneous braces to stiffle warnings from gcc-2.8brian1998-03-131-2/+3
|
* Implement Reset{Req,Ack} properly, as per rfc 1962.brian1998-01-101-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (I completely mis-read the rfc last time 'round!) This means: o Better CCP/WARN Reset diagnostics. o After we've sent a REQ and before we've received an ACK, we drop incoming compressed data and send another REQ. o Before sending an ACK, re-sequence all pending PRI_NORMAL data in the modem queue so that pending packets won't get to the peer *after* the ResetAck. o Send ACKs with the `identifier' from the REQ frame. o After we've received a correct ACK, duplicate ACKs are ok (and will reset our history). o Incorrect ACKs (not matching the last REQ) are moaned about and dropped. Also, o Calculate the correct FCS after compressing a packet. DEFLATE *may* produce an mbuf with more than a single link in the chain, but HdlcOutput didn't know how to calculate the FCS :-( o Make `struct fsm'::reqid a u_char, not an int. This fix will prevent us from sending id `255' 2,000,000,000 times before wrapping to `0' for another 2,000,000,000 sends :-/ o Bump the version number a little. The end result: DEFLATE now works over an unreliable link layer. I can txfr a 1.5Mb kernel over a (rather bad) null-modem cable at an average of 21679 bytes per second using rcp. Repeat after me: Don't test compression using a loopback ppp/tcp setup as we never lose packets and therefore never have to reset!
* Allow initial sequence numbers less than what we're expecting.brian1997-12-281-6/+21
| | | | | | | When CCP is originally negotiated, the only thing we can be sure about is that we've started adding data to the inflate dictionary either before or at the same time as the peer. This is ok, 'cos DEFLATE is a `sliding window' compressor.
* Add (BSD) copyright headers.brian1997-12-211-2/+26
|
* Deal with inflate() returning avail_in == avail_out == 0brian1997-12-081-2/+18
| | | | | | | We must call inflate again in case there's any pending output despite our input buffer being empty. If the output buffer is in fact already flushed, inflate() returns Z_BUF_ERROR. There isn't really an error !
* Fix the CCP Type field value for DEFLATE.brian1997-12-031-13/+77
| | | | | | | | | | | | | | (I *really* meant to do this *before* committing the deflate changes in the first place - oops). Pppd is horribly broken in this respect - refer to the ppp man page for details. Ppp *WON'T* negotiate deflate with pppd by default - you must ``enable'' and ``accept'' ``pppd-deflate'' in your config. While I'm in there, update the cftypes in ccp.c so that we recognise some more protocols (we don't actually do anything with them - just send a REJ).
* Abstract the CCP layer a level.brian1997-12-031-0/+499
Add DEFLATE support.
OpenPOWER on IntegriCloud