-/* $OpenBSD: bsd-comp.c,v 1.16 2018/11/09 14:14:31 claudio Exp $ */
+/* $OpenBSD: bsd-comp.c,v 1.17 2021/03/05 09:21:08 jsg Exp $ */
/* $NetBSD: bsd-comp.c,v 1.6 1996/10/13 02:10:58 christos Exp $ */
/* Because this code is derived from the 4.3BSD compress source:
* clear the dictionary
*/
static void
-bsd_clear(db)
- struct bsd_db *db;
+bsd_clear(struct bsd_db *db)
{
db->clear_count++;
db->max_ent = FIRST-1;
* must compute the same ratio.
*/
static int /* 1=output CLEAR */
-bsd_check(db)
- struct bsd_db *db;
+bsd_check(struct bsd_db *db)
{
u_int new_ratio;
* Return statistics.
*/
static void
-bsd_comp_stats(state, stats)
- void *state;
- struct compstat *stats;
+bsd_comp_stats(void *state, struct compstat *stats)
{
struct bsd_db *db = (struct bsd_db *) state;
u_int out;
* Reset state, as on a CCP ResetReq.
*/
static void
-bsd_reset(state)
- void *state;
+bsd_reset(void *state)
{
struct bsd_db *db = (struct bsd_db *) state;
* Allocate space for a (de) compressor.
*/
static void *
-bsd_alloc(options, opt_len, decomp)
- u_char *options;
- int opt_len, decomp;
+bsd_alloc(u_char *options, int opt_len, int decomp)
{
int bits;
u_int newlen, hsize, hshift, maxmaxcode;
}
static void
-bsd_free(state)
- void *state;
+bsd_free(void *state)
{
struct bsd_db *db = (struct bsd_db *) state;
}
static void *
-bsd_comp_alloc(options, opt_len)
- u_char *options;
- int opt_len;
+bsd_comp_alloc(u_char *options, int opt_len)
{
return bsd_alloc(options, opt_len, 0);
}
static void *
-bsd_decomp_alloc(options, opt_len)
- u_char *options;
- int opt_len;
+bsd_decomp_alloc(u_char *options, int opt_len)
{
return bsd_alloc(options, opt_len, 1);
}
* Initialize the database.
*/
static int
-bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp)
- struct bsd_db *db;
- u_char *options;
- int opt_len, unit, hdrlen, mru, debug, decomp;
+bsd_init(struct bsd_db *db, u_char *options, int opt_len, int unit, int hdrlen,
+ int mru, int debug, int decomp)
{
int i;
}
static int
-bsd_comp_init(state, options, opt_len, unit, hdrlen, debug)
- void *state;
- u_char *options;
- int opt_len, unit, hdrlen, debug;
+bsd_comp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen,
+ int debug)
{
return bsd_init((struct bsd_db *) state, options, opt_len,
unit, hdrlen, 0, debug, 0);
}
static int
-bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug)
- void *state;
- u_char *options;
- int opt_len, unit, hdrlen, mru, debug;
+bsd_decomp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen,
+ int mru, int debug)
{
return bsd_init((struct bsd_db *) state, options, opt_len,
unit, hdrlen, mru, debug, 1);
* code size expands, we do not output a bunch of padding.
*/
int /* new slen */
-bsd_compress(state, mret, mp, slen, maxolen)
- void *state;
- struct mbuf **mret; /* return compressed mbuf chain here */
- struct mbuf *mp; /* from here */
- int slen; /* uncompressed length */
- int maxolen; /* max compressed length */
+bsd_compress(void *state,
+ struct mbuf **mret, /* return compressed mbuf chain here */
+ struct mbuf *mp, /* from here */
+ int slen, /* uncompressed length */
+ int maxolen) /* max compressed length */
{
struct bsd_db *db = (struct bsd_db *) state;
int hshift = db->hshift;
* incompressible data by pretending to compress the incoming data.
*/
static void
-bsd_incomp(state, dmsg)
- void *state;
- struct mbuf *dmsg;
+bsd_incomp(void *state, struct mbuf *dmsg)
{
struct bsd_db *db = (struct bsd_db *) state;
u_int hshift = db->hshift;
* compression, even though they are detected by inspecting the input.
*/
int
-bsd_decompress(state, cmp, dmpp)
- void *state;
- struct mbuf *cmp, **dmpp;
+bsd_decompress(void *state, struct mbuf *cmp, struct mbuf **dmpp)
{
struct bsd_db *db = (struct bsd_db *) state;
u_int max_ent = db->max_ent;
-/* $OpenBSD: ppp-deflate.c,v 1.15 2018/11/09 14:14:31 claudio Exp $ */
+/* $OpenBSD: ppp-deflate.c,v 1.16 2021/03/05 09:21:08 jsg Exp $ */
/* $NetBSD: ppp-deflate.c,v 1.1 1996/03/15 02:28:09 paulus Exp $ */
/*
* Space allocation and freeing routines for use by zlib routines.
*/
void *
-zcalloc(notused, items, size)
- void *notused;
- u_int items, size;
+zcalloc(void *notused, u_int items, u_int size)
{
void *ptr;
}
void
-zcfree(notused, ptr)
- void *notused;
- void *ptr;
+zcfree(void *notused, void *ptr)
{
free(ptr, M_DEVBUF, 0);
}
* Allocate space for a compressor.
*/
static void *
-z_comp_alloc(options, opt_len)
- u_char *options;
- int opt_len;
+z_comp_alloc(u_char *options, int opt_len)
{
struct deflate_state *state;
int w_size;
}
static void
-z_comp_free(arg)
- void *arg;
+z_comp_free(void *arg)
{
struct deflate_state *state = (struct deflate_state *) arg;
}
static int
-z_comp_init(arg, options, opt_len, unit, hdrlen, debug)
- void *arg;
- u_char *options;
- int opt_len, unit, hdrlen, debug;
+z_comp_init(void *arg, u_char *options, int opt_len, int unit, int hdrlen,
+ int debug)
{
struct deflate_state *state = (struct deflate_state *) arg;
}
static void
-z_comp_reset(arg)
- void *arg;
+z_comp_reset(void *arg)
{
struct deflate_state *state = (struct deflate_state *) arg;
}
int
-z_compress(arg, mret, mp, orig_len, maxolen)
- void *arg;
- struct mbuf **mret; /* compressed packet (out) */
- struct mbuf *mp; /* uncompressed packet (in) */
- int orig_len, maxolen;
+z_compress(void *arg,
+ struct mbuf **mret, /* compressed packet (out) */
+ struct mbuf *mp, /* uncompressed packet (in) */
+ int orig_len, int maxolen)
{
struct deflate_state *state = (struct deflate_state *) arg;
u_char *rptr, *wptr;
}
static void
-z_comp_stats(arg, stats)
- void *arg;
- struct compstat *stats;
+z_comp_stats(void *arg, struct compstat *stats)
{
struct deflate_state *state = (struct deflate_state *) arg;
u_int out;
* Allocate space for a decompressor.
*/
static void *
-z_decomp_alloc(options, opt_len)
- u_char *options;
- int opt_len;
+z_decomp_alloc(u_char *options, int opt_len)
{
struct deflate_state *state;
int w_size;
}
static void
-z_decomp_free(arg)
- void *arg;
+z_decomp_free(void *arg)
{
struct deflate_state *state = (struct deflate_state *) arg;
}
static int
-z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug)
- void *arg;
- u_char *options;
- int opt_len, unit, hdrlen, mru, debug;
+z_decomp_init(void *arg, u_char *options, int opt_len, int unit, int hdrlen,
+ int mru, int debug)
{
struct deflate_state *state = (struct deflate_state *) arg;
}
static void
-z_decomp_reset(arg)
- void *arg;
+z_decomp_reset(void *arg)
{
struct deflate_state *state = (struct deflate_state *) arg;
* compression, even though they are detected by inspecting the input.
*/
int
-z_decompress(arg, mi, mop)
- void *arg;
- struct mbuf *mi, **mop;
+z_decompress(void *arg, struct mbuf *mi, struct mbuf **mop)
{
struct deflate_state *state = (struct deflate_state *) arg;
struct mbuf *mo, *mo_head;
* Incompressible data has arrived - add it to the history.
*/
static void
-z_incomp(arg, mi)
- void *arg;
- struct mbuf *mi;
+z_incomp(void *arg, struct mbuf *mi)
{
struct deflate_state *state = (struct deflate_state *) arg;
u_char *rptr;