ia64/xen-unstable

view tools/vnet/vnet-module/linux/pfkeyv2.h @ 8740:3d7ea7972b39

Update patches for linux 2.6.15.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Feb 02 17:16:00 2006 +0000 (2006-02-02)
parents 0a4b76b6b5a0
children
line source
1 /* PF_KEY user interface, this is defined by rfc2367 so
2 * do not make arbitrary modifications or else this header
3 * file will not be compliant.
4 */
6 #ifndef _LINUX_PFKEY2_H
7 #define _LINUX_PFKEY2_H
9 #include <linux/types.h>
11 #define PF_KEY_V2 2
12 #define PFKEYV2_REVISION 199806L
14 struct sadb_msg {
15 uint8_t sadb_msg_version;
16 uint8_t sadb_msg_type;
17 uint8_t sadb_msg_errno;
18 uint8_t sadb_msg_satype;
19 uint16_t sadb_msg_len;
20 uint16_t sadb_msg_reserved;
21 uint32_t sadb_msg_seq;
22 uint32_t sadb_msg_pid;
23 } __attribute__((packed));
24 /* sizeof(struct sadb_msg) == 16 */
26 struct sadb_ext {
27 uint16_t sadb_ext_len;
28 uint16_t sadb_ext_type;
29 } __attribute__((packed));
30 /* sizeof(struct sadb_ext) == 4 */
32 struct sadb_sa {
33 uint16_t sadb_sa_len;
34 uint16_t sadb_sa_exttype;
35 uint32_t sadb_sa_spi;
36 uint8_t sadb_sa_replay;
37 uint8_t sadb_sa_state;
38 uint8_t sadb_sa_auth;
39 uint8_t sadb_sa_encrypt;
40 uint32_t sadb_sa_flags;
41 } __attribute__((packed));
42 /* sizeof(struct sadb_sa) == 16 */
44 struct sadb_lifetime {
45 uint16_t sadb_lifetime_len;
46 uint16_t sadb_lifetime_exttype;
47 uint32_t sadb_lifetime_allocations;
48 uint64_t sadb_lifetime_bytes;
49 uint64_t sadb_lifetime_addtime;
50 uint64_t sadb_lifetime_usetime;
51 } __attribute__((packed));
52 /* sizeof(struct sadb_lifetime) == 32 */
54 struct sadb_address {
55 uint16_t sadb_address_len;
56 uint16_t sadb_address_exttype;
57 uint8_t sadb_address_proto;
58 uint8_t sadb_address_prefixlen;
59 uint16_t sadb_address_reserved;
60 } __attribute__((packed));
61 /* sizeof(struct sadb_address) == 8 */
63 struct sadb_key {
64 uint16_t sadb_key_len;
65 uint16_t sadb_key_exttype;
66 uint16_t sadb_key_bits;
67 uint16_t sadb_key_reserved;
68 } __attribute__((packed));
69 /* sizeof(struct sadb_key) == 8 */
71 struct sadb_ident {
72 uint16_t sadb_ident_len;
73 uint16_t sadb_ident_exttype;
74 uint16_t sadb_ident_type;
75 uint16_t sadb_ident_reserved;
76 uint64_t sadb_ident_id;
77 } __attribute__((packed));
78 /* sizeof(struct sadb_ident) == 16 */
80 struct sadb_sens {
81 uint16_t sadb_sens_len;
82 uint16_t sadb_sens_exttype;
83 uint32_t sadb_sens_dpd;
84 uint8_t sadb_sens_sens_level;
85 uint8_t sadb_sens_sens_len;
86 uint8_t sadb_sens_integ_level;
87 uint8_t sadb_sens_integ_len;
88 uint32_t sadb_sens_reserved;
89 } __attribute__((packed));
90 /* sizeof(struct sadb_sens) == 16 */
92 /* followed by:
93 uint64_t sadb_sens_bitmap[sens_len];
94 uint64_t sadb_integ_bitmap[integ_len]; */
96 struct sadb_prop {
97 uint16_t sadb_prop_len;
98 uint16_t sadb_prop_exttype;
99 uint8_t sadb_prop_replay;
100 uint8_t sadb_prop_reserved[3];
101 } __attribute__((packed));
102 /* sizeof(struct sadb_prop) == 8 */
104 /* followed by:
105 struct sadb_comb sadb_combs[(sadb_prop_len +
106 sizeof(uint64_t) - sizeof(struct sadb_prop)) /
107 sizeof(strut sadb_comb)]; */
109 struct sadb_comb {
110 uint8_t sadb_comb_auth;
111 uint8_t sadb_comb_encrypt;
112 uint16_t sadb_comb_flags;
113 uint16_t sadb_comb_auth_minbits;
114 uint16_t sadb_comb_auth_maxbits;
115 uint16_t sadb_comb_encrypt_minbits;
116 uint16_t sadb_comb_encrypt_maxbits;
117 uint32_t sadb_comb_reserved;
118 uint32_t sadb_comb_soft_allocations;
119 uint32_t sadb_comb_hard_allocations;
120 uint64_t sadb_comb_soft_bytes;
121 uint64_t sadb_comb_hard_bytes;
122 uint64_t sadb_comb_soft_addtime;
123 uint64_t sadb_comb_hard_addtime;
124 uint64_t sadb_comb_soft_usetime;
125 uint64_t sadb_comb_hard_usetime;
126 } __attribute__((packed));
127 /* sizeof(struct sadb_comb) == 72 */
129 struct sadb_supported {
130 uint16_t sadb_supported_len;
131 uint16_t sadb_supported_exttype;
132 uint32_t sadb_supported_reserved;
133 } __attribute__((packed));
134 /* sizeof(struct sadb_supported) == 8 */
136 /* followed by:
137 struct sadb_alg sadb_algs[(sadb_supported_len +
138 sizeof(uint64_t) - sizeof(struct sadb_supported)) /
139 sizeof(struct sadb_alg)]; */
141 struct sadb_alg {
142 uint8_t sadb_alg_id;
143 uint8_t sadb_alg_ivlen;
144 uint16_t sadb_alg_minbits;
145 uint16_t sadb_alg_maxbits;
146 uint16_t sadb_alg_reserved;
147 } __attribute__((packed));
148 /* sizeof(struct sadb_alg) == 8 */
150 struct sadb_spirange {
151 uint16_t sadb_spirange_len;
152 uint16_t sadb_spirange_exttype;
153 uint32_t sadb_spirange_min;
154 uint32_t sadb_spirange_max;
155 uint32_t sadb_spirange_reserved;
156 } __attribute__((packed));
157 /* sizeof(struct sadb_spirange) == 16 */
159 struct sadb_x_kmprivate {
160 uint16_t sadb_x_kmprivate_len;
161 uint16_t sadb_x_kmprivate_exttype;
162 u_int32_t sadb_x_kmprivate_reserved;
163 } __attribute__((packed));
164 /* sizeof(struct sadb_x_kmprivate) == 8 */
166 struct sadb_x_sa2 {
167 uint16_t sadb_x_sa2_len;
168 uint16_t sadb_x_sa2_exttype;
169 uint8_t sadb_x_sa2_mode;
170 uint8_t sadb_x_sa2_reserved1;
171 uint16_t sadb_x_sa2_reserved2;
172 uint32_t sadb_x_sa2_sequence;
173 uint32_t sadb_x_sa2_reqid;
174 } __attribute__((packed));
175 /* sizeof(struct sadb_x_sa2) == 16 */
177 struct sadb_x_policy {
178 uint16_t sadb_x_policy_len;
179 uint16_t sadb_x_policy_exttype;
180 uint16_t sadb_x_policy_type;
181 uint8_t sadb_x_policy_dir;
182 uint8_t sadb_x_policy_reserved;
183 uint32_t sadb_x_policy_id;
184 uint32_t sadb_x_policy_reserved2;
185 } __attribute__((packed));
186 /* sizeof(struct sadb_x_policy) == 16 */
188 struct sadb_x_ipsecrequest {
189 uint16_t sadb_x_ipsecrequest_len;
190 uint16_t sadb_x_ipsecrequest_proto;
191 uint8_t sadb_x_ipsecrequest_mode;
192 uint8_t sadb_x_ipsecrequest_level;
193 uint16_t sadb_x_ipsecrequest_reqid;
194 } __attribute__((packed));
195 /* sizeof(struct sadb_x_ipsecrequest) == 16 */
197 /* This defines the TYPE of Nat Traversal in use. Currently only one
198 * type of NAT-T is supported, draft-ietf-ipsec-udp-encaps-06
199 */
200 struct sadb_x_nat_t_type {
201 uint16_t sadb_x_nat_t_type_len;
202 uint16_t sadb_x_nat_t_type_exttype;
203 uint8_t sadb_x_nat_t_type_type;
204 uint8_t sadb_x_nat_t_type_reserved[3];
205 } __attribute__((packed));
206 /* sizeof(struct sadb_x_nat_t_type) == 8 */
208 /* Pass a NAT Traversal port (Source or Dest port) */
209 struct sadb_x_nat_t_port {
210 uint16_t sadb_x_nat_t_port_len;
211 uint16_t sadb_x_nat_t_port_exttype;
212 uint16_t sadb_x_nat_t_port_port;
213 uint16_t sadb_x_nat_t_port_reserved;
214 } __attribute__((packed));
215 /* sizeof(struct sadb_x_nat_t_port) == 8 */
217 /* Message types */
218 #define SADB_RESERVED 0
219 #define SADB_GETSPI 1
220 #define SADB_UPDATE 2
221 #define SADB_ADD 3
222 #define SADB_DELETE 4
223 #define SADB_GET 5
224 #define SADB_ACQUIRE 6
225 #define SADB_REGISTER 7
226 #define SADB_EXPIRE 8
227 #define SADB_FLUSH 9
228 #define SADB_DUMP 10
229 #define SADB_X_PROMISC 11
230 #define SADB_X_PCHANGE 12
231 #define SADB_X_SPDUPDATE 13
232 #define SADB_X_SPDADD 14
233 #define SADB_X_SPDDELETE 15
234 #define SADB_X_SPDGET 16
235 #define SADB_X_SPDACQUIRE 17
236 #define SADB_X_SPDDUMP 18
237 #define SADB_X_SPDFLUSH 19
238 #define SADB_X_SPDSETIDX 20
239 #define SADB_X_SPDEXPIRE 21
240 #define SADB_X_SPDDELETE2 22
241 #define SADB_X_NAT_T_NEW_MAPPING 23
242 #define SADB_MAX 23
244 /* Security Association flags */
245 #define SADB_SAFLAGS_PFS 1
247 /* Security Association states */
248 #define SADB_SASTATE_LARVAL 0
249 #define SADB_SASTATE_MATURE 1
250 #define SADB_SASTATE_DYING 2
251 #define SADB_SASTATE_DEAD 3
252 #define SADB_SASTATE_MAX 3
254 /* Security Association types */
255 #define SADB_SATYPE_UNSPEC 0
256 #define SADB_SATYPE_AH 2
257 #define SADB_SATYPE_ESP 3
258 #define SADB_SATYPE_RSVP 5
259 #define SADB_SATYPE_OSPFV2 6
260 #define SADB_SATYPE_RIPV2 7
261 #define SADB_SATYPE_MIP 8
262 #define SADB_X_SATYPE_IPCOMP 9
263 #define SADB_SATYPE_MAX 9
265 /* Authentication algorithms */
266 #define SADB_AALG_NONE 0
267 #define SADB_AALG_MD5HMAC 2
268 #define SADB_AALG_SHA1HMAC 3
269 #define SADB_X_AALG_SHA2_256HMAC 5
270 #define SADB_X_AALG_SHA2_384HMAC 6
271 #define SADB_X_AALG_SHA2_512HMAC 7
272 #define SADB_X_AALG_RIPEMD160HMAC 8
273 #define SADB_X_AALG_NULL 251 /* kame */
274 #define SADB_AALG_MAX 251
276 /* Encryption algorithms */
277 #define SADB_EALG_NONE 0
278 #define SADB_EALG_DESCBC 2
279 #define SADB_EALG_3DESCBC 3
280 #define SADB_X_EALG_CASTCBC 6
281 #define SADB_X_EALG_BLOWFISHCBC 7
282 #define SADB_EALG_NULL 11
283 #define SADB_X_EALG_AESCBC 12
284 #define SADB_EALG_MAX 12
286 /* Compression algorithms */
287 #define SADB_X_CALG_NONE 0
288 #define SADB_X_CALG_OUI 1
289 #define SADB_X_CALG_DEFLATE 2
290 #define SADB_X_CALG_LZS 3
291 #define SADB_X_CALG_LZJH 4
292 #define SADB_X_CALG_MAX 4
294 /* Extension Header values */
295 #define SADB_EXT_RESERVED 0
296 #define SADB_EXT_SA 1
297 #define SADB_EXT_LIFETIME_CURRENT 2
298 #define SADB_EXT_LIFETIME_HARD 3
299 #define SADB_EXT_LIFETIME_SOFT 4
300 #define SADB_EXT_ADDRESS_SRC 5
301 #define SADB_EXT_ADDRESS_DST 6
302 #define SADB_EXT_ADDRESS_PROXY 7
303 #define SADB_EXT_KEY_AUTH 8
304 #define SADB_EXT_KEY_ENCRYPT 9
305 #define SADB_EXT_IDENTITY_SRC 10
306 #define SADB_EXT_IDENTITY_DST 11
307 #define SADB_EXT_SENSITIVITY 12
308 #define SADB_EXT_PROPOSAL 13
309 #define SADB_EXT_SUPPORTED_AUTH 14
310 #define SADB_EXT_SUPPORTED_ENCRYPT 15
311 #define SADB_EXT_SPIRANGE 16
312 #define SADB_X_EXT_KMPRIVATE 17
313 #define SADB_X_EXT_POLICY 18
314 #define SADB_X_EXT_SA2 19
315 /* The next four entries are for setting up NAT Traversal */
316 #define SADB_X_EXT_NAT_T_TYPE 20
317 #define SADB_X_EXT_NAT_T_SPORT 21
318 #define SADB_X_EXT_NAT_T_DPORT 22
319 #define SADB_X_EXT_NAT_T_OA 23
320 #define SADB_EXT_MAX 23
322 /* Identity Extension values */
323 #define SADB_IDENTTYPE_RESERVED 0
324 #define SADB_IDENTTYPE_PREFIX 1
325 #define SADB_IDENTTYPE_FQDN 2
326 #define SADB_IDENTTYPE_USERFQDN 3
327 #define SADB_IDENTTYPE_MAX 3
329 #endif /* !(_LINUX_PFKEY2_H) */