xfrm.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #include <net/dst_ops.h>
  8. struct ctl_table_header;
  9. struct xfrm_policy_hash {
  10. struct hlist_head *table;
  11. unsigned int hmask;
  12. };
  13. struct netns_xfrm {
  14. struct list_head state_all;
  15. /*
  16. * Hash table to find appropriate SA towards given target (endpoint of
  17. * tunnel or destination of transport mode) allowed by selector.
  18. *
  19. * Main use is finding SA after policy selected tunnel or transport
  20. * mode. Also, it can be used by ah/esp icmp error handler to find
  21. * offending SA.
  22. */
  23. struct hlist_head *state_bydst;
  24. struct hlist_head *state_bysrc;
  25. struct hlist_head *state_byspi;
  26. unsigned int state_hmask;
  27. unsigned int state_num;
  28. struct work_struct state_hash_work;
  29. struct hlist_head state_gc_list;
  30. struct work_struct state_gc_work;
  31. struct list_head policy_all;
  32. struct hlist_head *policy_byidx;
  33. unsigned int policy_idx_hmask;
  34. struct hlist_head policy_inexact[XFRM_POLICY_MAX * 2];
  35. struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX * 2];
  36. unsigned int policy_count[XFRM_POLICY_MAX * 2];
  37. struct work_struct policy_hash_work;
  38. struct sock *nlsk;
  39. struct sock *nlsk_stash;
  40. u32 sysctl_aevent_etime;
  41. u32 sysctl_aevent_rseqth;
  42. int sysctl_larval_drop;
  43. u32 sysctl_acq_expires;
  44. #ifdef CONFIG_SYSCTL
  45. struct ctl_table_header *sysctl_hdr;
  46. #endif
  47. struct dst_ops xfrm4_dst_ops;
  48. #if IS_ENABLED(CONFIG_IPV6)
  49. struct dst_ops xfrm6_dst_ops;
  50. #endif
  51. spinlock_t xfrm_state_lock;
  52. spinlock_t xfrm_policy_sk_bundle_lock;
  53. rwlock_t xfrm_policy_lock;
  54. struct mutex xfrm_cfg_mutex;
  55. };
  56. #endif