xfrm.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. #include <net/flowcache.h>
  9. struct ctl_table_header;
  10. struct xfrm_policy_hash {
  11. struct hlist_head *table;
  12. unsigned int hmask;
  13. };
  14. struct netns_xfrm {
  15. struct list_head state_all;
  16. /*
  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;
  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;
  32. struct list_head policy_all;
  33. struct hlist_head *policy_byidx;
  34. unsigned int policy_idx_hmask;
  35. struct hlist_head policy_inexact[XFRM_POLICY_MAX * 2];
  36. struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX * 2];
  37. unsigned int policy_count[XFRM_POLICY_MAX * 2];
  38. struct work_struct policy_hash_work;
  39. struct sock *nlsk;
  40. struct sock *nlsk_stash;
  41. u32 sysctl_aevent_etime;
  42. u32 sysctl_aevent_rseqth;
  43. int sysctl_larval_drop;
  44. u32 sysctl_acq_expires;
  45. #ifdef CONFIG_SYSCTL
  46. struct ctl_table_header *sysctl_hdr;
  47. #endif
  48. struct dst_ops xfrm4_dst_ops;
  49. #if IS_ENABLED(CONFIG_IPV6)
  50. struct dst_ops xfrm6_dst_ops;
  51. #endif
  52. spinlock_t xfrm_state_lock;
  53. rwlock_t xfrm_policy_lock;
  54. struct mutex xfrm_cfg_mutex;
  55. /* flow cache part */
  56. struct flow_cache flow_cache_global;
  57. atomic_t flow_cache_genid;
  58. struct list_head flow_cache_gc_list;
  59. spinlock_t flow_cache_gc_lock;
  60. struct work_struct flow_cache_gc_work;
  61. struct work_struct flow_cache_flush_work;
  62. struct mutex flow_flush_sem;
  63. };
  64. #endif