blob: c53d17357a49266bca9357b29784a53fce806528 [file] [log] [blame]
Alexey Dobriyand62ddc22008-11-25 17:14:31 -08001#ifndef __NETNS_XFRM_H
2#define __NETNS_XFRM_H
3
Alexey Dobriyan9d4139c2008-11-25 17:16:11 -08004#include <linux/list.h>
Alexey Dobriyan50a30652008-11-25 17:21:01 -08005#include <linux/wait.h>
Alexey Dobriyan63082732008-11-25 17:19:07 -08006#include <linux/workqueue.h>
Alexey Dobriyan8b18f8e2008-11-25 17:23:26 -08007#include <linux/xfrm.h>
Alexey Dobriyan9d4139c2008-11-25 17:16:11 -08008
Alexey Dobriyana35f6c52008-11-25 17:23:48 -08009struct xfrm_policy_hash {
10 struct hlist_head *table;
11 unsigned int hmask;
12};
13
Alexey Dobriyand62ddc22008-11-25 17:14:31 -080014struct netns_xfrm {
Alexey Dobriyan9d4139c2008-11-25 17:16:11 -080015 struct list_head state_all;
Alexey Dobriyan73d189d2008-11-25 17:16:58 -080016 /*
17 * Hash table to find appropriate SA towards given target (endpoint of
18 * tunnel or destination of transport mode) allowed by selector.
19 *
20 * Main use is finding SA after policy selected tunnel or transport
21 * mode. Also, it can be used by ah/esp icmp error handler to find
22 * offending SA.
23 */
24 struct hlist_head *state_bydst;
Alexey Dobriyand320bbb2008-11-25 17:17:24 -080025 struct hlist_head *state_bysrc;
Alexey Dobriyanb754a4f2008-11-25 17:17:47 -080026 struct hlist_head *state_byspi;
Alexey Dobriyan529983e2008-11-25 17:18:12 -080027 unsigned int state_hmask;
Alexey Dobriyan0bf7c5b2008-11-25 17:18:39 -080028 unsigned int state_num;
Alexey Dobriyan63082732008-11-25 17:19:07 -080029 struct work_struct state_hash_work;
Alexey Dobriyanb8a0ae22008-11-25 17:20:11 -080030 struct hlist_head state_gc_list;
Alexey Dobriyanc7837142008-11-25 17:20:36 -080031 struct work_struct state_gc_work;
Alexey Dobriyan50a30652008-11-25 17:21:01 -080032
33 wait_queue_head_t km_waitq;
Alexey Dobriyanadfcf0b2008-11-25 17:22:11 -080034
35 struct list_head policy_all;
Alexey Dobriyan93b851c2008-11-25 17:22:35 -080036 struct hlist_head *policy_byidx;
Alexey Dobriyan8100bea2008-11-25 17:22:58 -080037 unsigned int policy_idx_hmask;
Alexey Dobriyan8b18f8e2008-11-25 17:23:26 -080038 struct hlist_head policy_inexact[XFRM_POLICY_MAX * 2];
Alexey Dobriyana35f6c52008-11-25 17:23:48 -080039 struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX * 2];
Alexey Dobriyandc2caba2008-11-25 17:24:15 -080040 unsigned int policy_count[XFRM_POLICY_MAX * 2];
Alexey Dobriyan66caf622008-11-25 17:28:57 -080041 struct work_struct policy_hash_work;
Alexey Dobriyand62ddc22008-11-25 17:14:31 -080042};
43
44#endif