From 0053cc58a9fd52c41b2e2b613dff39539f796852 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Wed, 3 Dec 1997 10:23:54 +0000 Subject: Abstract the CCP layer a level. Add DEFLATE support. --- usr.sbin/ppp/vjcomp.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'usr.sbin/ppp/vjcomp.c') diff --git a/usr.sbin/ppp/vjcomp.c b/usr.sbin/ppp/vjcomp.c index c0fc76f7d599..74e4371552db 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; +} -- cgit v1.3