xfrm.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef __NETNS_XFRM_H
  2. #define __NETNS_XFRM_H
  3. #include <linux/list.h>
  4. #include <linux/wait.h>
  5. #include <linux/workqueue.h>
  6. #include <linux/xfrm.h>
  7. struct xfrm_policy_hash {
  8. struct hlist_head *table;
  9. unsigned int hmask;
  10. };
  11. struct netns_xfrm {
  12. struct list_head state_all;
  13. /*
  14. * Hash table to find appropriate SA towards given target (endpoint of
  15. * tunnel or destination of transport mode) allowed by selector.
  16. *
  17. * Main use is finding SA after policy selected tunnel or transport
  18. * mode. Also, it can be used by ah/esp icmp error handler to find
  19. * offending SA.
  20. */
  21. struct hlist_head *state_bydst;
  22. struct hlist_head *state_bysrc;
  23. struct hlist_head *state_byspi;
  24. unsigned int state_hmask;
  25. unsigned int state_num;
  26. struct work_struct state_hash_work;
  27. struct hlist_head state_gc_list;
  28. struct work_struct state_gc_work;
  29. wait_queue_head_t km_waitq;
  30. struct list_head policy_all;
  31. struct hlist_head *policy_byidx;
  32. unsigned int policy_idx_hmask;
  33. struct hlist_head policy_inexact[XFRM_POLICY_MAX * 2];
  34. struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX * 2];
  35. unsigned int policy_count[XFRM_POLICY_MAX * 2];
  36. struct work_struct policy_hash_work;
  37. struct sock *nlsk;
  38. };
  39. #endif