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