/* * Common routines for IPSEC transformations. * Copyright (C) 1996, 1997 John Ioannidis. * Copyright (C) 1998, 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: ipsec_xform.c,v 1.2 2004/06/13 19:57:50 as Exp $ */ #include #include #include /* printk() */ #include "freeswan/ipsec_param.h" #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 */ #include #include /* get_random_bytes() */ #include #ifdef SPINLOCK # ifdef SPINLOCK_23 # include /* *lock* */ # else /* SPINLOCK_23 */ # include /* *lock* */ # endif /* SPINLOCK_23 */ #endif /* SPINLOCK */ #ifdef NET_21 # include # include #endif #include #include #include "freeswan/radij.h" #include "freeswan/ipsec_encap.h" #include "freeswan/ipsec_radij.h" #include "freeswan/ipsec_xform.h" #include "freeswan/ipsec_ipe4.h" #include "freeswan/ipsec_ah.h" #include "freeswan/ipsec_esp.h" #include #include #ifdef CONFIG_IPSEC_DEBUG int debug_xform = 0; #endif /* CONFIG_IPSEC_DEBUG */ #ifdef SPINLOCK spinlock_t tdb_lock = SPIN_LOCK_UNLOCKED; #else /* SPINLOCK */ spinlock_t tdb_lock; #endif /* SPINLOCK */