xref: /netbsd-src/sys/netipsec/ipcomp.h (revision e2c8a66404f385b2346d7238a9689bbe3f24a605)
1*e2c8a664Smaxv /*	$NetBSD: ipcomp.h,v 1.3 2018/04/19 08:27:38 maxv Exp $	*/
2*e2c8a664Smaxv /*	$FreeBSD: ipcomp.h,v 1.1.4.1 2003/01/24 05:11:35 sam Exp $	*/
374029031Sjonathan /*	$KAME: ipcomp.h,v 1.8 2000/09/26 07:55:14 itojun Exp $	*/
474029031Sjonathan 
574029031Sjonathan /*
674029031Sjonathan  * Copyright (C) 1999 WIDE Project.
774029031Sjonathan  * All rights reserved.
874029031Sjonathan  *
974029031Sjonathan  * Redistribution and use in source and binary forms, with or without
1074029031Sjonathan  * modification, are permitted provided that the following conditions
1174029031Sjonathan  * are met:
1274029031Sjonathan  * 1. Redistributions of source code must retain the above copyright
1374029031Sjonathan  *    notice, this list of conditions and the following disclaimer.
1474029031Sjonathan  * 2. Redistributions in binary form must reproduce the above copyright
1574029031Sjonathan  *    notice, this list of conditions and the following disclaimer in the
1674029031Sjonathan  *    documentation and/or other materials provided with the distribution.
1774029031Sjonathan  * 3. Neither the name of the project nor the names of its contributors
1874029031Sjonathan  *    may be used to endorse or promote products derived from this software
1974029031Sjonathan  *    without specific prior written permission.
2074029031Sjonathan  *
2174029031Sjonathan  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
2274029031Sjonathan  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2374029031Sjonathan  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2474029031Sjonathan  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2574029031Sjonathan  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2674029031Sjonathan  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2774029031Sjonathan  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2874029031Sjonathan  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2974029031Sjonathan  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3074029031Sjonathan  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3174029031Sjonathan  * SUCH DAMAGE.
3274029031Sjonathan  */
3374029031Sjonathan 
3474029031Sjonathan /*
3574029031Sjonathan  * RFC2393 IP payload compression protocol (IPComp).
3674029031Sjonathan  */
3774029031Sjonathan 
3874029031Sjonathan #ifndef _NETIPSEC_IPCOMP_H_
3974029031Sjonathan #define _NETIPSEC_IPCOMP_H_
4074029031Sjonathan 
4174029031Sjonathan struct ipcomp {
4274029031Sjonathan 	u_int8_t comp_nxt;	/* Next Header */
4374029031Sjonathan 	u_int8_t comp_flags;	/* reserved, must be zero */
4474029031Sjonathan 	u_int16_t comp_cpi;	/* Compression parameter index */
4574029031Sjonathan };
4674029031Sjonathan 
4774029031Sjonathan #define	IPCOMP_HLENGTH	4	/* Length of IPCOMP header */
4874029031Sjonathan 
4974029031Sjonathan /* well-known algorithm number (in CPI), from RFC2409 */
5074029031Sjonathan #define IPCOMP_OUI	1	/* vendor specific */
5174029031Sjonathan #define IPCOMP_DEFLATE	2	/* RFC2394 */
5274029031Sjonathan #define IPCOMP_LZS	3	/* RFC2395 */
5374029031Sjonathan #define IPCOMP_MAX	4
5474029031Sjonathan 
5574029031Sjonathan #define IPCOMP_CPI_NEGOTIATE_MIN	256
56adf9419cSelad #endif /* !_NETIPSEC_IPCOMP_H_ */
57