1104476Ssam/*	$FreeBSD$	*/
2104476Ssam/* $OpenBSD: deflate.h,v 1.3 2002/03/14 01:26:51 millert Exp $ */
3104476Ssam
4139825Simp/*-
5104476Ssam * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
6104476Ssam *
7104476Ssam * Redistribution and use in source and binary forms, with or without
8104476Ssam * modification, are permitted provided that the following conditions
9104476Ssam * are met:
10104476Ssam *
11104476Ssam * 1. Redistributions of source code must retain the above copyright
12104476Ssam *   notice, this list of conditions and the following disclaimer.
13104476Ssam * 2. Redistributions in binary form must reproduce the above copyright
14104476Ssam *   notice, this list of conditions and the following disclaimer in the
15104476Ssam *   documentation and/or other materials provided with the distribution.
16104476Ssam * 3. The name of the author may not be used to endorse or promote products
17104476Ssam *   derived from this software without specific prior written permission.
18104476Ssam *
19104476Ssam * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20104476Ssam * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21104476Ssam * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22104476Ssam * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23104476Ssam * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24104476Ssam * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25104476Ssam * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26104476Ssam * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27104476Ssam * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28104476Ssam * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29104476Ssam */
30104476Ssam
31104476Ssam/*
32104476Ssam * Definition for the wrapper around the deflate compression
33104476Ssam * algorithm used in /sys/crypto
34104476Ssam */
35104476Ssam
36104476Ssam#ifndef _CRYPTO_DEFLATE_H_
37104476Ssam#define _CRYPTO_DEFLATE_H_
38104476Ssam
39104476Ssam#include <net/zlib.h>
40104476Ssam
41104476Ssam#define Z_METHOD	8
42104476Ssam#define Z_MEMLEVEL	8
43104476Ssam#define MINCOMP		2	/* won't be used, but must be defined */
44104476Ssam#define ZBUF		10
45104476Ssam
46104476Ssamu_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **);
47104476Ssamvoid *z_alloc(void *, u_int, u_int);
48104476Ssamvoid z_free(void *, void *);
49104476Ssam
50199895Sbz/*
51199895Sbz * We are going to use a combined allocation to hold the metadata
52199895Sbz * from the struct immediately followed by the real application data.
53199895Sbz */
54104476Ssamstruct deflate_buf {
55199895Sbz	struct deflate_buf *next;
56199895Sbz	uint32_t size;
57199895Sbz	uint8_t data[];
58104476Ssam};
59104476Ssam
60104476Ssam#endif /* _CRYPTO_DEFLATE_H_ */
61