xref: /f-stack/freebsd/netipsec/ipcomp.h (revision 22ce4aff)
1a9643ea8Slogwang /*	$FreeBSD$	*/
2a9643ea8Slogwang /*	$KAME: ipcomp.h,v 1.8 2000/09/26 07:55:14 itojun Exp $	*/
3a9643ea8Slogwang 
4a9643ea8Slogwang /*-
5*22ce4affSfengbojiang  * SPDX-License-Identifier: BSD-3-Clause
6*22ce4affSfengbojiang  *
7a9643ea8Slogwang  * Copyright (C) 1999 WIDE Project.
8a9643ea8Slogwang  * All rights reserved.
9a9643ea8Slogwang  *
10a9643ea8Slogwang  * Redistribution and use in source and binary forms, with or without
11a9643ea8Slogwang  * modification, are permitted provided that the following conditions
12a9643ea8Slogwang  * are met:
13a9643ea8Slogwang  * 1. Redistributions of source code must retain the above copyright
14a9643ea8Slogwang  *    notice, this list of conditions and the following disclaimer.
15a9643ea8Slogwang  * 2. Redistributions in binary form must reproduce the above copyright
16a9643ea8Slogwang  *    notice, this list of conditions and the following disclaimer in the
17a9643ea8Slogwang  *    documentation and/or other materials provided with the distribution.
18a9643ea8Slogwang  * 3. Neither the name of the project nor the names of its contributors
19a9643ea8Slogwang  *    may be used to endorse or promote products derived from this software
20a9643ea8Slogwang  *    without specific prior written permission.
21a9643ea8Slogwang  *
22a9643ea8Slogwang  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
23a9643ea8Slogwang  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24a9643ea8Slogwang  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25a9643ea8Slogwang  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
26a9643ea8Slogwang  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27a9643ea8Slogwang  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28a9643ea8Slogwang  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29a9643ea8Slogwang  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30a9643ea8Slogwang  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31a9643ea8Slogwang  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32a9643ea8Slogwang  * SUCH DAMAGE.
33a9643ea8Slogwang  */
34a9643ea8Slogwang 
35a9643ea8Slogwang /*
36a9643ea8Slogwang  * RFC2393 IP payload compression protocol (IPComp).
37a9643ea8Slogwang  */
38a9643ea8Slogwang 
39a9643ea8Slogwang #ifndef _NETIPSEC_IPCOMP_H_
40a9643ea8Slogwang #define _NETIPSEC_IPCOMP_H_
41a9643ea8Slogwang 
42a9643ea8Slogwang struct ipcomp {
43a9643ea8Slogwang 	u_int8_t comp_nxt;	/* Next Header */
44a9643ea8Slogwang 	u_int8_t comp_flags;	/* reserved, must be zero */
45a9643ea8Slogwang 	u_int16_t comp_cpi;	/* Compression parameter index */
46a9643ea8Slogwang };
47a9643ea8Slogwang 
48a9643ea8Slogwang #define	IPCOMP_HLENGTH	4	/* Length of IPCOMP header */
49a9643ea8Slogwang 
50a9643ea8Slogwang /* well-known algorithm number (in CPI), from RFC2409 */
51a9643ea8Slogwang #define IPCOMP_OUI	1	/* vendor specific */
52a9643ea8Slogwang #define IPCOMP_DEFLATE	2	/* RFC2394 */
53a9643ea8Slogwang #define IPCOMP_LZS	3	/* RFC2395 */
54a9643ea8Slogwang #define IPCOMP_MAX	4
55a9643ea8Slogwang 
56a9643ea8Slogwang #define IPCOMP_CPI_NEGOTIATE_MIN	256
57a9643ea8Slogwang #endif /*_NETIPSEC_IPCOMP_H_*/
58