Alexey Dobriyan | d62ddc2 | 2008-11-25 17:14:31 -0800 | [diff] [blame] | 1 | #ifndef __NETNS_XFRM_H |
| 2 | #define __NETNS_XFRM_H |
| 3 | |
Alexey Dobriyan | 9d4139c | 2008-11-25 17:16:11 -0800 | [diff] [blame] | 4 | #include <linux/list.h> |
Alexey Dobriyan | 50a3065 | 2008-11-25 17:21:01 -0800 | [diff] [blame] | 5 | #include <linux/wait.h> |
Alexey Dobriyan | 6308273 | 2008-11-25 17:19:07 -0800 | [diff] [blame] | 6 | #include <linux/workqueue.h> |
Alexey Dobriyan | 8b18f8e | 2008-11-25 17:23:26 -0800 | [diff] [blame] | 7 | #include <linux/xfrm.h> |
Alexey Dobriyan | d7c7544 | 2010-01-24 22:47:53 -0800 | [diff] [blame] | 8 | #include <net/dst_ops.h> |
Alexey Dobriyan | 9d4139c | 2008-11-25 17:16:11 -0800 | [diff] [blame] | 9 | |
Alexey Dobriyan | b27aead | 2008-11-25 18:00:48 -0800 | [diff] [blame] | 10 | struct ctl_table_header; |
| 11 | |
Alexey Dobriyan | a35f6c5 | 2008-11-25 17:23:48 -0800 | [diff] [blame] | 12 | struct xfrm_policy_hash { |
| 13 | struct hlist_head *table; |
| 14 | unsigned int hmask; |
| 15 | }; |
| 16 | |
Alexey Dobriyan | d62ddc2 | 2008-11-25 17:14:31 -0800 | [diff] [blame] | 17 | struct netns_xfrm { |
Alexey Dobriyan | 9d4139c | 2008-11-25 17:16:11 -0800 | [diff] [blame] | 18 | struct list_head state_all; |
Alexey Dobriyan | 73d189d | 2008-11-25 17:16:58 -0800 | [diff] [blame] | 19 | /* |
| 20 | * Hash table to find appropriate SA towards given target (endpoint of |
| 21 | * tunnel or destination of transport mode) allowed by selector. |
| 22 | * |
| 23 | * Main use is finding SA after policy selected tunnel or transport |
| 24 | * mode. Also, it can be used by ah/esp icmp error handler to find |
| 25 | * offending SA. |
| 26 | */ |
| 27 | struct hlist_head *state_bydst; |
Alexey Dobriyan | d320bbb | 2008-11-25 17:17:24 -0800 | [diff] [blame] | 28 | struct hlist_head *state_bysrc; |
Alexey Dobriyan | b754a4f | 2008-11-25 17:17:47 -0800 | [diff] [blame] | 29 | struct hlist_head *state_byspi; |
Alexey Dobriyan | 529983e | 2008-11-25 17:18:12 -0800 | [diff] [blame] | 30 | unsigned int state_hmask; |
Alexey Dobriyan | 0bf7c5b | 2008-11-25 17:18:39 -0800 | [diff] [blame] | 31 | unsigned int state_num; |
Alexey Dobriyan | 6308273 | 2008-11-25 17:19:07 -0800 | [diff] [blame] | 32 | struct work_struct state_hash_work; |
Alexey Dobriyan | b8a0ae2 | 2008-11-25 17:20:11 -0800 | [diff] [blame] | 33 | struct hlist_head state_gc_list; |
Alexey Dobriyan | c783714 | 2008-11-25 17:20:36 -0800 | [diff] [blame] | 34 | struct work_struct state_gc_work; |
Alexey Dobriyan | 50a3065 | 2008-11-25 17:21:01 -0800 | [diff] [blame] | 35 | |
| 36 | wait_queue_head_t km_waitq; |
Alexey Dobriyan | adfcf0b | 2008-11-25 17:22:11 -0800 | [diff] [blame] | 37 | |
| 38 | struct list_head policy_all; |
Alexey Dobriyan | 93b851c | 2008-11-25 17:22:35 -0800 | [diff] [blame] | 39 | struct hlist_head *policy_byidx; |
Alexey Dobriyan | 8100bea | 2008-11-25 17:22:58 -0800 | [diff] [blame] | 40 | unsigned int policy_idx_hmask; |
Alexey Dobriyan | 8b18f8e | 2008-11-25 17:23:26 -0800 | [diff] [blame] | 41 | struct hlist_head policy_inexact[XFRM_POLICY_MAX * 2]; |
Alexey Dobriyan | a35f6c5 | 2008-11-25 17:23:48 -0800 | [diff] [blame] | 42 | struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX * 2]; |
Alexey Dobriyan | dc2caba | 2008-11-25 17:24:15 -0800 | [diff] [blame] | 43 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; |
Alexey Dobriyan | 66caf62 | 2008-11-25 17:28:57 -0800 | [diff] [blame] | 44 | struct work_struct policy_hash_work; |
Alexey Dobriyan | a6483b7 | 2008-11-25 17:38:20 -0800 | [diff] [blame] | 45 | |
Alexey Dobriyan | d7c7544 | 2010-01-24 22:47:53 -0800 | [diff] [blame] | 46 | struct dst_ops xfrm4_dst_ops; |
| 47 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 48 | struct dst_ops xfrm6_dst_ops; |
| 49 | #endif |
| 50 | |
Alexey Dobriyan | a6483b7 | 2008-11-25 17:38:20 -0800 | [diff] [blame] | 51 | struct sock *nlsk; |
Eric W. Biederman | d79d792 | 2009-12-03 02:29:05 +0000 | [diff] [blame] | 52 | struct sock *nlsk_stash; |
Alexey Dobriyan | b27aead | 2008-11-25 18:00:48 -0800 | [diff] [blame] | 53 | |
| 54 | u32 sysctl_aevent_etime; |
| 55 | u32 sysctl_aevent_rseqth; |
| 56 | int sysctl_larval_drop; |
| 57 | u32 sysctl_acq_expires; |
| 58 | #ifdef CONFIG_SYSCTL |
| 59 | struct ctl_table_header *sysctl_hdr; |
| 60 | #endif |
Alexey Dobriyan | d62ddc2 | 2008-11-25 17:14:31 -0800 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | #endif |