sctp.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. spinlock_t addr_wq_lock;
  31. /* Lock that protects the local_addr_list writers */
  32. spinlock_t local_addr_lock;
  33. /* RFC2960 Section 14. Suggested SCTP Protocol Parameter Values
  34. *
  35. * The following protocol parameters are RECOMMENDED:
  36. *
  37. * RTO.Initial - 3 seconds
  38. * RTO.Min - 1 second
  39. * RTO.Max - 60 seconds
  40. * RTO.Alpha - 1/8 (3 when converted to right shifts.)
  41. * RTO.Beta - 1/4 (2 when converted to right shifts.)
  42. */
  43. unsigned int rto_initial;
  44. unsigned int rto_min;
  45. unsigned int rto_max;
  46. /* Note: rto_alpha and rto_beta are really defined as inverse
  47. * powers of two to facilitate integer operations.
  48. */
  49. int rto_alpha;
  50. int rto_beta;
  51. /* Max.Burst - 4 */
  52. int max_burst;
  53. /* Whether Cookie Preservative is enabled(1) or not(0) */
  54. int cookie_preserve_enable;
  55. /* The namespace default hmac alg */
  56. char *sctp_hmac_alg;
  57. /* Valid.Cookie.Life - 60 seconds */
  58. unsigned int valid_cookie_life;
  59. /* Delayed SACK timeout 200ms default*/
  60. unsigned int sack_timeout;
  61. /* HB.interval - 30 seconds */
  62. unsigned int hb_interval;
  63. /* Association.Max.Retrans - 10 attempts
  64. * Path.Max.Retrans - 5 attempts (per destination address)
  65. * Max.Init.Retransmits - 8 attempts
  66. */
  67. int max_retrans_association;
  68. int max_retrans_path;
  69. int max_retrans_init;
  70. /* Potentially-Failed.Max.Retrans sysctl value
  71. * taken from:
  72. * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
  73. */
  74. int pf_retrans;
  75. /*
  76. * Policy for preforming sctp/socket accounting
  77. * 0 - do socket level accounting, all assocs share sk_sndbuf
  78. * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes
  79. */
  80. int sndbuf_policy;
  81. /*
  82. * Policy for preforming sctp/socket accounting
  83. * 0 - do socket level accounting, all assocs share sk_rcvbuf
  84. * 1 - do sctp accounting, each asoc may use sk_rcvbuf bytes
  85. */
  86. int rcvbuf_policy;
  87. int default_auto_asconf;
  88. /* Flag to indicate if addip is enabled. */
  89. int addip_enable;
  90. int addip_noauth;
  91. /* Flag to indicate if PR-SCTP is enabled. */
  92. int prsctp_enable;
  93. /* Flag to idicate if SCTP-AUTH is enabled */
  94. int auth_enable;
  95. /*
  96. * Policy to control SCTP IPv4 address scoping
  97. * 0 - Disable IPv4 address scoping
  98. * 1 - Enable IPv4 address scoping
  99. * 2 - Selectively allow only IPv4 private addresses
  100. * 3 - Selectively allow only IPv4 link local address
  101. */
  102. int scope_policy;
  103. /* Threshold for rwnd update SACKS. Receive buffer shifted this many
  104. * bits is an indicator of when to send and window update SACK.
  105. */
  106. int rwnd_upd_shift;
  107. /* Threshold for autoclose timeout, in seconds. */
  108. unsigned long max_autoclose;
  109. };
  110. #endif /* __NETNS_SCTP_H__ */