188768458SSam Leffler /* $KAME: esp.h,v 1.16 2000/10/18 21:28:00 itojun Exp $ */ 288768458SSam Leffler 3c398230bSWarner Losh /*- 4*51369649SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 5*51369649SPedro F. Giffuni * 688768458SSam Leffler * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 788768458SSam Leffler * All rights reserved. 888768458SSam Leffler * 988768458SSam Leffler * Redistribution and use in source and binary forms, with or without 1088768458SSam Leffler * modification, are permitted provided that the following conditions 1188768458SSam Leffler * are met: 1288768458SSam Leffler * 1. Redistributions of source code must retain the above copyright 1388768458SSam Leffler * notice, this list of conditions and the following disclaimer. 1488768458SSam Leffler * 2. Redistributions in binary form must reproduce the above copyright 1588768458SSam Leffler * notice, this list of conditions and the following disclaimer in the 1688768458SSam Leffler * documentation and/or other materials provided with the distribution. 1788768458SSam Leffler * 3. Neither the name of the project nor the names of its contributors 1888768458SSam Leffler * may be used to endorse or promote products derived from this software 1988768458SSam Leffler * without specific prior written permission. 2088768458SSam Leffler * 2188768458SSam Leffler * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 2288768458SSam Leffler * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2388768458SSam Leffler * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2488768458SSam Leffler * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 2588768458SSam Leffler * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2688768458SSam Leffler * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2788768458SSam Leffler * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2888768458SSam Leffler * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2988768458SSam Leffler * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3088768458SSam Leffler * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3188768458SSam Leffler * SUCH DAMAGE. 3288768458SSam Leffler */ 3388768458SSam Leffler 3488768458SSam Leffler /* 3588768458SSam Leffler * RFC1827/2406 Encapsulated Security Payload. 3688768458SSam Leffler */ 3788768458SSam Leffler 3888768458SSam Leffler #ifndef _NETIPSEC_ESP_H_ 3988768458SSam Leffler #define _NETIPSEC_ESP_H_ 4088768458SSam Leffler 4188768458SSam Leffler struct esp { 4288768458SSam Leffler u_int32_t esp_spi; /* ESP */ 4388768458SSam Leffler /*variable size, 32bit bound*/ /* Initialization Vector */ 4488768458SSam Leffler /*variable size*/ /* Payload data */ 4588768458SSam Leffler /*variable size*/ /* padding */ 46a9b294b4SGeorge V. Neville-Neil /*8bit*/ /* pad length */ 4788768458SSam Leffler /*8bit*/ /* next header */ 4888768458SSam Leffler /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */ 4988768458SSam Leffler }; 5088768458SSam Leffler 5188768458SSam Leffler struct newesp { 5288768458SSam Leffler u_int32_t esp_spi; /* ESP */ 5388768458SSam Leffler u_int32_t esp_seq; /* Sequence number */ 5488768458SSam Leffler /*variable size*/ /* (IV and) Payload data */ 5588768458SSam Leffler /*variable size*/ /* padding */ 56a9b294b4SGeorge V. Neville-Neil /*8bit*/ /* pad length */ 5788768458SSam Leffler /*8bit*/ /* next header */ 5888768458SSam Leffler /*variable size, 32bit bound*/ /* Authentication data */ 5988768458SSam Leffler }; 6088768458SSam Leffler 6188768458SSam Leffler struct esptail { 6288768458SSam Leffler u_int8_t esp_padlen; /* pad length */ 6388768458SSam Leffler u_int8_t esp_nxt; /* Next header */ 6488768458SSam Leffler /*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/ 6588768458SSam Leffler }; 6688768458SSam Leffler 6788768458SSam Leffler #define ESP_ALEN 12 /* 96-bit authenticator */ 6888768458SSam Leffler #endif /*_NETIPSEC_ESP_H_*/ 69