OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / klips / net / ipsec / ipsec_param.h
1 /*
2  * @(#) FreeSWAN tunable paramaters
3  *
4  * Copyright (C) 2001  Richard Guy Briggs  <rgb@freeswan.org>
5  *                 and Michael Richardson  <mcr@freeswan.org>
6  * 
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation; either version 2 of the License, or (at your
10  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
11  * 
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * for more details.
16  *
17  * RCSID $Id: ipsec_param.h,v 1.6 2002/01/29 02:11:42 mcr Exp $
18  *
19  */
20
21 /* 
22  * This file provides a set of #define's which may be tuned by various
23  * people/configurations. It keeps all compile-time tunables in one place.
24  *
25  * This file should be included before all other IPsec kernel-only files.
26  *
27  */
28
29 #ifndef _IPSEC_PARAM_H_
30
31 #include "ipsec_kversion.h"
32
33 #ifdef CONFIG_IPSEC_BIGGATE
34 #define SADB_HASHMOD   8069
35 #else
36 #define SADB_HASHMOD    257
37 #endif
38
39 #ifndef PROC_NO_DUMMY
40 #define IPSEC_PROC_LAST_ARG , int dummy
41 #else
42 #define IPSEC_PROC_LAST_ARG
43 #endif /* !PROC_NO_DUMMY */
44
45 #ifdef NETDEV_23
46
47 #define device net_device
48 #define ipsec_dev_get __dev_get_by_name
49
50 #else
51
52 #define ipsec_dev_get dev_get
53
54 #endif /* NETDEV_23 */
55
56 #ifndef PROC_FS_2325
57 #define IPSEC_PROCFS_DEBUG_NO_STATIC DEBUG_NO_STATIC
58 #else
59 #define IPSEC_PROCFS_DEBUG_NO_STATIC
60 #endif /* PROC_FS_2325 */
61
62 #if !defined(LINUX_KERNEL_HAS_SNPRINTF)
63 /* GNU CPP specific! */
64 #define snprintf(buf, len, fmt...) sprintf(buf, ##fmt)
65 #endif
66
67 #ifdef SPINLOCK
68  #ifdef SPINLOCK_23
69   #include <linux/spinlock.h> /* *lock* */
70  #else /* SPINLOCK_23 */
71   #include <asm/spinlock.h> /* *lock* */
72  #endif /* SPINLOCK_23 */
73 #endif /* SPINLOCK */
74
75 #ifndef KLIPS_FIXES_DES_PARITY
76 #define KLIPS_FIXES_DES_PARITY 1
77 #endif
78
79 #ifndef KLIPS_DIVULGE_CYPHER_KEY
80 #define KLIPS_DIVULGE_CYPHER_KEY 0
81 #endif
82
83 /* extra toggles for regression testing */
84 #ifdef CONFIG_IPSEC_REGRESS
85
86 /* 
87  * should pfkey_acquire() become 100% lossy?
88  *
89  */
90 extern int sysctl_ipsec_regress_pfkey_lossage;
91 #ifndef KLIPS_PFKEY_ACQUIRE_LOSSAGE
92 #ifdef CONFIG_IPSEC_PFKEY_ACQUIRE_LOSSAGE
93 #define KLIPS_PFKEY_ACQUIRE_LOSSAGE 100
94 #else
95 /* not by default! */
96 #define KLIPS_PFKEY_ACQUIRE_LOSSAGE 0
97 #endif
98 #endif
99
100 #endif
101
102 /* IP_FRAGMENT_LINEARIZE is set in freeswan.h if Kernel > 2.4.4 */
103 #ifndef IP_FRAGMENT_LINEARIZE
104 #define IP_FRAGMENT_LINEARIZE 0
105 #endif
106
107 #define _IPSEC_PARAM_H_
108 #endif
109
110 /*
111  * $Log: ipsec_param.h,v $
112  * Revision 1.6  2002/01/29 02:11:42  mcr
113  *      removal of kversions.h - sources that needed it now use ipsec_param.h.
114  *      updating of IPv6 structures to match latest in6.h version.
115  *      removed dead code from freeswan.h that also duplicated kversions.h
116  *      code.
117  *
118  * Revision 1.5  2002/01/28 19:22:01  mcr
119  *      by default, turn off LINEARIZE option
120  *      (let kversions.h turn it on)
121  *
122  * Revision 1.4  2002/01/20 20:19:36  mcr
123  *      renamed option to IP_FRAGMENT_LINEARIZE.
124  *
125  * Revision 1.3  2002/01/12 02:57:25  mcr
126  *      first regression test causes acquire messages to be lost
127  *      100% of the time. This is to help testing of pluto.
128  *
129  * Revision 1.2  2001/11/26 09:16:14  rgb
130  * Merge MCR's ipsec_sa, eroute, proc and struct lifetime changes.
131  *
132  * Revision 1.1.2.3  2001/10/23 04:40:16  mcr
133  *      added #define for DIVULGING session keys in debug output.
134  *
135  * Revision 1.1.2.2  2001/10/22 20:53:25  mcr
136  *      added a define to control forcing of DES parity.
137  *
138  * Revision 1.1.2.1  2001/09/25 02:20:19  mcr
139  *      many common kernel configuration questions centralized.
140  *      more things remain that should be moved from freeswan.h.
141  *
142  *
143  * Local variables:
144  * c-file-style: "linux"
145  * End:
146  *
147  */