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