xfrm.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. wait_queue_head_t km_waitq;
  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. };
  53. #endif