summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/vjcomp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-12-03 10:23:54 +0000
committerbrian <brian@FreeBSD.org>1997-12-03 10:23:54 +0000
commit4c9568e05af003a85ca40c896b5041fc8286221f (patch)
tree86301631e3a842883c7e61e9c2f1feab23a39e23 /usr.sbin/ppp/vjcomp.c
parent185fb48052f903a80b31786784cbb82fb059c35c (diff)
downloadFreeBSD-src-4c9568e05af003a85ca40c896b5041fc8286221f.zip
FreeBSD-src-4c9568e05af003a85ca40c896b5041fc8286221f.tar.gz
Abstract the CCP layer a level.
Add DEFLATE support.
Diffstat (limited to 'usr.sbin/ppp/vjcomp.c')
-rw-r--r--usr.sbin/ppp/vjcomp.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/usr.sbin/ppp/vjcomp.c b/usr.sbin/ppp/vjcomp.c
index c0fc76f..74e4371 100644
--- a/usr.sbin/ppp/vjcomp.c
+++ b/usr.sbin/ppp/vjcomp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: vjcomp.c,v 1.12 1997/11/09 06:22:49 brian Exp $
+ * $Id: vjcomp.c,v 1.13 1997/11/22 03:37:54 brian Exp $
*
* TODO:
*/
@@ -55,14 +55,14 @@ void
SendPppFrame(struct mbuf * bp)
{
int type;
- int proto;
- int cproto = IpcpInfo.his_compproto >> 16;
+ u_short proto;
+ u_short cproto = IpcpInfo.his_compproto >> 16;
LogPrintf(LogDEBUG, "SendPppFrame: proto = %x\n", IpcpInfo.his_compproto);
if (((struct ip *) MBUF_CTOP(bp))->ip_p == IPPROTO_TCP
&& cproto == PROTO_VJCOMP) {
- type = sl_compress_tcp(bp, (struct ip *) MBUF_CTOP(bp), &cslc, IpcpInfo.his_compproto & 0xff);
-
+ type = sl_compress_tcp(bp, (struct ip *)MBUF_CTOP(bp), &cslc,
+ IpcpInfo.his_compproto & 0xff);
LogPrintf(LogDEBUG, "SendPppFrame: type = %x\n", type);
switch (type) {
case TYPE_IP:
@@ -153,3 +153,13 @@ VjCompInput(struct mbuf * bp, int proto)
bp = VjUncompressTcp(bp, type);
return (bp);
}
+
+const char *
+vj2asc(u_long val)
+{
+ static char asc[50];
+
+ sprintf(asc, "%ld VJ slots %s slot compression",
+ ((val>>8)&15)+1, val & 1 ? "with" : "without");
+ return asc;
+}
OpenPOWER on IntegriCloud