diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 19:27:41 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 19:27:41 -0500 |
| commit | d347da0deffa1d8f88f0d270eab040e4707c9916 (patch) | |
| tree | e0911f2ef4d36a7b44f7a5379feabebbd37dcfc4 /include/net/inet_hashtables.h | |
| parent | c6c88bbde4d8b2ffe9886b7130b2e23781d424e5 (diff) | |
| parent | 74cb8798222bb7d1aecb0acb91e6eeedf5feb948 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'include/net/inet_hashtables.h')
| -rw-r--r-- | include/net/inet_hashtables.h | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 07840baa9341..135d80fd658e 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/wait.h> | 26 | #include <linux/wait.h> |
| 27 | 27 | ||
| 28 | #include <net/inet_connection_sock.h> | 28 | #include <net/inet_connection_sock.h> |
| 29 | #include <net/inet_sock.h> | ||
| 29 | #include <net/route.h> | 30 | #include <net/route.h> |
| 30 | #include <net/sock.h> | 31 | #include <net/sock.h> |
| 31 | #include <net/tcp_states.h> | 32 | #include <net/tcp_states.h> |
| @@ -128,26 +129,6 @@ struct inet_hashinfo { | |||
| 128 | kmem_cache_t *bind_bucket_cachep; | 129 | kmem_cache_t *bind_bucket_cachep; |
| 129 | }; | 130 | }; |
| 130 | 131 | ||
| 131 | static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, | ||
| 132 | const __u32 faddr, const __u16 fport) | ||
| 133 | { | ||
| 134 | unsigned int h = (laddr ^ lport) ^ (faddr ^ fport); | ||
| 135 | h ^= h >> 16; | ||
| 136 | h ^= h >> 8; | ||
| 137 | return h; | ||
| 138 | } | ||
| 139 | |||
| 140 | static inline int inet_sk_ehashfn(const struct sock *sk) | ||
| 141 | { | ||
| 142 | const struct inet_sock *inet = inet_sk(sk); | ||
| 143 | const __u32 laddr = inet->rcv_saddr; | ||
| 144 | const __u16 lport = inet->num; | ||
| 145 | const __u32 faddr = inet->daddr; | ||
| 146 | const __u16 fport = inet->dport; | ||
| 147 | |||
| 148 | return inet_ehashfn(laddr, lport, faddr, fport); | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline struct inet_ehash_bucket *inet_ehash_bucket( | 132 | static inline struct inet_ehash_bucket *inet_ehash_bucket( |
| 152 | struct inet_hashinfo *hashinfo, | 133 | struct inet_hashinfo *hashinfo, |
| 153 | unsigned int hash) | 134 | unsigned int hash) |
| @@ -434,4 +415,7 @@ static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo, | |||
| 434 | 415 | ||
| 435 | return sk; | 416 | return sk; |
| 436 | } | 417 | } |
| 418 | |||
| 419 | extern int inet_hash_connect(struct inet_timewait_death_row *death_row, | ||
| 420 | struct sock *sk); | ||
| 437 | #endif /* _INET_HASHTABLES_H */ | 421 | #endif /* _INET_HASHTABLES_H */ |
