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