diff options
author | Joe Stringer <joestringer@nicira.com> | 2014-08-12 11:12:12 +1200 |
---|---|---|
committer | Joe Stringer <joestringer@nicira.com> | 2014-11-25 14:12:24 -0800 |
commit | 468cdd91c3bc21acde1d98250def7d9330204b8e (patch) | |
tree | 369737594431a4fe705dbcf4b8e8014b53b9c8af /include | |
parent | bc2df54d2a41a1584fe2ae7a9bcfcc2ee7ccac57 (diff) |
hash: Add 128-bit murmurhash.
Add the 128-bit murmurhash by Austin Appleby, r150 from:
http://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/openvswitch/types.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/openvswitch/types.h b/include/openvswitch/types.h index 54541a42b..2afb7b71f 100644 --- a/include/openvswitch/types.h +++ b/include/openvswitch/types.h @@ -81,6 +81,20 @@ typedef struct { #endif } ovs_32aligned_u64; +typedef union { + uint32_t u32[4]; + struct { + uint64_t lo, hi; + } u64; +} ovs_u128; + +/* Returns non-zero if the parameters have equal value. */ +static inline int +ovs_u128_equal(const ovs_u128 *a, const ovs_u128 *b) +{ + return (a->u64.hi == b->u64.hi) && (a->u64.lo == b->u64.lo); +} + /* A 64-bit value, in network byte order, that is only aligned on a 32-bit * boundary. */ typedef struct { |