sctp.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __NETNS_SCTP_H__
  3. #define __NETNS_SCTP_H__
  4. struct sock;
  5. struct proc_dir_entry;
  6. struct sctp_mib;
  7. struct ctl_table_header;
  8. struct netns_sctp {
  9. DEFINE_SNMP_STAT(struct sctp_mib, sctp_statistics);
  10. #ifdef CONFIG_PROC_FS
  11. struct proc_dir_entry *proc_net_sctp;
  12. #endif
  13. #ifdef CONFIG_SYSCTL
  14. struct ctl_table_header *sysctl_header;
  15. #endif
  16. /* This is the global socket data structure used for responding to
  17. * the Out-of-the-blue (OOTB) packets. A control sock will be created
  18. * for this socket at the initialization time.
  19. */
  20. struct sock *ctl_sock;
  21. /* This is the global local address list.
  22. * We actively maintain this complete list of addresses on
  23. * the system by catching address add/delete events.
  24. *
  25. * It is a list of sctp_sockaddr_entry.
  26. */
  27. struct list_head local_addr_list;
  28. struct list_head addr_waitq;
  29. struct timer_list addr_wq_timer;
  30. struct list_head auto_asconf_splist;
  31. /* Lock that protects both addr_waitq and auto_asconf_splist */
  32. spinlock_t addr_wq_lock;
  33. /* Lock that protects the local_addr_list writers */
  34. spinlock_t local_addr_lock;
  35. /* RFC2960 Section 14. Suggested SCTP Protocol Parameter Values
  36. *
  37. * The following protocol parameters are RECOMMENDED:
  38. *
  39. * RTO.Initial - 3 seconds
  40. * RTO.Min - 1 second
  41. * RTO.Max - 60 seconds
  42. * RTO.Alpha - 1/8 (3 when converted to right shifts.)
  43. * RTO.Beta - 1/4 (2 when converted to right shifts.)
  44. */
  45. unsigned int rto_initial;
  46. unsigned int rto_min;
  47. unsigned int rto_max;
  48. /* Note: rto_alpha and rto_beta are really defined as inverse
  49. * powers of two to facilitate integer operations.
  50. */
  51. int rto_alpha;
  52. int rto_beta;
  53. /* Max.Burst - 4 */
  54. int max_burst;
  55. /* Whether Cookie Preservative is enabled(1) or not(0) */
  56. int cookie_preserve_enable;
  57. /* The namespace default hmac alg */
  58. char *sctp_hmac_alg;
  59. /* Valid.Cookie.Life - 60 seconds */
  60. unsigned int valid_cookie_life;
  61. /* Delayed SACK timeout 200ms default*/
  62. unsigned int sack_timeout;
  63. /* HB.interval - 30 seconds */
  64. unsigned int hb_interval;
  65. /* Association.Max.Retrans - 10 attempts
  66. * Path.Max.Retrans - 5 attempts (per destination address)
  67. * Max.Init.Retransmits - 8 attempts
  68. */
  69. int max_retrans_association;
  70. int max_retrans_path;
  71. int max_retrans_init;
  72. /* Potentially-Failed.Max.Retrans sysctl value
  73. * taken from:
  74. * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
  75. */
  76. int pf_retrans;
  77. /*
  78. * Disable Potentially-Failed feature, the feature is enabled by default
  79. * pf_enable - 0 : disable pf
  80. * - >0 : enable pf
  81. */
  82. int pf_enable;
  83. /*
  84. * Policy for preforming sctp/socket accounting
  85. * 0 - do socket level accounting, all assocs share sk_sndbuf
  86. * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes
  87. */
  88. int sndbuf_policy;
  89. /*
  90. * Policy for preforming sctp/socket accounting
  91. * 0 - do socket level accounting, all assocs share sk_rcvbuf
  92. * 1 - do sctp accounting, each asoc may use sk_rcvbuf bytes
  93. */
  94. int rcvbuf_policy;
  95. int default_auto_asconf;
  96. /* Flag to indicate if addip is enabled. */
  97. int addip_enable;
  98. int addip_noauth;
  99. /* Flag to indicate if PR-SCTP is enabled. */
  100. int prsctp_enable;
  101. /* Flag to indicate if PR-CONFIG is enabled. */
  102. int reconf_enable;
  103. /* Flag to idicate if SCTP-AUTH is enabled */
  104. int auth_enable;
  105. /*
  106. * Policy to control SCTP IPv4 address scoping
  107. * 0 - Disable IPv4 address scoping
  108. * 1 - Enable IPv4 address scoping
  109. * 2 - Selectively allow only IPv4 private addresses
  110. * 3 - Selectively allow only IPv4 link local address
  111. */
  112. int scope_policy;
  113. /* Threshold for rwnd update SACKS. Receive buffer shifted this many
  114. * bits is an indicator of when to send and window update SACK.
  115. */
  116. int rwnd_upd_shift;
  117. /* Threshold for autoclose timeout, in seconds. */
  118. unsigned long max_autoclose;
  119. };
  120. #endif /* __NETNS_SCTP_H__ */