xfrm.h 1.1 KB
Newer Older
1 2 3
#ifndef __NETNS_XFRM_H
#define __NETNS_XFRM_H

4
#include <linux/list.h>
A
Alexey Dobriyan 已提交
5
#include <linux/wait.h>
6
#include <linux/workqueue.h>
7
#include <linux/xfrm.h>
8

9 10 11 12 13
struct xfrm_policy_hash {
	struct hlist_head	*table;
	unsigned int		hmask;
};

14
struct netns_xfrm {
15
	struct list_head	state_all;
16 17 18 19 20 21 22 23 24
	/*
	 * Hash table to find appropriate SA towards given target (endpoint of
	 * tunnel or destination of transport mode) allowed by selector.
	 *
	 * Main use is finding SA after policy selected tunnel or transport
	 * mode. Also, it can be used by ah/esp icmp error handler to find
	 * offending SA.
	 */
	struct hlist_head	*state_bydst;
25
	struct hlist_head	*state_bysrc;
26
	struct hlist_head	*state_byspi;
27
	unsigned int		state_hmask;
28
	unsigned int		state_num;
29
	struct work_struct	state_hash_work;
30
	struct hlist_head	state_gc_list;
31
	struct work_struct	state_gc_work;
A
Alexey Dobriyan 已提交
32 33

	wait_queue_head_t	km_waitq;
34 35

	struct list_head	policy_all;
36
	struct hlist_head	*policy_byidx;
37
	unsigned int		policy_idx_hmask;
38
	struct hlist_head	policy_inexact[XFRM_POLICY_MAX * 2];
39
	struct xfrm_policy_hash	policy_bydst[XFRM_POLICY_MAX * 2];
40
	unsigned int		policy_count[XFRM_POLICY_MAX * 2];
41 42 43
};

#endif