Linux Audio

Check our new training course

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