aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/structs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp/structs.h')
-rw-r--r--include/net/sctp/structs.h154
1 files changed, 10 insertions, 144 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index fc5e60016e37..0fef00f5d3ce 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -102,6 +102,7 @@ struct sctp_bind_bucket {
102 unsigned short fastreuse; 102 unsigned short fastreuse;
103 struct hlist_node node; 103 struct hlist_node node;
104 struct hlist_head owner; 104 struct hlist_head owner;
105 struct net *net;
105}; 106};
106 107
107struct sctp_bind_hashbucket { 108struct sctp_bind_hashbucket {
@@ -118,69 +119,6 @@ struct sctp_hashbucket {
118 119
119/* The SCTP globals structure. */ 120/* The SCTP globals structure. */
120extern struct sctp_globals { 121extern struct sctp_globals {
121 /* RFC2960 Section 14. Suggested SCTP Protocol Parameter Values
122 *
123 * The following protocol parameters are RECOMMENDED:
124 *
125 * RTO.Initial - 3 seconds
126 * RTO.Min - 1 second
127 * RTO.Max - 60 seconds
128 * RTO.Alpha - 1/8 (3 when converted to right shifts.)
129 * RTO.Beta - 1/4 (2 when converted to right shifts.)
130 */
131 unsigned int rto_initial;
132 unsigned int rto_min;
133 unsigned int rto_max;
134
135 /* Note: rto_alpha and rto_beta are really defined as inverse
136 * powers of two to facilitate integer operations.
137 */
138 int rto_alpha;
139 int rto_beta;
140
141 /* Max.Burst - 4 */
142 int max_burst;
143
144 /* Whether Cookie Preservative is enabled(1) or not(0) */
145 int cookie_preserve_enable;
146
147 /* Valid.Cookie.Life - 60 seconds */
148 unsigned int valid_cookie_life;
149
150 /* Delayed SACK timeout 200ms default*/
151 unsigned int sack_timeout;
152
153 /* HB.interval - 30 seconds */
154 unsigned int hb_interval;
155
156 /* Association.Max.Retrans - 10 attempts
157 * Path.Max.Retrans - 5 attempts (per destination address)
158 * Max.Init.Retransmits - 8 attempts
159 */
160 int max_retrans_association;
161 int max_retrans_path;
162 int max_retrans_init;
163
164 /* Potentially-Failed.Max.Retrans sysctl value
165 * taken from:
166 * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
167 */
168 int pf_retrans;
169
170 /*
171 * Policy for preforming sctp/socket accounting
172 * 0 - do socket level accounting, all assocs share sk_sndbuf
173 * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes
174 */
175 int sndbuf_policy;
176
177 /*
178 * Policy for preforming sctp/socket accounting
179 * 0 - do socket level accounting, all assocs share sk_rcvbuf
180 * 1 - do sctp accounting, each asoc may use sk_rcvbuf bytes
181 */
182 int rcvbuf_policy;
183
184 /* The following variables are implementation specific. */ 122 /* The following variables are implementation specific. */
185 123
186 /* Default initialization values to be applied to new associations. */ 124 /* Default initialization values to be applied to new associations. */
@@ -204,70 +142,11 @@ extern struct sctp_globals {
204 int port_hashsize; 142 int port_hashsize;
205 struct sctp_bind_hashbucket *port_hashtable; 143 struct sctp_bind_hashbucket *port_hashtable;
206 144
207 /* This is the global local address list.
208 * We actively maintain this complete list of addresses on
209 * the system by catching address add/delete events.
210 *
211 * It is a list of sctp_sockaddr_entry.
212 */
213 struct list_head local_addr_list;
214 int default_auto_asconf;
215 struct list_head addr_waitq;
216 struct timer_list addr_wq_timer;
217 struct list_head auto_asconf_splist;
218 spinlock_t addr_wq_lock;
219
220 /* Lock that protects the local_addr_list writers */
221 spinlock_t addr_list_lock;
222
223 /* Flag to indicate if addip is enabled. */
224 int addip_enable;
225 int addip_noauth_enable;
226
227 /* Flag to indicate if PR-SCTP is enabled. */
228 int prsctp_enable;
229
230 /* Flag to idicate if SCTP-AUTH is enabled */
231 int auth_enable;
232
233 /*
234 * Policy to control SCTP IPv4 address scoping
235 * 0 - Disable IPv4 address scoping
236 * 1 - Enable IPv4 address scoping
237 * 2 - Selectively allow only IPv4 private addresses
238 * 3 - Selectively allow only IPv4 link local address
239 */
240 int ipv4_scope_policy;
241
242 /* Flag to indicate whether computing and verifying checksum 145 /* Flag to indicate whether computing and verifying checksum
243 * is disabled. */ 146 * is disabled. */
244 bool checksum_disable; 147 bool checksum_disable;
245
246 /* Threshold for rwnd update SACKS. Receive buffer shifted this many
247 * bits is an indicator of when to send and window update SACK.
248 */
249 int rwnd_update_shift;
250
251 /* Threshold for autoclose timeout, in seconds. */
252 unsigned long max_autoclose;
253} sctp_globals; 148} sctp_globals;
254 149
255#define sctp_rto_initial (sctp_globals.rto_initial)
256#define sctp_rto_min (sctp_globals.rto_min)
257#define sctp_rto_max (sctp_globals.rto_max)
258#define sctp_rto_alpha (sctp_globals.rto_alpha)
259#define sctp_rto_beta (sctp_globals.rto_beta)
260#define sctp_max_burst (sctp_globals.max_burst)
261#define sctp_valid_cookie_life (sctp_globals.valid_cookie_life)
262#define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable)
263#define sctp_max_retrans_association (sctp_globals.max_retrans_association)
264#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy)
265#define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy)
266#define sctp_max_retrans_path (sctp_globals.max_retrans_path)
267#define sctp_pf_retrans (sctp_globals.pf_retrans)
268#define sctp_max_retrans_init (sctp_globals.max_retrans_init)
269#define sctp_sack_timeout (sctp_globals.sack_timeout)
270#define sctp_hb_interval (sctp_globals.hb_interval)
271#define sctp_max_instreams (sctp_globals.max_instreams) 150#define sctp_max_instreams (sctp_globals.max_instreams)
272#define sctp_max_outstreams (sctp_globals.max_outstreams) 151#define sctp_max_outstreams (sctp_globals.max_outstreams)
273#define sctp_address_families (sctp_globals.address_families) 152#define sctp_address_families (sctp_globals.address_families)
@@ -277,21 +156,7 @@ extern struct sctp_globals {
277#define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) 156#define sctp_assoc_hashtable (sctp_globals.assoc_hashtable)
278#define sctp_port_hashsize (sctp_globals.port_hashsize) 157#define sctp_port_hashsize (sctp_globals.port_hashsize)
279#define sctp_port_hashtable (sctp_globals.port_hashtable) 158#define sctp_port_hashtable (sctp_globals.port_hashtable)
280#define sctp_local_addr_list (sctp_globals.local_addr_list)
281#define sctp_local_addr_lock (sctp_globals.addr_list_lock)
282#define sctp_auto_asconf_splist (sctp_globals.auto_asconf_splist)
283#define sctp_addr_waitq (sctp_globals.addr_waitq)
284#define sctp_addr_wq_timer (sctp_globals.addr_wq_timer)
285#define sctp_addr_wq_lock (sctp_globals.addr_wq_lock)
286#define sctp_default_auto_asconf (sctp_globals.default_auto_asconf)
287#define sctp_scope_policy (sctp_globals.ipv4_scope_policy)
288#define sctp_addip_enable (sctp_globals.addip_enable)
289#define sctp_addip_noauth (sctp_globals.addip_noauth_enable)
290#define sctp_prsctp_enable (sctp_globals.prsctp_enable)
291#define sctp_auth_enable (sctp_globals.auth_enable)
292#define sctp_checksum_disable (sctp_globals.checksum_disable) 159#define sctp_checksum_disable (sctp_globals.checksum_disable)
293#define sctp_rwnd_upd_shift (sctp_globals.rwnd_update_shift)
294#define sctp_max_autoclose (sctp_globals.max_autoclose)
295 160
296/* SCTP Socket type: UDP or TCP style. */ 161/* SCTP Socket type: UDP or TCP style. */
297typedef enum { 162typedef enum {
@@ -1085,7 +950,7 @@ struct sctp_transport {
1085 __u64 hb_nonce; 950 __u64 hb_nonce;
1086}; 951};
1087 952
1088struct sctp_transport *sctp_transport_new(const union sctp_addr *, 953struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *,
1089 gfp_t); 954 gfp_t);
1090void sctp_transport_set_owner(struct sctp_transport *, 955void sctp_transport_set_owner(struct sctp_transport *,
1091 struct sctp_association *); 956 struct sctp_association *);
@@ -1240,7 +1105,7 @@ struct sctp_bind_addr {
1240 1105
1241void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); 1106void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);
1242void sctp_bind_addr_free(struct sctp_bind_addr *); 1107void sctp_bind_addr_free(struct sctp_bind_addr *);
1243int sctp_bind_addr_copy(struct sctp_bind_addr *dest, 1108int sctp_bind_addr_copy(struct net *net, struct sctp_bind_addr *dest,
1244 const struct sctp_bind_addr *src, 1109 const struct sctp_bind_addr *src,
1245 sctp_scope_t scope, gfp_t gfp, 1110 sctp_scope_t scope, gfp_t gfp,
1246 int flags); 1111 int flags);
@@ -1267,7 +1132,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len,
1267 __u16 port, gfp_t gfp); 1132 __u16 port, gfp_t gfp);
1268 1133
1269sctp_scope_t sctp_scope(const union sctp_addr *); 1134sctp_scope_t sctp_scope(const union sctp_addr *);
1270int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); 1135int sctp_in_scope(struct net *net, const union sctp_addr *addr, const sctp_scope_t scope);
1271int sctp_is_any(struct sock *sk, const union sctp_addr *addr); 1136int sctp_is_any(struct sock *sk, const union sctp_addr *addr);
1272int sctp_addr_is_valid(const union sctp_addr *addr); 1137int sctp_addr_is_valid(const union sctp_addr *addr);
1273int sctp_is_ep_boundall(struct sock *sk); 1138int sctp_is_ep_boundall(struct sock *sk);
@@ -1425,13 +1290,13 @@ struct sctp_association *sctp_endpoint_lookup_assoc(
1425int sctp_endpoint_is_peeled_off(struct sctp_endpoint *, 1290int sctp_endpoint_is_peeled_off(struct sctp_endpoint *,
1426 const union sctp_addr *); 1291 const union sctp_addr *);
1427struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, 1292struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *,
1428 const union sctp_addr *); 1293 struct net *, const union sctp_addr *);
1429int sctp_has_association(const union sctp_addr *laddr, 1294int sctp_has_association(struct net *net, const union sctp_addr *laddr,
1430 const union sctp_addr *paddr); 1295 const union sctp_addr *paddr);
1431 1296
1432int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t, 1297int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
1433 sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, 1298 sctp_cid_t, sctp_init_chunk_t *peer_init,
1434 struct sctp_chunk **err_chunk); 1299 struct sctp_chunk *chunk, struct sctp_chunk **err_chunk);
1435int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, 1300int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk,
1436 const union sctp_addr *peer, 1301 const union sctp_addr *peer,
1437 sctp_init_chunk_t *init, gfp_t gfp); 1302 sctp_init_chunk_t *init, gfp_t gfp);
@@ -2013,6 +1878,7 @@ void sctp_assoc_control_transport(struct sctp_association *,
2013 sctp_transport_cmd_t, sctp_sn_error_t); 1878 sctp_transport_cmd_t, sctp_sn_error_t);
2014struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *, __u32); 1879struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *, __u32);
2015struct sctp_transport *sctp_assoc_is_match(struct sctp_association *, 1880struct sctp_transport *sctp_assoc_is_match(struct sctp_association *,
1881 struct net *,
2016 const union sctp_addr *, 1882 const union sctp_addr *,
2017 const union sctp_addr *); 1883 const union sctp_addr *);
2018void sctp_assoc_migrate(struct sctp_association *, struct sock *); 1884void sctp_assoc_migrate(struct sctp_association *, struct sock *);