removed NAT_TRAVERSAL compile option
[strongswan.git] / src / libfreeswan / pfkey_v2_ext_bits.c
1 /*
2 * RFC2367 PF_KEYv2 Key management API message parser
3 * Copyright (C) 1999, 2000, 2001 Richard Guy Briggs.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * RCSID $Id: pfkey_v2_ext_bits.c,v 1.2 2004/03/22 21:53:18 as Exp $
16 */
17
18 /*
19 * Template from klips/net/ipsec/ipsec/ipsec_parse.c.
20 */
21
22 char pfkey_v2_ext_bits_c_version[] = "$Id: pfkey_v2_ext_bits.c,v 1.2 2004/03/22 21:53:18 as Exp $";
23
24 /*
25 * Some ugly stuff to allow consistent debugging code for use in the
26 * kernel and in user space
27 */
28
29 #ifdef __KERNEL__
30
31 # include <linux/kernel.h> /* for printk */
32
33 # include "freeswan/ipsec_kversion.h" /* for malloc switch */
34 # ifdef MALLOC_SLAB
35 # include <linux/slab.h> /* kmalloc() */
36 # else /* MALLOC_SLAB */
37 # include <linux/malloc.h> /* kmalloc() */
38 # endif /* MALLOC_SLAB */
39 # include <linux/errno.h> /* error codes */
40 # include <linux/types.h> /* size_t */
41 # include <linux/interrupt.h> /* mark_bh */
42
43 # include <linux/netdevice.h> /* struct device, and other headers */
44 # include <linux/etherdevice.h> /* eth_type_trans */
45 # include <linux/ip.h> /* struct iphdr */
46 # if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
47 # include <linux/ipv6.h>
48 # endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
49
50 #else /* __KERNEL__ */
51
52 # include <sys/types.h>
53 # include <linux/types.h>
54 # include <linux/errno.h>
55 #endif
56
57 #include <freeswan.h>
58 #include <pfkeyv2.h>
59 #include <pfkey.h>
60
61 unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/] = {
62
63 /* INBOUND EXTENSIONS */
64 {
65
66 /* PERMITTED IN */
67 {
68 /* SADB_RESERVED */
69 0
70 ,
71 /* SADB_GETSPI */
72 1<<SADB_EXT_RESERVED
73 | 1<<SADB_EXT_ADDRESS_SRC
74 | 1<<SADB_EXT_ADDRESS_DST
75 | 1<<SADB_EXT_ADDRESS_PROXY
76 | 1<<SADB_EXT_SPIRANGE
77 ,
78 /* SADB_UPDATE */
79 1<<SADB_EXT_RESERVED
80 | 1<<SADB_EXT_SA
81 | 1<<SADB_EXT_LIFETIME_CURRENT
82 | 1<<SADB_EXT_LIFETIME_HARD
83 | 1<<SADB_EXT_LIFETIME_SOFT
84 | 1<<SADB_EXT_ADDRESS_SRC
85 | 1<<SADB_EXT_ADDRESS_DST
86 | 1<<SADB_EXT_ADDRESS_PROXY
87 | 1<<SADB_EXT_KEY_AUTH
88 | 1<<SADB_EXT_KEY_ENCRYPT
89 | 1<<SADB_EXT_IDENTITY_SRC
90 | 1<<SADB_EXT_IDENTITY_DST
91 | 1<<SADB_EXT_SENSITIVITY
92 | 1<<SADB_X_EXT_NAT_T_SPORT
93 | 1<<SADB_X_EXT_NAT_T_DPORT
94 ,
95 /* SADB_ADD */
96 1<<SADB_EXT_RESERVED
97 | 1<<SADB_EXT_SA
98 | 1<<SADB_EXT_LIFETIME_HARD
99 | 1<<SADB_EXT_LIFETIME_SOFT
100 | 1<<SADB_EXT_ADDRESS_SRC
101 | 1<<SADB_EXT_ADDRESS_DST
102 | 1<<SADB_EXT_ADDRESS_PROXY
103 | 1<<SADB_EXT_KEY_AUTH
104 | 1<<SADB_EXT_KEY_ENCRYPT
105 | 1<<SADB_EXT_IDENTITY_SRC
106 | 1<<SADB_EXT_IDENTITY_DST
107 | 1<<SADB_EXT_SENSITIVITY
108 | 1<<SADB_X_EXT_NAT_T_TYPE
109 | 1<<SADB_X_EXT_NAT_T_SPORT
110 | 1<<SADB_X_EXT_NAT_T_DPORT
111 | 1<<SADB_X_EXT_NAT_T_OA
112 ,
113 /* SADB_DELETE */
114 1<<SADB_EXT_RESERVED
115 | 1<<SADB_EXT_SA
116 | 1<<SADB_EXT_ADDRESS_SRC
117 | 1<<SADB_EXT_ADDRESS_DST
118 ,
119 /* SADB_GET */
120 1<<SADB_EXT_RESERVED
121 | 1<<SADB_EXT_SA
122 | 1<<SADB_EXT_ADDRESS_SRC
123 | 1<<SADB_EXT_ADDRESS_DST
124 ,
125 /* SADB_ACQUIRE */
126 1<<SADB_EXT_RESERVED
127 | 1<<SADB_EXT_ADDRESS_SRC
128 | 1<<SADB_EXT_ADDRESS_DST
129 | 1<<SADB_EXT_ADDRESS_PROXY
130 | 1<<SADB_EXT_IDENTITY_SRC
131 | 1<<SADB_EXT_IDENTITY_DST
132 | 1<<SADB_EXT_SENSITIVITY
133 | 1<<SADB_EXT_PROPOSAL
134 ,
135 /* SADB_REGISTER */
136 1<<SADB_EXT_RESERVED
137 ,
138 /* SADB_EXPIRE */
139 0
140 ,
141 /* SADB_FLUSH */
142 1<<SADB_EXT_RESERVED
143 ,
144 /* SADB_DUMP */
145 1<<SADB_EXT_RESERVED
146 ,
147 /* SADB_X_PROMISC */
148 1<<SADB_EXT_RESERVED
149 | 1<<SADB_EXT_SA
150 | 1<<SADB_EXT_LIFETIME_CURRENT
151 | 1<<SADB_EXT_LIFETIME_HARD
152 | 1<<SADB_EXT_LIFETIME_SOFT
153 | 1<<SADB_EXT_ADDRESS_SRC
154 | 1<<SADB_EXT_ADDRESS_DST
155 | 1<<SADB_EXT_ADDRESS_PROXY
156 | 1<<SADB_EXT_KEY_AUTH
157 | 1<<SADB_EXT_KEY_ENCRYPT
158 | 1<<SADB_EXT_IDENTITY_SRC
159 | 1<<SADB_EXT_IDENTITY_DST
160 | 1<<SADB_EXT_SENSITIVITY
161 | 1<<SADB_EXT_PROPOSAL
162 | 1<<SADB_EXT_SUPPORTED_AUTH
163 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
164 | 1<<SADB_EXT_SPIRANGE
165 | 1<<SADB_X_EXT_KMPRIVATE
166 | 1<<SADB_X_EXT_SATYPE2
167 | 1<<SADB_X_EXT_SA2
168 | 1<<SADB_X_EXT_ADDRESS_DST2
169 ,
170 /* SADB_X_PCHANGE */
171 1<<SADB_EXT_RESERVED
172 | 1<<SADB_EXT_SA
173 | 1<<SADB_EXT_LIFETIME_CURRENT
174 | 1<<SADB_EXT_LIFETIME_HARD
175 | 1<<SADB_EXT_LIFETIME_SOFT
176 | 1<<SADB_EXT_ADDRESS_SRC
177 | 1<<SADB_EXT_ADDRESS_DST
178 | 1<<SADB_EXT_ADDRESS_PROXY
179 | 1<<SADB_EXT_KEY_AUTH
180 | 1<<SADB_EXT_KEY_ENCRYPT
181 | 1<<SADB_EXT_IDENTITY_SRC
182 | 1<<SADB_EXT_IDENTITY_DST
183 | 1<<SADB_EXT_SENSITIVITY
184 | 1<<SADB_EXT_PROPOSAL
185 | 1<<SADB_EXT_SUPPORTED_AUTH
186 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
187 | 1<<SADB_EXT_SPIRANGE
188 | 1<<SADB_X_EXT_KMPRIVATE
189 | 1<<SADB_X_EXT_SATYPE2
190 | 1<<SADB_X_EXT_SA2
191 | 1<<SADB_X_EXT_ADDRESS_DST2
192 ,
193 /* SADB_X_GRPSA */
194 1<<SADB_EXT_RESERVED
195 | 1<<SADB_EXT_SA
196 | 1<<SADB_EXT_ADDRESS_DST
197 | 1<<SADB_X_EXT_SATYPE2
198 | 1<<SADB_X_EXT_SA2
199 | 1<<SADB_X_EXT_ADDRESS_DST2
200 ,
201 /* SADB_X_ADDFLOW */
202 1<<SADB_EXT_RESERVED
203 | 1<<SADB_EXT_SA
204 | 1<<SADB_EXT_ADDRESS_SRC
205 | 1<<SADB_EXT_ADDRESS_DST
206 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
207 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
208 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
209 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
210 | 1<<SADB_EXT_IDENTITY_SRC
211 | 1<<SADB_EXT_IDENTITY_DST
212 | 1<<SADB_X_EXT_PROTOCOL
213 ,
214 /* SADB_X_DELFLOW */
215 1<<SADB_EXT_RESERVED
216 | 1<<SADB_EXT_SA
217 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
218 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
219 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
220 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
221 | 1<<SADB_EXT_IDENTITY_SRC
222 | 1<<SADB_EXT_IDENTITY_DST
223 | 1<<SADB_X_EXT_PROTOCOL
224 ,
225 /* SADB_X_DEBUG */
226 1<<SADB_EXT_RESERVED
227 | 1<<SADB_X_EXT_DEBUG
228 ,
229 /* SADB_X_NAT_T_NEW_MAPPING */
230 1<<SADB_EXT_RESERVED
231 | 1<<SADB_EXT_SA
232 | 1<<SADB_EXT_ADDRESS_SRC
233 | 1<<SADB_EXT_ADDRESS_DST
234 | 1<<SADB_X_EXT_NAT_T_SPORT
235 | 1<<SADB_X_EXT_NAT_T_DPORT
236 },
237
238 /* REQUIRED IN */
239 {
240 /* SADB_RESERVED */
241 0
242 ,
243 /* SADB_GETSPI */
244 1<<SADB_EXT_RESERVED
245 | 1<<SADB_EXT_ADDRESS_SRC
246 | 1<<SADB_EXT_ADDRESS_DST
247 | 1<<SADB_EXT_SPIRANGE
248 ,
249 /* SADB_UPDATE */
250 1<<SADB_EXT_RESERVED
251 | 1<<SADB_EXT_SA
252 | 1<<SADB_EXT_ADDRESS_SRC
253 | 1<<SADB_EXT_ADDRESS_DST
254 /*| 1<<SADB_EXT_KEY_AUTH*/
255 /*| 1<<SADB_EXT_KEY_ENCRYPT*/
256 ,
257 /* SADB_ADD */
258 1<<SADB_EXT_RESERVED
259 | 1<<SADB_EXT_SA
260 | 1<<SADB_EXT_ADDRESS_SRC
261 | 1<<SADB_EXT_ADDRESS_DST
262 /*| 1<<SADB_EXT_KEY_AUTH*/
263 /*| 1<<SADB_EXT_KEY_ENCRYPT*/
264 ,
265 /* SADB_DELETE */
266 1<<SADB_EXT_RESERVED
267 | 1<<SADB_EXT_SA
268 | 1<<SADB_EXT_ADDRESS_SRC
269 | 1<<SADB_EXT_ADDRESS_DST
270 ,
271 /* SADB_GET */
272 1<<SADB_EXT_RESERVED
273 | 1<<SADB_EXT_SA
274 | 1<<SADB_EXT_ADDRESS_SRC
275 | 1<<SADB_EXT_ADDRESS_DST
276 ,
277 /* SADB_ACQUIRE */
278 1<<SADB_EXT_RESERVED
279 | 1<<SADB_EXT_ADDRESS_SRC
280 | 1<<SADB_EXT_ADDRESS_DST
281 | 1<<SADB_EXT_PROPOSAL
282 ,
283 /* SADB_REGISTER */
284 1<<SADB_EXT_RESERVED
285 ,
286 /* SADB_EXPIRE */
287 0
288 ,
289 /* SADB_FLUSH */
290 1<<SADB_EXT_RESERVED
291 ,
292 /* SADB_DUMP */
293 1<<SADB_EXT_RESERVED
294 ,
295 /* SADB_X_PROMISC */
296 1<<SADB_EXT_RESERVED
297 | 1<<SADB_EXT_SA
298 | 1<<SADB_EXT_LIFETIME_CURRENT
299 | 1<<SADB_EXT_LIFETIME_HARD
300 | 1<<SADB_EXT_LIFETIME_SOFT
301 | 1<<SADB_EXT_ADDRESS_SRC
302 | 1<<SADB_EXT_ADDRESS_DST
303 | 1<<SADB_EXT_ADDRESS_PROXY
304 | 1<<SADB_EXT_KEY_AUTH
305 | 1<<SADB_EXT_KEY_ENCRYPT
306 | 1<<SADB_EXT_IDENTITY_SRC
307 | 1<<SADB_EXT_IDENTITY_DST
308 | 1<<SADB_EXT_SENSITIVITY
309 | 1<<SADB_EXT_PROPOSAL
310 | 1<<SADB_EXT_SUPPORTED_AUTH
311 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
312 | 1<<SADB_EXT_SPIRANGE
313 | 1<<SADB_X_EXT_KMPRIVATE
314 | 1<<SADB_X_EXT_SATYPE2
315 | 1<<SADB_X_EXT_SA2
316 | 1<<SADB_X_EXT_ADDRESS_DST2
317 ,
318 /* SADB_X_PCHANGE */
319 1<<SADB_EXT_RESERVED
320 | 1<<SADB_EXT_SA
321 | 1<<SADB_EXT_LIFETIME_CURRENT
322 | 1<<SADB_EXT_LIFETIME_HARD
323 | 1<<SADB_EXT_LIFETIME_SOFT
324 | 1<<SADB_EXT_ADDRESS_SRC
325 | 1<<SADB_EXT_ADDRESS_DST
326 | 1<<SADB_EXT_ADDRESS_PROXY
327 | 1<<SADB_EXT_KEY_AUTH
328 | 1<<SADB_EXT_KEY_ENCRYPT
329 | 1<<SADB_EXT_IDENTITY_SRC
330 | 1<<SADB_EXT_IDENTITY_DST
331 | 1<<SADB_EXT_SENSITIVITY
332 | 1<<SADB_EXT_PROPOSAL
333 | 1<<SADB_EXT_SUPPORTED_AUTH
334 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
335 | 1<<SADB_EXT_SPIRANGE
336 | 1<<SADB_X_EXT_KMPRIVATE
337 | 1<<SADB_X_EXT_SATYPE2
338 | 1<<SADB_X_EXT_SA2
339 | 1<<SADB_X_EXT_ADDRESS_DST2
340 ,
341 /* SADB_X_GRPSA */
342 1<<SADB_EXT_RESERVED
343 | 1<<SADB_EXT_SA
344 | 1<<SADB_EXT_ADDRESS_DST
345 /*| 1<<SADB_X_EXT_SATYPE2*/
346 /*| 1<<SADB_X_EXT_SA2*/
347 /*| 1<<SADB_X_EXT_ADDRESS_DST2*/
348 ,
349 /* SADB_X_ADDFLOW */
350 1<<SADB_EXT_RESERVED
351 | 1<<SADB_EXT_SA
352 | 1<<SADB_EXT_ADDRESS_DST
353 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
354 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
355 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
356 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
357 ,
358 /* SADB_X_DELFLOW */
359 1<<SADB_EXT_RESERVED
360 /*| 1<<SADB_EXT_SA*/
361 #if 0 /* SADB_X_CLREROUTE doesn't need all these... */
362 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
363 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
364 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
365 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
366 #endif
367 ,
368 /* SADB_X_DEBUG */
369 1<<SADB_EXT_RESERVED
370 | 1<<SADB_X_EXT_DEBUG
371 ,
372 /* SADB_X_NAT_T_NEW_MAPPING */
373 1<<SADB_EXT_RESERVED
374 | 1<<SADB_EXT_SA
375 | 1<<SADB_EXT_ADDRESS_SRC
376 | 1<<SADB_EXT_ADDRESS_DST
377 | 1<<SADB_X_EXT_NAT_T_SPORT
378 | 1<<SADB_X_EXT_NAT_T_DPORT
379 }
380
381 },
382
383 /* OUTBOUND EXTENSIONS */
384 {
385
386 /* PERMITTED OUT */
387 {
388 /* SADB_RESERVED */
389 0
390 ,
391 /* SADB_GETSPI */
392 1<<SADB_EXT_RESERVED
393 | 1<<SADB_EXT_SA
394 | 1<<SADB_EXT_ADDRESS_SRC
395 | 1<<SADB_EXT_ADDRESS_DST
396 ,
397 /* SADB_UPDATE */
398 1<<SADB_EXT_RESERVED
399 | 1<<SADB_EXT_SA
400 | 1<<SADB_EXT_LIFETIME_CURRENT
401 | 1<<SADB_EXT_LIFETIME_HARD
402 | 1<<SADB_EXT_LIFETIME_SOFT
403 | 1<<SADB_EXT_ADDRESS_SRC
404 | 1<<SADB_EXT_ADDRESS_DST
405 | 1<<SADB_EXT_ADDRESS_PROXY
406 | 1<<SADB_EXT_IDENTITY_SRC
407 | 1<<SADB_EXT_IDENTITY_DST
408 | 1<<SADB_EXT_SENSITIVITY
409 ,
410 /* SADB_ADD */
411 1<<SADB_EXT_RESERVED
412 | 1<<SADB_EXT_SA
413 | 1<<SADB_EXT_LIFETIME_HARD
414 | 1<<SADB_EXT_LIFETIME_SOFT
415 | 1<<SADB_EXT_ADDRESS_SRC
416 | 1<<SADB_EXT_ADDRESS_DST
417 | 1<<SADB_EXT_IDENTITY_SRC
418 | 1<<SADB_EXT_IDENTITY_DST
419 | 1<<SADB_EXT_SENSITIVITY
420 | 1<<SADB_X_EXT_NAT_T_TYPE
421 | 1<<SADB_X_EXT_NAT_T_SPORT
422 | 1<<SADB_X_EXT_NAT_T_DPORT
423 | 1<<SADB_X_EXT_NAT_T_OA
424 ,
425 /* SADB_DELETE */
426 1<<SADB_EXT_RESERVED
427 | 1<<SADB_EXT_SA
428 | 1<<SADB_EXT_ADDRESS_SRC
429 | 1<<SADB_EXT_ADDRESS_DST
430 ,
431 /* SADB_GET */
432 1<<SADB_EXT_RESERVED
433 | 1<<SADB_EXT_SA
434 | 1<<SADB_EXT_LIFETIME_CURRENT
435 | 1<<SADB_EXT_LIFETIME_HARD
436 | 1<<SADB_EXT_LIFETIME_SOFT
437 | 1<<SADB_EXT_ADDRESS_SRC
438 | 1<<SADB_EXT_ADDRESS_DST
439 | 1<<SADB_EXT_ADDRESS_PROXY
440 | 1<<SADB_EXT_KEY_AUTH
441 | 1<<SADB_EXT_KEY_ENCRYPT
442 | 1<<SADB_EXT_IDENTITY_SRC
443 | 1<<SADB_EXT_IDENTITY_DST
444 | 1<<SADB_EXT_SENSITIVITY
445 ,
446 /* SADB_ACQUIRE */
447 1<<SADB_EXT_RESERVED
448 | 1<<SADB_EXT_ADDRESS_SRC
449 | 1<<SADB_EXT_ADDRESS_DST
450 | 1<<SADB_EXT_ADDRESS_PROXY
451 | 1<<SADB_EXT_IDENTITY_SRC
452 | 1<<SADB_EXT_IDENTITY_DST
453 | 1<<SADB_EXT_SENSITIVITY
454 | 1<<SADB_EXT_PROPOSAL
455 ,
456 /* SADB_REGISTER */
457 1<<SADB_EXT_RESERVED
458 | 1<<SADB_EXT_SUPPORTED_AUTH
459 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
460 ,
461 /* SADB_EXPIRE */
462 1<<SADB_EXT_RESERVED
463 | 1<<SADB_EXT_SA
464 | 1<<SADB_EXT_LIFETIME_CURRENT
465 | 1<<SADB_EXT_LIFETIME_HARD
466 | 1<<SADB_EXT_LIFETIME_SOFT
467 | 1<<SADB_EXT_ADDRESS_SRC
468 | 1<<SADB_EXT_ADDRESS_DST
469 ,
470 /* SADB_FLUSH */
471 1<<SADB_EXT_RESERVED
472 ,
473 /* SADB_DUMP */
474 1<<SADB_EXT_RESERVED
475 | 1<<SADB_EXT_SA
476 | 1<<SADB_EXT_LIFETIME_CURRENT
477 | 1<<SADB_EXT_LIFETIME_HARD
478 | 1<<SADB_EXT_LIFETIME_SOFT
479 | 1<<SADB_EXT_ADDRESS_SRC
480 | 1<<SADB_EXT_ADDRESS_DST
481 | 1<<SADB_EXT_ADDRESS_PROXY
482 | 1<<SADB_EXT_KEY_AUTH
483 | 1<<SADB_EXT_KEY_ENCRYPT
484 | 1<<SADB_EXT_IDENTITY_SRC
485 | 1<<SADB_EXT_IDENTITY_DST
486 | 1<<SADB_EXT_SENSITIVITY
487 ,
488 /* SADB_X_PROMISC */
489 1<<SADB_EXT_RESERVED
490 | 1<<SADB_EXT_SA
491 | 1<<SADB_EXT_LIFETIME_CURRENT
492 | 1<<SADB_EXT_LIFETIME_HARD
493 | 1<<SADB_EXT_LIFETIME_SOFT
494 | 1<<SADB_EXT_ADDRESS_SRC
495 | 1<<SADB_EXT_ADDRESS_DST
496 | 1<<SADB_EXT_ADDRESS_PROXY
497 | 1<<SADB_EXT_KEY_AUTH
498 | 1<<SADB_EXT_KEY_ENCRYPT
499 | 1<<SADB_EXT_IDENTITY_SRC
500 | 1<<SADB_EXT_IDENTITY_DST
501 | 1<<SADB_EXT_SENSITIVITY
502 | 1<<SADB_EXT_PROPOSAL
503 | 1<<SADB_EXT_SUPPORTED_AUTH
504 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
505 | 1<<SADB_EXT_SPIRANGE
506 | 1<<SADB_X_EXT_KMPRIVATE
507 | 1<<SADB_X_EXT_SATYPE2
508 | 1<<SADB_X_EXT_SA2
509 | 1<<SADB_X_EXT_ADDRESS_DST2
510 ,
511 /* SADB_X_PCHANGE */
512 1<<SADB_EXT_RESERVED
513 | 1<<SADB_EXT_SA
514 | 1<<SADB_EXT_LIFETIME_CURRENT
515 | 1<<SADB_EXT_LIFETIME_HARD
516 | 1<<SADB_EXT_LIFETIME_SOFT
517 | 1<<SADB_EXT_ADDRESS_SRC
518 | 1<<SADB_EXT_ADDRESS_DST
519 | 1<<SADB_EXT_ADDRESS_PROXY
520 | 1<<SADB_EXT_KEY_AUTH
521 | 1<<SADB_EXT_KEY_ENCRYPT
522 | 1<<SADB_EXT_IDENTITY_SRC
523 | 1<<SADB_EXT_IDENTITY_DST
524 | 1<<SADB_EXT_SENSITIVITY
525 | 1<<SADB_EXT_PROPOSAL
526 | 1<<SADB_EXT_SUPPORTED_AUTH
527 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
528 | 1<<SADB_EXT_SPIRANGE
529 | 1<<SADB_X_EXT_KMPRIVATE
530 | 1<<SADB_X_EXT_SATYPE2
531 | 1<<SADB_X_EXT_SA2
532 | 1<<SADB_X_EXT_ADDRESS_DST2
533 ,
534 /* SADB_X_GRPSA */
535 1<<SADB_EXT_RESERVED
536 | 1<<SADB_EXT_SA
537 | 1<<SADB_EXT_ADDRESS_DST
538 | 1<<SADB_X_EXT_SATYPE2
539 | 1<<SADB_X_EXT_SA2
540 | 1<<SADB_X_EXT_ADDRESS_DST2
541 ,
542 /* SADB_X_ADDFLOW */
543 1<<SADB_EXT_RESERVED
544 | 1<<SADB_EXT_SA
545 | 1<<SADB_EXT_ADDRESS_SRC
546 | 1<<SADB_EXT_ADDRESS_DST
547 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
548 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
549 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
550 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
551 | 1<<SADB_X_EXT_PROTOCOL
552 ,
553 /* SADB_X_DELFLOW */
554 1<<SADB_EXT_RESERVED
555 | 1<<SADB_EXT_SA
556 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
557 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
558 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
559 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
560 | 1<<SADB_X_EXT_PROTOCOL
561 ,
562 /* SADB_X_DEBUG */
563 1<<SADB_EXT_RESERVED
564 | 1<<SADB_X_EXT_DEBUG
565 ,
566 /* SADB_X_NAT_T_NEW_MAPPING */
567 1<<SADB_EXT_RESERVED
568 | 1<<SADB_EXT_SA
569 | 1<<SADB_EXT_ADDRESS_SRC
570 | 1<<SADB_EXT_ADDRESS_DST
571 | 1<<SADB_X_EXT_NAT_T_SPORT
572 | 1<<SADB_X_EXT_NAT_T_DPORT
573 },
574
575 /* REQUIRED OUT */
576 {
577 /* SADB_RESERVED */
578 0
579 ,
580 /* SADB_GETSPI */
581 1<<SADB_EXT_RESERVED
582 | 1<<SADB_EXT_SA
583 | 1<<SADB_EXT_ADDRESS_SRC
584 | 1<<SADB_EXT_ADDRESS_DST
585 ,
586 /* SADB_UPDATE */
587 1<<SADB_EXT_RESERVED
588 | 1<<SADB_EXT_SA
589 | 1<<SADB_EXT_ADDRESS_SRC
590 | 1<<SADB_EXT_ADDRESS_DST
591 ,
592 /* SADB_ADD */
593 1<<SADB_EXT_RESERVED
594 | 1<<SADB_EXT_SA
595 | 1<<SADB_EXT_ADDRESS_SRC
596 | 1<<SADB_EXT_ADDRESS_DST
597 ,
598 /* SADB_DELETE */
599 1<<SADB_EXT_RESERVED
600 | 1<<SADB_EXT_SA
601 | 1<<SADB_EXT_ADDRESS_SRC
602 | 1<<SADB_EXT_ADDRESS_DST
603 ,
604 /* SADB_GET */
605 1<<SADB_EXT_RESERVED
606 | 1<<SADB_EXT_SA
607 | 1<<SADB_EXT_ADDRESS_SRC
608 | 1<<SADB_EXT_ADDRESS_DST
609 /* | 1<<SADB_EXT_KEY_AUTH */
610 /* | 1<<SADB_EXT_KEY_ENCRYPT */
611 ,
612 /* SADB_ACQUIRE */
613 1<<SADB_EXT_RESERVED
614 | 1<<SADB_EXT_ADDRESS_SRC
615 | 1<<SADB_EXT_ADDRESS_DST
616 | 1<<SADB_EXT_PROPOSAL
617 ,
618 /* SADB_REGISTER */
619 1<<SADB_EXT_RESERVED
620 /* | 1<<SADB_EXT_SUPPORTED_AUTH
621 | 1<<SADB_EXT_SUPPORTED_ENCRYPT */
622 ,
623 /* SADB_EXPIRE */
624 1<<SADB_EXT_RESERVED
625 | 1<<SADB_EXT_SA
626 | 1<<SADB_EXT_LIFETIME_CURRENT
627 /* | 1<<SADB_EXT_LIFETIME_HARD
628 | 1<<SADB_EXT_LIFETIME_SOFT */
629 | 1<<SADB_EXT_ADDRESS_SRC
630 | 1<<SADB_EXT_ADDRESS_DST
631 ,
632 /* SADB_FLUSH */
633 1<<SADB_EXT_RESERVED
634 ,
635 /* SADB_DUMP */
636 1<<SADB_EXT_RESERVED
637 | 1<<SADB_EXT_SA
638 | 1<<SADB_EXT_ADDRESS_SRC
639 | 1<<SADB_EXT_ADDRESS_DST
640 | 1<<SADB_EXT_KEY_AUTH
641 | 1<<SADB_EXT_KEY_ENCRYPT
642 ,
643 /* SADB_X_PROMISC */
644 1<<SADB_EXT_RESERVED
645 | 1<<SADB_EXT_SA
646 | 1<<SADB_EXT_LIFETIME_CURRENT
647 | 1<<SADB_EXT_LIFETIME_HARD
648 | 1<<SADB_EXT_LIFETIME_SOFT
649 | 1<<SADB_EXT_ADDRESS_SRC
650 | 1<<SADB_EXT_ADDRESS_DST
651 | 1<<SADB_EXT_ADDRESS_PROXY
652 | 1<<SADB_EXT_KEY_AUTH
653 | 1<<SADB_EXT_KEY_ENCRYPT
654 | 1<<SADB_EXT_IDENTITY_SRC
655 | 1<<SADB_EXT_IDENTITY_DST
656 | 1<<SADB_EXT_SENSITIVITY
657 | 1<<SADB_EXT_PROPOSAL
658 | 1<<SADB_EXT_SUPPORTED_AUTH
659 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
660 | 1<<SADB_EXT_SPIRANGE
661 | 1<<SADB_X_EXT_KMPRIVATE
662 | 1<<SADB_X_EXT_SATYPE2
663 | 1<<SADB_X_EXT_SA2
664 | 1<<SADB_X_EXT_ADDRESS_DST2
665 ,
666 /* SADB_X_PCHANGE */
667 1<<SADB_EXT_RESERVED
668 | 1<<SADB_EXT_SA
669 | 1<<SADB_EXT_LIFETIME_CURRENT
670 | 1<<SADB_EXT_LIFETIME_HARD
671 | 1<<SADB_EXT_LIFETIME_SOFT
672 | 1<<SADB_EXT_ADDRESS_SRC
673 | 1<<SADB_EXT_ADDRESS_DST
674 | 1<<SADB_EXT_ADDRESS_PROXY
675 | 1<<SADB_EXT_KEY_AUTH
676 | 1<<SADB_EXT_KEY_ENCRYPT
677 | 1<<SADB_EXT_IDENTITY_SRC
678 | 1<<SADB_EXT_IDENTITY_DST
679 | 1<<SADB_EXT_SENSITIVITY
680 | 1<<SADB_EXT_PROPOSAL
681 | 1<<SADB_EXT_SUPPORTED_AUTH
682 | 1<<SADB_EXT_SUPPORTED_ENCRYPT
683 | 1<<SADB_EXT_SPIRANGE
684 | 1<<SADB_X_EXT_KMPRIVATE
685 | 1<<SADB_X_EXT_SATYPE2
686 | 1<<SADB_X_EXT_SA2
687 | 1<<SADB_X_EXT_ADDRESS_DST2
688 ,
689 /* SADB_X_GRPSA */
690 1<<SADB_EXT_RESERVED
691 | 1<<SADB_EXT_SA
692 | 1<<SADB_EXT_ADDRESS_DST
693 ,
694 /* SADB_X_ADDFLOW */
695 1<<SADB_EXT_RESERVED
696 | 1<<SADB_EXT_SA
697 | 1<<SADB_EXT_ADDRESS_DST
698 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
699 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
700 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
701 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
702 ,
703 /* SADB_X_DELFLOW */
704 1<<SADB_EXT_RESERVED
705 /*| 1<<SADB_EXT_SA*/
706 | 1<<SADB_X_EXT_ADDRESS_SRC_FLOW
707 | 1<<SADB_X_EXT_ADDRESS_DST_FLOW
708 | 1<<SADB_X_EXT_ADDRESS_SRC_MASK
709 | 1<<SADB_X_EXT_ADDRESS_DST_MASK
710 ,
711 /* SADB_X_DEBUG */
712 1<<SADB_EXT_RESERVED
713 | 1<<SADB_X_EXT_DEBUG
714 ,
715 /* SADB_X_NAT_T_NEW_MAPPING */
716 1<<SADB_EXT_RESERVED
717 | 1<<SADB_EXT_SA
718 | 1<<SADB_EXT_ADDRESS_SRC
719 | 1<<SADB_EXT_ADDRESS_DST
720 | 1<<SADB_X_EXT_NAT_T_SPORT
721 | 1<<SADB_X_EXT_NAT_T_DPORT
722 }
723 }
724 };
725
726 /*
727 * $Log: pfkey_v2_ext_bits.c,v $
728 * Revision 1.2 2004/03/22 21:53:18 as
729 * merged alg-0.8.1 branch with HEAD
730 *
731 * Revision 1.1.2.1 2004/03/15 22:30:06 as
732 * nat-0.6c patch merged
733 *
734 * Revision 1.1 2004/03/15 20:35:26 as
735 * added files from freeswan-2.04-x509-1.5.3
736 *
737 * Revision 1.15 2002/04/24 07:55:32 mcr
738 * #include patches and Makefiles for post-reorg compilation.
739 *
740 * Revision 1.14 2002/04/24 07:36:40 mcr
741 * Moved from ./lib/pfkey_v2_ext_bits.c,v
742 *
743 * Revision 1.13 2002/01/29 22:25:36 rgb
744 * Re-add ipsec_kversion.h to keep MALLOC happy.
745 *
746 * Revision 1.12 2002/01/29 01:59:10 mcr
747 * removal of kversions.h - sources that needed it now use ipsec_param.h.
748 * updating of IPv6 structures to match latest in6.h version.
749 * removed dead code from freeswan.h that also duplicated kversions.h
750 * code.
751 *
752 * Revision 1.11 2001/10/18 04:45:24 rgb
753 * 2.4.9 kernel deprecates linux/malloc.h in favour of linux/slab.h,
754 * lib/freeswan.h version macros moved to lib/kversions.h.
755 * Other compiler directive cleanups.
756 *
757 * Revision 1.10 2001/09/08 21:13:35 rgb
758 * Added pfkey ident extension support for ISAKMPd. (NetCelo)
759 *
760 * Revision 1.9 2001/06/14 19:35:16 rgb
761 * Update copyright date.
762 *
763 * Revision 1.8 2001/03/26 23:07:36 rgb
764 * Remove requirement for auth and enc key from UPDATE.
765 *
766 * Revision 1.7 2000/09/12 22:35:37 rgb
767 * Restructured to remove unused extensions from CLEARFLOW messages.
768 *
769 * Revision 1.6 2000/09/09 06:39:01 rgb
770 * Added comments for clarity.
771 *
772 * Revision 1.5 2000/06/02 22:54:14 rgb
773 * Added Gerhard Gessler's struct sockaddr_storage mods for IPv6 support.
774 *
775 * Revision 1.4 2000/01/21 06:27:56 rgb
776 * Added address cases for eroute flows.
777 * Added comments for each message type.
778 * Added klipsdebug switching capability.
779 * Fixed GRPSA bitfields.
780 *
781 * Revision 1.3 1999/12/01 22:20:27 rgb
782 * Remove requirement for a proxy address in an incoming getspi message.
783 *
784 * Revision 1.2 1999/11/27 11:57:06 rgb
785 * Consolidated the 4 1-d extension bitmap arrays into one 4-d array.
786 * Add CVS log entry to bottom of file.
787 * Cleaned out unused bits.
788 *
789 */