aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/constants.h17
-rw-r--r--include/net/sctp/sctp.h68
-rw-r--r--include/net/sctp/structs.h15
3 files changed, 73 insertions, 27 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c51541ee0247..6c632e26f72d 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -264,10 +264,10 @@ enum { SCTP_MAX_DUP_TSNS = 16 };
264enum { SCTP_MAX_GABS = 16 }; 264enum { SCTP_MAX_GABS = 16 };
265 265
266/* Heartbeat interval - 30 secs */ 266/* Heartbeat interval - 30 secs */
267#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30 * HZ) 267#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30*1000)
268 268
269/* Delayed sack timer - 200ms */ 269/* Delayed sack timer - 200ms */
270#define SCTP_DEFAULT_TIMEOUT_SACK ((200 * HZ) / 1000) 270#define SCTP_DEFAULT_TIMEOUT_SACK (200)
271 271
272/* RTO.Initial - 3 seconds 272/* RTO.Initial - 3 seconds
273 * RTO.Min - 1 second 273 * RTO.Min - 1 second
@@ -275,9 +275,9 @@ enum { SCTP_MAX_GABS = 16 };
275 * RTO.Alpha - 1/8 275 * RTO.Alpha - 1/8
276 * RTO.Beta - 1/4 276 * RTO.Beta - 1/4
277 */ 277 */
278#define SCTP_RTO_INITIAL (3 * HZ) 278#define SCTP_RTO_INITIAL (3 * 1000)
279#define SCTP_RTO_MIN (1 * HZ) 279#define SCTP_RTO_MIN (1 * 1000)
280#define SCTP_RTO_MAX (60 * HZ) 280#define SCTP_RTO_MAX (60 * 1000)
281 281
282#define SCTP_RTO_ALPHA 3 /* 1/8 when converted to right shifts. */ 282#define SCTP_RTO_ALPHA 3 /* 1/8 when converted to right shifts. */
283#define SCTP_RTO_BETA 2 /* 1/4 when converted to right shifts. */ 283#define SCTP_RTO_BETA 2 /* 1/4 when converted to right shifts. */
@@ -290,8 +290,7 @@ enum { SCTP_MAX_GABS = 16 };
290#define SCTP_DEF_MAX_INIT 6 290#define SCTP_DEF_MAX_INIT 6
291#define SCTP_DEF_MAX_SEND 10 291#define SCTP_DEF_MAX_SEND 10
292 292
293#define SCTP_DEFAULT_COOKIE_LIFE_SEC 60 /* seconds */ 293#define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */
294#define SCTP_DEFAULT_COOKIE_LIFE_USEC 0 /* microseconds */
295 294
296#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ 295#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */
297#define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ 296#define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */
@@ -312,9 +311,9 @@ enum { SCTP_MAX_GABS = 16 };
312 */ 311 */
313 312
314#if defined (CONFIG_SCTP_HMAC_MD5) 313#if defined (CONFIG_SCTP_HMAC_MD5)
315#define SCTP_COOKIE_HMAC_ALG "md5" 314#define SCTP_COOKIE_HMAC_ALG "hmac(md5)"
316#elif defined (CONFIG_SCTP_HMAC_SHA1) 315#elif defined (CONFIG_SCTP_HMAC_SHA1)
317#define SCTP_COOKIE_HMAC_ALG "sha1" 316#define SCTP_COOKIE_HMAC_ALG "hmac(sha1)"
318#else 317#else
319#define SCTP_COOKIE_HMAC_ALG NULL 318#define SCTP_COOKIE_HMAC_ALG NULL
320#endif 319#endif
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 92eae0e0f3f1..ee68a3124076 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -128,6 +128,8 @@ extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
128 int flags); 128 int flags);
129extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 129extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
130extern int sctp_register_pf(struct sctp_pf *, sa_family_t); 130extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
131int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
132 void *ptr);
131 133
132/* 134/*
133 * sctp/socket.c 135 * sctp/socket.c
@@ -178,6 +180,17 @@ void sctp_backlog_migrate(struct sctp_association *assoc,
178 struct sock *oldsk, struct sock *newsk); 180 struct sock *oldsk, struct sock *newsk);
179 181
180/* 182/*
183 * sctp/proc.c
184 */
185int sctp_snmp_proc_init(void);
186void sctp_snmp_proc_exit(void);
187int sctp_eps_proc_init(void);
188void sctp_eps_proc_exit(void);
189int sctp_assocs_proc_init(void);
190void sctp_assocs_proc_exit(void);
191
192
193/*
181 * Section: Macros, externs, and inlines 194 * Section: Macros, externs, and inlines
182 */ 195 */
183 196
@@ -216,6 +229,50 @@ DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics);
216 229
217#endif /* !TEST_FRAME */ 230#endif /* !TEST_FRAME */
218 231
232/* sctp mib definitions */
233enum
234{
235 SCTP_MIB_NUM = 0,
236 SCTP_MIB_CURRESTAB, /* CurrEstab */
237 SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */
238 SCTP_MIB_PASSIVEESTABS, /* PassiveEstabs */
239 SCTP_MIB_ABORTEDS, /* Aborteds */
240 SCTP_MIB_SHUTDOWNS, /* Shutdowns */
241 SCTP_MIB_OUTOFBLUES, /* OutOfBlues */
242 SCTP_MIB_CHECKSUMERRORS, /* ChecksumErrors */
243 SCTP_MIB_OUTCTRLCHUNKS, /* OutCtrlChunks */
244 SCTP_MIB_OUTORDERCHUNKS, /* OutOrderChunks */
245 SCTP_MIB_OUTUNORDERCHUNKS, /* OutUnorderChunks */
246 SCTP_MIB_INCTRLCHUNKS, /* InCtrlChunks */
247 SCTP_MIB_INORDERCHUNKS, /* InOrderChunks */
248 SCTP_MIB_INUNORDERCHUNKS, /* InUnorderChunks */
249 SCTP_MIB_FRAGUSRMSGS, /* FragUsrMsgs */
250 SCTP_MIB_REASMUSRMSGS, /* ReasmUsrMsgs */
251 SCTP_MIB_OUTSCTPPACKS, /* OutSCTPPacks */
252 SCTP_MIB_INSCTPPACKS, /* InSCTPPacks */
253 SCTP_MIB_T1_INIT_EXPIREDS,
254 SCTP_MIB_T1_COOKIE_EXPIREDS,
255 SCTP_MIB_T2_SHUTDOWN_EXPIREDS,
256 SCTP_MIB_T3_RTX_EXPIREDS,
257 SCTP_MIB_T4_RTO_EXPIREDS,
258 SCTP_MIB_T5_SHUTDOWN_GUARD_EXPIREDS,
259 SCTP_MIB_DELAY_SACK_EXPIREDS,
260 SCTP_MIB_AUTOCLOSE_EXPIREDS,
261 SCTP_MIB_T3_RETRANSMITS,
262 SCTP_MIB_PMTUD_RETRANSMITS,
263 SCTP_MIB_FAST_RETRANSMITS,
264 SCTP_MIB_IN_PKT_SOFTIRQ,
265 SCTP_MIB_IN_PKT_BACKLOG,
266 SCTP_MIB_IN_PKT_DISCARDS,
267 SCTP_MIB_IN_DATA_CHUNK_DISCARDS,
268 __SCTP_MIB_MAX
269};
270
271#define SCTP_MIB_MAX __SCTP_MIB_MAX
272struct sctp_mib {
273 unsigned long mibs[SCTP_MIB_MAX];
274} __SNMP_MIB_ALIGN__;
275
219 276
220/* Print debugging messages. */ 277/* Print debugging messages. */
221#if SCTP_DEBUG 278#if SCTP_DEBUG
@@ -330,17 +387,6 @@ static inline void sctp_v6_exit(void) { return; }
330 387
331#endif /* #if defined(CONFIG_IPV6) */ 388#endif /* #if defined(CONFIG_IPV6) */
332 389
333/* Some wrappers, in case crypto not available. */
334#if defined (CONFIG_CRYPTO_HMAC)
335#define sctp_crypto_alloc_tfm crypto_alloc_tfm
336#define sctp_crypto_free_tfm crypto_free_tfm
337#define sctp_crypto_hmac crypto_hmac
338#else
339#define sctp_crypto_alloc_tfm(x...) NULL
340#define sctp_crypto_free_tfm(x...)
341#define sctp_crypto_hmac(x...)
342#endif
343
344 390
345/* Map an association to an assoc_id. */ 391/* Map an association to an assoc_id. */
346static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) 392static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e5aa7ff1f5b5..c6d93bb0dcd2 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -87,6 +87,7 @@ struct sctp_bind_addr;
87struct sctp_ulpq; 87struct sctp_ulpq;
88struct sctp_ep_common; 88struct sctp_ep_common;
89struct sctp_ssnmap; 89struct sctp_ssnmap;
90struct crypto_hash;
90 91
91 92
92#include <net/sctp/tsnmap.h> 93#include <net/sctp/tsnmap.h>
@@ -127,9 +128,9 @@ extern struct sctp_globals {
127 * RTO.Alpha - 1/8 (3 when converted to right shifts.) 128 * RTO.Alpha - 1/8 (3 when converted to right shifts.)
128 * RTO.Beta - 1/4 (2 when converted to right shifts.) 129 * RTO.Beta - 1/4 (2 when converted to right shifts.)
129 */ 130 */
130 unsigned long rto_initial; 131 unsigned int rto_initial;
131 unsigned long rto_min; 132 unsigned int rto_min;
132 unsigned long rto_max; 133 unsigned int rto_max;
133 134
134 /* Note: rto_alpha and rto_beta are really defined as inverse 135 /* Note: rto_alpha and rto_beta are really defined as inverse
135 * powers of two to facilitate integer operations. 136 * powers of two to facilitate integer operations.
@@ -144,13 +145,13 @@ extern struct sctp_globals {
144 int cookie_preserve_enable; 145 int cookie_preserve_enable;
145 146
146 /* Valid.Cookie.Life - 60 seconds */ 147 /* Valid.Cookie.Life - 60 seconds */
147 unsigned long valid_cookie_life; 148 unsigned int valid_cookie_life;
148 149
149 /* Delayed SACK timeout 200ms default*/ 150 /* Delayed SACK timeout 200ms default*/
150 unsigned long sack_timeout; 151 unsigned int sack_timeout;
151 152
152 /* HB.interval - 30 seconds */ 153 /* HB.interval - 30 seconds */
153 unsigned long hb_interval; 154 unsigned int hb_interval;
154 155
155 /* Association.Max.Retrans - 10 attempts 156 /* Association.Max.Retrans - 10 attempts
156 * Path.Max.Retrans - 5 attempts (per destination address) 157 * Path.Max.Retrans - 5 attempts (per destination address)
@@ -264,7 +265,7 @@ struct sctp_sock {
264 struct sctp_pf *pf; 265 struct sctp_pf *pf;
265 266
266 /* Access to HMAC transform. */ 267 /* Access to HMAC transform. */
267 struct crypto_tfm *hmac; 268 struct crypto_hash *hmac;
268 269
269 /* What is our base endpointer? */ 270 /* What is our base endpointer? */
270 struct sctp_endpoint *ep; 271 struct sctp_endpoint *ep;