diff options
author | Peter Wemm <peter@FreeBSD.org> | 1997-08-22 11:53:19 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1997-08-22 11:53:19 +0000 |
commit | 69b0a8360bb26577dc178e8bd763165362678dde (patch) | |
tree | 15da113201d0ca82a7c0924f8663498d4e9714fc | |
parent | 0bcf872a971be23818f67c7c19ad26f3bc70c6cf (diff) | |
download | src-69b0a8360bb26577dc178e8bd763165362678dde.tar.gz src-69b0a8360bb26577dc178e8bd763165362678dde.zip |
Import kernel parts of ppp-2.3.1 onto vendor branch. There are no
changes, except for whitespace and a minor interface change in slcompress.*
that we can do without for the time being. This is here just for reference.
Notes
Notes:
svn path=/vendor/pppd/dist/; revision=28584
-rw-r--r-- | sys/net/slcompress.c | 32 | ||||
-rw-r--r-- | sys/net/slcompress.h | 22 |
2 files changed, 43 insertions, 11 deletions
diff --git a/sys/net/slcompress.c b/sys/net/slcompress.c index 9e6346c75fe6..96da9636463f 100644 --- a/sys/net/slcompress.c +++ b/sys/net/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; diff --git a/sys/net/slcompress.h b/sys/net/slcompress.h index f5e0cf7b610b..ca430c401d2a 100644 --- a/sys/net/slcompress.h +++ b/sys/net/slcompress.h @@ -1,5 +1,5 @@ -/* $NetBSD: slcompress.h,v 1.9 1995/07/04 06:28:29 paulus Exp $ */ -/* Id: slcompress.h,v 1.1 1995/12/11 05:17:12 paulus Exp */ +/* $NetBSD: slcompress.h,v 1.11 1997/05/17 21:12:11 christos Exp $ */ +/* Id: slcompress.h,v 1.4 1994/09/21 06:50:08 paulus Exp */ /* * Copyright (c) 1989, 1993 @@ -43,6 +43,9 @@ * - Initial distribution. */ +#ifndef _SLCOMPRESS_H_ +#define _SLCOMPRESS_H_ + #define MAX_STATES 16 /* must be > 2 and < 256 */ #define MAX_HDR MLEN /* XXX 4bsd-ism: should really be 128 */ @@ -155,9 +158,12 @@ struct slcompress { /* flag values */ #define SLF_TOSS 1 /* tossing rcvd frames because of input err */ -void sl_compress_init __P((struct slcompress *, int)); -u_int sl_compress_tcp __P((struct mbuf *, - struct ip *, struct slcompress *, int)); -int sl_uncompress_tcp __P((u_char **, int, u_int, struct slcompress *)); -int sl_uncompress_tcp_core __P((u_char *, int, int, u_int, - struct slcompress *, u_char **, u_int *)); +void sl_compress_init __P((struct slcompress *)); +void sl_compress_setup __P((struct slcompress *, int)); +u_int sl_compress_tcp __P((struct mbuf *, + struct ip *, struct slcompress *, int)); +int sl_uncompress_tcp __P((u_char **, int, u_int, struct slcompress *)); +int sl_uncompress_tcp_core __P((u_char *, int, int, u_int, + struct slcompress *, u_char **, u_int *)); + +#endif /* _SLCOMPRESS_H_ */ |