]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (C) 1999 WIDE Project. | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 3. Neither the name of the project nor the names of its contributors | |
14 | * may be used to endorse or promote products derived from this software | |
15 | * without specific prior written permission. | |
16 | * | |
17 | * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND | |
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE | |
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
27 | * SUCH DAMAGE. | |
28 | */ | |
29 | ||
30 | /* | |
31 | * RFC2393 IP payload compression protocol (IPComp). | |
32 | */ | |
33 | ||
34 | #ifndef _NETINET6_IPCOMP_H_ | |
35 | #define _NETINET6_IPCOMP_H_ | |
36 | ||
37 | struct ipcomp { | |
38 | u_int8_t comp_nxt; /* Next Header */ | |
39 | u_int8_t comp_flags; /* reserved, must be zero */ | |
40 | u_int16_t comp_cpi; /* Compression parameter index */ | |
41 | }; | |
42 | ||
43 | /* well-known algorithm number (in CPI), from RFC2409 */ | |
44 | #define IPCOMP_OUI 1 /* vendor specific */ | |
45 | #define IPCOMP_DEFLATE 2 /* RFC2394 */ | |
46 | #define IPCOMP_LZS 3 /* RFC2395 */ | |
47 | #define IPCOMP_MAX 4 | |
48 | ||
49 | #define IPCOMP_CPI_NEGOTIATE_MIN 256 | |
50 | ||
51 | #if defined(KERNEL) || defined(_KERNEL) | |
52 | struct ipcomp_algorithm { | |
53 | int (*compress) __P((struct mbuf *, struct mbuf *, size_t *)); | |
54 | int (*decompress) __P((struct mbuf *, struct mbuf *, size_t *)); | |
55 | size_t minplen; /* minimum required length for compression */ | |
56 | }; | |
57 | ||
58 | struct ipsecrequest; | |
59 | extern struct ipcomp_algorithm ipcomp_algorithms[]; | |
60 | extern void ipcomp4_input __P((struct mbuf *, int)); | |
61 | extern int ipcomp4_output __P((struct mbuf *, struct ipsecrequest *)); | |
62 | #if INET6 | |
63 | extern int ipcomp6_input __P((struct mbuf **, int *)); | |
64 | extern int ipcomp6_output __P((struct mbuf *, u_char *, struct mbuf *, | |
65 | struct ipsecrequest *)); | |
66 | #endif | |
67 | #endif /*KERNEL*/ | |
68 | ||
69 | #endif /*_NETINET6_IPCOMP_H_*/ |