diff options
Diffstat (limited to 'include/net/sctp/sctp.h')
| -rw-r--r-- | include/net/sctp/sctp.h | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index ff499640528b..9c6414f553f9 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -114,13 +114,12 @@ | |||
| 114 | /* | 114 | /* |
| 115 | * sctp/protocol.c | 115 | * sctp/protocol.c |
| 116 | */ | 116 | */ |
| 117 | extern struct sock *sctp_get_ctl_sock(void); | 117 | extern int sctp_copy_local_addr_list(struct net *, struct sctp_bind_addr *, |
| 118 | extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, | ||
| 119 | sctp_scope_t, gfp_t gfp, | 118 | sctp_scope_t, gfp_t gfp, |
| 120 | int flags); | 119 | int flags); |
| 121 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); | 120 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); |
| 122 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | 121 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); |
| 123 | extern void sctp_addr_wq_mgmt(struct sctp_sockaddr_entry *, int); | 122 | extern void sctp_addr_wq_mgmt(struct net *, struct sctp_sockaddr_entry *, int); |
| 124 | 123 | ||
| 125 | /* | 124 | /* |
| 126 | * sctp/socket.c | 125 | * sctp/socket.c |
| @@ -140,12 +139,12 @@ extern int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); | |||
| 140 | /* | 139 | /* |
| 141 | * sctp/primitive.c | 140 | * sctp/primitive.c |
| 142 | */ | 141 | */ |
| 143 | int sctp_primitive_ASSOCIATE(struct sctp_association *, void *arg); | 142 | int sctp_primitive_ASSOCIATE(struct net *, struct sctp_association *, void *arg); |
| 144 | int sctp_primitive_SHUTDOWN(struct sctp_association *, void *arg); | 143 | int sctp_primitive_SHUTDOWN(struct net *, struct sctp_association *, void *arg); |
| 145 | int sctp_primitive_ABORT(struct sctp_association *, void *arg); | 144 | int sctp_primitive_ABORT(struct net *, struct sctp_association *, void *arg); |
| 146 | int sctp_primitive_SEND(struct sctp_association *, void *arg); | 145 | int sctp_primitive_SEND(struct net *, struct sctp_association *, void *arg); |
| 147 | int sctp_primitive_REQUESTHEARTBEAT(struct sctp_association *, void *arg); | 146 | int sctp_primitive_REQUESTHEARTBEAT(struct net *, struct sctp_association *, void *arg); |
| 148 | int sctp_primitive_ASCONF(struct sctp_association *, void *arg); | 147 | int sctp_primitive_ASCONF(struct net *, struct sctp_association *, void *arg); |
| 149 | 148 | ||
| 150 | /* | 149 | /* |
| 151 | * sctp/input.c | 150 | * sctp/input.c |
| @@ -156,7 +155,7 @@ void sctp_hash_established(struct sctp_association *); | |||
| 156 | void sctp_unhash_established(struct sctp_association *); | 155 | void sctp_unhash_established(struct sctp_association *); |
| 157 | void sctp_hash_endpoint(struct sctp_endpoint *); | 156 | void sctp_hash_endpoint(struct sctp_endpoint *); |
| 158 | void sctp_unhash_endpoint(struct sctp_endpoint *); | 157 | void sctp_unhash_endpoint(struct sctp_endpoint *); |
| 159 | struct sock *sctp_err_lookup(int family, struct sk_buff *, | 158 | struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *, |
| 160 | struct sctphdr *, struct sctp_association **, | 159 | struct sctphdr *, struct sctp_association **, |
| 161 | struct sctp_transport **); | 160 | struct sctp_transport **); |
| 162 | void sctp_err_finish(struct sock *, struct sctp_association *); | 161 | void sctp_err_finish(struct sock *, struct sctp_association *); |
| @@ -173,14 +172,14 @@ void sctp_backlog_migrate(struct sctp_association *assoc, | |||
| 173 | /* | 172 | /* |
| 174 | * sctp/proc.c | 173 | * sctp/proc.c |
| 175 | */ | 174 | */ |
| 176 | int sctp_snmp_proc_init(void); | 175 | int sctp_snmp_proc_init(struct net *net); |
| 177 | void sctp_snmp_proc_exit(void); | 176 | void sctp_snmp_proc_exit(struct net *net); |
| 178 | int sctp_eps_proc_init(void); | 177 | int sctp_eps_proc_init(struct net *net); |
| 179 | void sctp_eps_proc_exit(void); | 178 | void sctp_eps_proc_exit(struct net *net); |
| 180 | int sctp_assocs_proc_init(void); | 179 | int sctp_assocs_proc_init(struct net *net); |
| 181 | void sctp_assocs_proc_exit(void); | 180 | void sctp_assocs_proc_exit(struct net *net); |
| 182 | int sctp_remaddr_proc_init(void); | 181 | int sctp_remaddr_proc_init(struct net *net); |
| 183 | void sctp_remaddr_proc_exit(void); | 182 | void sctp_remaddr_proc_exit(struct net *net); |
| 184 | 183 | ||
| 185 | 184 | ||
| 186 | /* | 185 | /* |
| @@ -222,11 +221,10 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly; | |||
| 222 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) | 221 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) |
| 223 | 222 | ||
| 224 | /* SCTP SNMP MIB stats handlers */ | 223 | /* SCTP SNMP MIB stats handlers */ |
| 225 | DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); | 224 | #define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field) |
| 226 | #define SCTP_INC_STATS(field) SNMP_INC_STATS(sctp_statistics, field) | 225 | #define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field) |
| 227 | #define SCTP_INC_STATS_BH(field) SNMP_INC_STATS_BH(sctp_statistics, field) | 226 | #define SCTP_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->sctp.sctp_statistics, field) |
| 228 | #define SCTP_INC_STATS_USER(field) SNMP_INC_STATS_USER(sctp_statistics, field) | 227 | #define SCTP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->sctp.sctp_statistics, field) |
| 229 | #define SCTP_DEC_STATS(field) SNMP_DEC_STATS(sctp_statistics, field) | ||
| 230 | 228 | ||
| 231 | #endif /* !TEST_FRAME */ | 229 | #endif /* !TEST_FRAME */ |
| 232 | 230 | ||
| @@ -361,25 +359,29 @@ atomic_t sctp_dbg_objcnt_## name = ATOMIC_INIT(0) | |||
| 361 | #define SCTP_DBG_OBJCNT_ENTRY(name) \ | 359 | #define SCTP_DBG_OBJCNT_ENTRY(name) \ |
| 362 | {.label= #name, .counter= &sctp_dbg_objcnt_## name} | 360 | {.label= #name, .counter= &sctp_dbg_objcnt_## name} |
| 363 | 361 | ||
| 364 | void sctp_dbg_objcnt_init(void); | 362 | void sctp_dbg_objcnt_init(struct net *); |
| 365 | void sctp_dbg_objcnt_exit(void); | 363 | void sctp_dbg_objcnt_exit(struct net *); |
| 366 | 364 | ||
| 367 | #else | 365 | #else |
| 368 | 366 | ||
| 369 | #define SCTP_DBG_OBJCNT_INC(name) | 367 | #define SCTP_DBG_OBJCNT_INC(name) |
| 370 | #define SCTP_DBG_OBJCNT_DEC(name) | 368 | #define SCTP_DBG_OBJCNT_DEC(name) |
| 371 | 369 | ||
| 372 | static inline void sctp_dbg_objcnt_init(void) { return; } | 370 | static inline void sctp_dbg_objcnt_init(struct net *net) { return; } |
| 373 | static inline void sctp_dbg_objcnt_exit(void) { return; } | 371 | static inline void sctp_dbg_objcnt_exit(struct net *net) { return; } |
| 374 | 372 | ||
| 375 | #endif /* CONFIG_SCTP_DBG_OBJCOUNT */ | 373 | #endif /* CONFIG_SCTP_DBG_OBJCOUNT */ |
| 376 | 374 | ||
| 377 | #if defined CONFIG_SYSCTL | 375 | #if defined CONFIG_SYSCTL |
| 378 | void sctp_sysctl_register(void); | 376 | void sctp_sysctl_register(void); |
| 379 | void sctp_sysctl_unregister(void); | 377 | void sctp_sysctl_unregister(void); |
| 378 | int sctp_sysctl_net_register(struct net *net); | ||
| 379 | void sctp_sysctl_net_unregister(struct net *net); | ||
| 380 | #else | 380 | #else |
| 381 | static inline void sctp_sysctl_register(void) { return; } | 381 | static inline void sctp_sysctl_register(void) { return; } |
| 382 | static inline void sctp_sysctl_unregister(void) { return; } | 382 | static inline void sctp_sysctl_unregister(void) { return; } |
| 383 | static inline int sctp_sysctl_net_register(struct net *net) { return 0; } | ||
| 384 | static inline void sctp_sysctl_net_unregister(struct net *net) { return; } | ||
| 383 | #endif | 385 | #endif |
| 384 | 386 | ||
| 385 | /* Size of Supported Address Parameter for 'x' address types. */ | 387 | /* Size of Supported Address Parameter for 'x' address types. */ |
| @@ -586,7 +588,6 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\ | |||
| 586 | 588 | ||
| 587 | extern struct proto sctp_prot; | 589 | extern struct proto sctp_prot; |
| 588 | extern struct proto sctpv6_prot; | 590 | extern struct proto sctpv6_prot; |
| 589 | extern struct proc_dir_entry *proc_net_sctp; | ||
| 590 | void sctp_put_port(struct sock *sk); | 591 | void sctp_put_port(struct sock *sk); |
| 591 | 592 | ||
| 592 | extern struct idr sctp_assocs_id; | 593 | extern struct idr sctp_assocs_id; |
| @@ -632,21 +633,21 @@ static inline int sctp_sanity_check(void) | |||
| 632 | 633 | ||
| 633 | /* Warning: The following hash functions assume a power of two 'size'. */ | 634 | /* Warning: The following hash functions assume a power of two 'size'. */ |
| 634 | /* This is the hash function for the SCTP port hash table. */ | 635 | /* This is the hash function for the SCTP port hash table. */ |
| 635 | static inline int sctp_phashfn(__u16 lport) | 636 | static inline int sctp_phashfn(struct net *net, __u16 lport) |
| 636 | { | 637 | { |
| 637 | return lport & (sctp_port_hashsize - 1); | 638 | return (net_hash_mix(net) + lport) & (sctp_port_hashsize - 1); |
| 638 | } | 639 | } |
| 639 | 640 | ||
| 640 | /* This is the hash function for the endpoint hash table. */ | 641 | /* This is the hash function for the endpoint hash table. */ |
| 641 | static inline int sctp_ep_hashfn(__u16 lport) | 642 | static inline int sctp_ep_hashfn(struct net *net, __u16 lport) |
| 642 | { | 643 | { |
| 643 | return lport & (sctp_ep_hashsize - 1); | 644 | return (net_hash_mix(net) + lport) & (sctp_ep_hashsize - 1); |
| 644 | } | 645 | } |
| 645 | 646 | ||
| 646 | /* This is the hash function for the association hash table. */ | 647 | /* This is the hash function for the association hash table. */ |
| 647 | static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport) | 648 | static inline int sctp_assoc_hashfn(struct net *net, __u16 lport, __u16 rport) |
| 648 | { | 649 | { |
| 649 | int h = (lport << 16) + rport; | 650 | int h = (lport << 16) + rport + net_hash_mix(net); |
| 650 | h ^= h>>8; | 651 | h ^= h>>8; |
| 651 | return h & (sctp_assoc_hashsize - 1); | 652 | return h & (sctp_assoc_hashsize - 1); |
| 652 | } | 653 | } |
