X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=netbsd-1.2%2Fslcompress.c;h=96da9636463fd2167d272ef98942b0d1e6e7dc3e;hp=9e6346c75fe60e63f8c615bea178ff81e72d5ce3;hb=a00baab063b349591289cbde22ab40cf80b8f0af;hpb=e28f2e9f4f40cbe35009ba554c5bd29fd456416b diff --git a/netbsd-1.2/slcompress.c b/netbsd-1.2/slcompress.c index 9e6346c..96da963 100644 --- a/netbsd-1.2/slcompress.c +++ b/netbsd-1.2/slcompress.c @@ -1,4 +1,4 @@ -/* $NetBSD: slcompress.c,v 1.15 1996/03/15 02:28:12 paulus Exp $ */ +/* $NetBSD: slcompress.c,v 1.17 1997/05/17 21:12:10 christos Exp $ */ /* Id: slcompress.c,v 1.3 1996/05/24 07:04:47 paulus Exp */ /* @@ -67,10 +67,36 @@ #define ovbcopy bcopy #endif + void -sl_compress_init(comp, max_state) +sl_compress_init(comp) struct slcompress *comp; - int max_state; +{ + register u_int i; + register struct cstate *tstate = comp->tstate; + + bzero((char *)comp, sizeof(*comp)); + for (i = MAX_STATES - 1; i > 0; --i) { + tstate[i].cs_id = i; + tstate[i].cs_next = &tstate[i - 1]; + } + tstate[0].cs_next = &tstate[MAX_STATES - 1]; + tstate[0].cs_id = 0; + comp->last_cs = &tstate[0]; + comp->last_recv = 255; + comp->last_xmit = 255; + comp->flags = SLF_TOSS; +} + + +/* + * Like sl_compress_init, but we get to specify the maximum connection + * ID to use on transmission. + */ +void +sl_compress_setup(comp, max_state) + struct slcompress *comp; + int max_state; { register u_int i; register struct cstate *tstate = comp->tstate;