xref: /titanic_41/usr/src/uts/common/inet/ipsecah.h (revision 25cf1a301a396c38e8adf52c15f537b80d2483f7)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1998-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_INET_IPSECAH_H
28 #define	_INET_IPSECAH_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #ifdef _KERNEL
37 /* Named Dispatch Parameter Management Structure */
38 typedef struct ipsecahpparam_s {
39 	uint_t	ipsecah_param_min;
40 	uint_t	ipsecah_param_max;
41 	uint_t	ipsecah_param_value;
42 	char	*ipsecah_param_name;
43 } ipsecahparam_t;
44 
45 #endif	/* _KERNEL */
46 
47 /*
48  * For now, only provide "aligned" version of header.
49  * If aligned version is needed, we'll go with the naming conventions then.
50  */
51 
52 typedef struct ah {
53 	uint8_t ah_nexthdr;
54 	uint8_t ah_length;
55 	uint16_t ah_reserved;
56 	uint32_t ah_spi;
57 	uint32_t ah_replay;
58 } ah_t;
59 
60 #define	AH_BASELEN	12
61 #define	AH_TOTAL_LEN(ah)	(((ah)->ah_length << 2) + AH_BASELEN - \
62 					sizeof ((ah)->ah_replay))
63 
64 /* "Old" AH, without replay.  For 1827-29 compatibility. */
65 
66 typedef struct ahold {
67 	uint8_t ah_nexthdr;
68 	uint8_t ah_length;
69 	uint16_t ah_reserved;
70 	uint32_t ah_spi;
71 } ahold_t;
72 
73 #define	AHOLD_BASELEN	8
74 #define	AHOLD_TOTAL_LEN(ah)	(((ah)->ah_length << 2) + AH_BASELEN)
75 
76 #ifdef	__cplusplus
77 }
78 #endif
79 
80 #endif /* _INET_IPSECAH_H */
81