xref: /aosp_15_r20/external/tcpdump/ah.h (revision 05b00f6010a2396e3db2409989fc67270046269f)
1*05b00f60SXin Li /*	$NetBSD: ah.h,v 1.12 2000/07/23 05:23:04 itojun Exp $	*/
2*05b00f60SXin Li /*	$KAME: ah.h,v 1.12 2000/07/20 17:41:01 itojun Exp $	*/
3*05b00f60SXin Li 
4*05b00f60SXin Li /*
5*05b00f60SXin Li  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6*05b00f60SXin Li  * All rights reserved.
7*05b00f60SXin Li  *
8*05b00f60SXin Li  * Redistribution and use in source and binary forms, with or without
9*05b00f60SXin Li  * modification, are permitted provided that the following conditions
10*05b00f60SXin Li  * are met:
11*05b00f60SXin Li  * 1. Redistributions of source code must retain the above copyright
12*05b00f60SXin Li  *    notice, this list of conditions and the following disclaimer.
13*05b00f60SXin Li  * 2. Redistributions in binary form must reproduce the above copyright
14*05b00f60SXin Li  *    notice, this list of conditions and the following disclaimer in the
15*05b00f60SXin Li  *    documentation and/or other materials provided with the distribution.
16*05b00f60SXin Li  * 3. Neither the name of the project nor the names of its contributors
17*05b00f60SXin Li  *    may be used to endorse or promote products derived from this software
18*05b00f60SXin Li  *    without specific prior written permission.
19*05b00f60SXin Li  *
20*05b00f60SXin Li  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21*05b00f60SXin Li  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*05b00f60SXin Li  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*05b00f60SXin Li  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24*05b00f60SXin Li  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25*05b00f60SXin Li  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26*05b00f60SXin Li  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27*05b00f60SXin Li  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28*05b00f60SXin Li  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29*05b00f60SXin Li  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30*05b00f60SXin Li  * SUCH DAMAGE.
31*05b00f60SXin Li  */
32*05b00f60SXin Li 
33*05b00f60SXin Li /*
34*05b00f60SXin Li  * RFC4302 authentication header.
35*05b00f60SXin Li  */
36*05b00f60SXin Li 
37*05b00f60SXin Li #ifndef ND_AH_H_
38*05b00f60SXin Li #define ND_AH_H_
39*05b00f60SXin Li 
40*05b00f60SXin Li /*
41*05b00f60SXin Li  *     0                   1                   2                   3
42*05b00f60SXin Li  *     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
43*05b00f60SXin Li  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44*05b00f60SXin Li  *   | Next Header   |  Payload Len  |          RESERVED             |
45*05b00f60SXin Li  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46*05b00f60SXin Li  *   |                 Security Parameters Index (SPI)               |
47*05b00f60SXin Li  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48*05b00f60SXin Li  *   |                    Sequence Number Field                      |
49*05b00f60SXin Li  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50*05b00f60SXin Li  *   |                                                               |
51*05b00f60SXin Li  *   +                Integrity Check Value-ICV (variable)           |
52*05b00f60SXin Li  *   |                                                               |
53*05b00f60SXin Li  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54*05b00f60SXin Li  *
55*05b00f60SXin Li  *                          Figure 1.  AH Format
56*05b00f60SXin Li  */
57*05b00f60SXin Li 
58*05b00f60SXin Li struct ah {
59*05b00f60SXin Li 	nd_uint8_t	ah_nxt;		/* Next Header */
60*05b00f60SXin Li 	nd_uint8_t	ah_len;		/* Payload Len in 32bit words minus 2 */
61*05b00f60SXin Li 	nd_uint16_t	ah_reserved;	/* Reserved for future use */
62*05b00f60SXin Li 	nd_uint32_t	ah_spi;		/* Security Parameters Index */
63*05b00f60SXin Li 	nd_uint32_t	ah_seq;		/* Sequence Number Field */
64*05b00f60SXin Li 	/* variable size, 32bit bound*/	/* Integrity Check Value-ICV */
65*05b00f60SXin Li };
66*05b00f60SXin Li 
67*05b00f60SXin Li #endif /* ND_AH_H_ */
68