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