sctp.h 3.7 KB

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