return memcmp(a, b, sizeof *a);
}
-unsigned long int
-flow_hash(const struct flow *flow, uint32_t basis)
+size_t
+flow_hash(const struct flow *flow, uint32_t basis)
{
- return hash_fnv(flow, sizeof *flow, basis);
+ BUILD_ASSERT_DECL(!(sizeof *flow % sizeof(uint32_t)));
+ return hash_lookup3((const uint32_t *) flow,
+ sizeof *flow / sizeof(uint32_t), basis);
}
+
uint8_t nw_proto; /* IP protocol. */
uint8_t reserved; /* Pad to 32-bit alignment. */
};
-BUILD_ASSERT_DECL(sizeof (struct flow) == 32);
+BUILD_ASSERT_DECL(sizeof(struct flow) == 32);
int flow_extract(struct ofpbuf *, uint16_t in_port, struct flow *);
void flow_print(FILE *, const struct flow *);
int flow_compare(const struct flow *, const struct flow *);
-unsigned long int flow_hash(const struct flow *, uint32_t basis);
+size_t flow_hash(const struct flow *, uint32_t basis);
#endif /* flow.h */