diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-07-21 06:05:31 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-07-21 06:05:31 -0400 |
commit | a6a7b759ba62e62542308e091f7fc9cfac4f978e (patch) | |
tree | f7d2adb889431abb4e72ced602fdc693144ce8f2 /include | |
parent | 97d32cf9440d2111a12471740446d4d63231b79a (diff) |
netfilter: ipset: make possible to hash some part of the data element only
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/ipset/ip_set_ahash.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index c5b06aaa205c..42b7d25a1b2e 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
@@ -211,12 +211,16 @@ ip_set_hash_destroy(struct ip_set *set) | |||
211 | set->data = NULL; | 211 | set->data = NULL; |
212 | } | 212 | } |
213 | 213 | ||
214 | #define HKEY(data, initval, htable_bits) \ | ||
215 | (jhash2((u32 *)(data), sizeof(struct type_pf_elem)/sizeof(u32), initval) \ | ||
216 | & jhash_mask(htable_bits)) | ||
217 | |||
218 | #endif /* _IP_SET_AHASH_H */ | 214 | #endif /* _IP_SET_AHASH_H */ |
219 | 215 | ||
216 | #ifndef HKEY_DATALEN | ||
217 | #define HKEY_DATALEN sizeof(struct type_pf_elem) | ||
218 | #endif | ||
219 | |||
220 | #define HKEY(data, initval, htable_bits) \ | ||
221 | (jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \ | ||
222 | & jhash_mask(htable_bits)) | ||
223 | |||
220 | #define CONCAT(a, b, c) a##b##c | 224 | #define CONCAT(a, b, c) a##b##c |
221 | #define TOKEN(a, b, c) CONCAT(a, b, c) | 225 | #define TOKEN(a, b, c) CONCAT(a, b, c) |
222 | 226 | ||
@@ -1054,6 +1058,8 @@ type_pf_gc_init(struct ip_set *set) | |||
1054 | IPSET_GC_PERIOD(h->timeout)); | 1058 | IPSET_GC_PERIOD(h->timeout)); |
1055 | } | 1059 | } |
1056 | 1060 | ||
1061 | #undef HKEY_DATALEN | ||
1062 | #undef HKEY | ||
1057 | #undef type_pf_data_equal | 1063 | #undef type_pf_data_equal |
1058 | #undef type_pf_data_isnull | 1064 | #undef type_pf_data_isnull |
1059 | #undef type_pf_data_copy | 1065 | #undef type_pf_data_copy |