X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=ultrix%2Fbsd-comp.c;h=27f3f9397088db9b389e611ffcbb8c14e20ecedd;hp=12bca928f04c3b5220b8e16c41cf82396ea9382c;hb=e5ad7e3dbf232955054ee90e54cebd6ee9533a85;hpb=3da550efb3dc7c6dfb697792f5cc8bc7c0f776e3 diff --git a/ultrix/bsd-comp.c b/ultrix/bsd-comp.c index 12bca92..27f3f93 100644 --- a/ultrix/bsd-comp.c +++ b/ultrix/bsd-comp.c @@ -40,7 +40,7 @@ /* * This version is for use with mbufs on Ultrix systems. * - * $Id: bsd-comp.c,v 1.6 1996/01/18 03:13:09 paulus Exp $ + * $Id: bsd-comp.c,v 1.8 1996/08/28 06:32:00 paulus Exp $ */ #include "../h/param.h" @@ -197,6 +197,12 @@ struct compressor ppp_bsd_compress = { #define RATIO_SCALE (1<>RATIO_SCALE_LOG) +static void bsd_clear __P((struct bsd_db *)); +static int bsd_check __P((struct bsd_db *)); +static void *bsd_alloc __P((u_char *, int, int)); +static int bsd_init __P((struct bsd_db *, u_char *, int, int, int, int, + int, int)); + /* * clear the dictionary */ @@ -210,7 +216,6 @@ bsd_clear(db) db->ratio = 0; db->bytes_out = 0; db->in_count = 0; - db->incomp_count = 0; db->checkpoint = CHECK_GAP; } @@ -318,7 +323,7 @@ bsd_alloc(options, opt_len, decomp) u_int newlen, hsize, hshift, maxmaxcode; struct bsd_db *db; - if (opt_len != CILEN_BSD_COMPRESS || options[0] != CI_BSD_COMPRESS + if (opt_len < CILEN_BSD_COMPRESS || options[0] != CI_BSD_COMPRESS || options[1] != CILEN_BSD_COMPRESS || BSD_VERSION(options[2]) != BSD_CURRENT_VERSION) return NULL; @@ -494,7 +499,7 @@ bsd_compress(state, mret, mp, slen, maxolen) u_char *rptr, *wptr; u_char *cp_end; int olen; - struct mbuf *m, **mnp, *clp; + struct mbuf *m, *clp; #define PUTBYTE(v) { \ ++olen; \ @@ -721,7 +726,6 @@ bsd_incomp(state, dmsg) if (ent < 0x21 || ent > 0xf9) return; - db->incomp_count++; db->seqno++; ilen = 1; /* count the protocol as 1 byte */ rptr += PPP_HDRLEN; @@ -842,7 +846,7 @@ bsd_decompress(state, cmp, dmpp) struct mbuf *m, *dmp, *mret; int adrs, ctrl, ilen; int space, codelen, extra; - struct mbuf *last, *clp; + struct mbuf *clp; /* * Save the address/control from the PPP header