From 9293ff427cf29f40bceb0af53e71e6fe0dd33b21 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 10 May 2006 13:18:28 +0000 Subject: --- src/libfreeswan/freeswan/pfkey_v2_ext_bits.c | 803 +++++++++++++++++++++++++++ 1 file changed, 803 insertions(+) create mode 100644 src/libfreeswan/freeswan/pfkey_v2_ext_bits.c (limited to 'src/libfreeswan/freeswan/pfkey_v2_ext_bits.c') diff --git a/src/libfreeswan/freeswan/pfkey_v2_ext_bits.c b/src/libfreeswan/freeswan/pfkey_v2_ext_bits.c new file mode 100644 index 000000000..fe3f45306 --- /dev/null +++ b/src/libfreeswan/freeswan/pfkey_v2_ext_bits.c @@ -0,0 +1,803 @@ +/* + * RFC2367 PF_KEYv2 Key management API message parser + * Copyright (C) 1999, 2000, 2001 Richard Guy Briggs. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. See . + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * RCSID $Id: pfkey_v2_ext_bits.c,v 1.2 2004/03/22 21:53:18 as Exp $ + */ + +/* + * Template from klips/net/ipsec/ipsec/ipsec_parse.c. + */ + +char pfkey_v2_ext_bits_c_version[] = "$Id: pfkey_v2_ext_bits.c,v 1.2 2004/03/22 21:53:18 as Exp $"; + +/* + * Some ugly stuff to allow consistent debugging code for use in the + * kernel and in user space +*/ + +#ifdef __KERNEL__ + +# include /* for printk */ + +# include "freeswan/ipsec_kversion.h" /* for malloc switch */ +# ifdef MALLOC_SLAB +# include /* kmalloc() */ +# else /* MALLOC_SLAB */ +# include /* kmalloc() */ +# endif /* MALLOC_SLAB */ +# include /* error codes */ +# include /* size_t */ +# include /* mark_bh */ + +# include /* struct device, and other headers */ +# include /* eth_type_trans */ +# include /* struct iphdr */ +# if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +# include +# endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ + +#else /* __KERNEL__ */ + +# include +# include +# include +#endif + +#include +#include +#include + +unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/] = { + +/* INBOUND EXTENSIONS */ +{ + +/* PERMITTED IN */ +{ +/* SADB_RESERVED */ +0 +, +/* SADB_GETSPI */ +1<