diff options
Diffstat (limited to 'include/net/sctp/sctp.h')
| -rw-r--r-- | include/net/sctp/sctp.h | 81 |
1 files changed, 57 insertions, 24 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index a9663b49ea54..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); |
| 129 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); | 129 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); |
| 130 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | 130 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); |
| 131 | int 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 | */ | ||
| 185 | int sctp_snmp_proc_init(void); | ||
| 186 | void sctp_snmp_proc_exit(void); | ||
| 187 | int sctp_eps_proc_init(void); | ||
| 188 | void sctp_eps_proc_exit(void); | ||
| 189 | int sctp_assocs_proc_init(void); | ||
| 190 | void 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 */ | ||
| 233 | enum | ||
| 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 | ||
| 272 | struct 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. */ |
| 346 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) | 392 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) |
| @@ -404,19 +450,6 @@ static inline int sctp_list_single_entry(struct list_head *head) | |||
| 404 | return ((head->next != head) && (head->next == head->prev)); | 450 | return ((head->next != head) && (head->next == head->prev)); |
| 405 | } | 451 | } |
| 406 | 452 | ||
| 407 | /* Calculate the size (in bytes) occupied by the data of an iovec. */ | ||
| 408 | static inline size_t get_user_iov_size(struct iovec *iov, int iovlen) | ||
| 409 | { | ||
| 410 | size_t retval = 0; | ||
| 411 | |||
| 412 | for (; iovlen > 0; --iovlen) { | ||
| 413 | retval += iov->iov_len; | ||
| 414 | iov++; | ||
| 415 | } | ||
| 416 | |||
| 417 | return retval; | ||
| 418 | } | ||
| 419 | |||
| 420 | /* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ | 453 | /* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ |
| 421 | static inline __s32 sctp_jitter(__u32 rto) | 454 | static inline __s32 sctp_jitter(__u32 rto) |
| 422 | { | 455 | { |
