From 9b5707d9cec319027de4a0c3f5be6a5f375a1593 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 23 Dec 2008 15:05:45 -0800 Subject: [PATCH] New function flow_equal(). --- lib/flow.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/flow.h b/lib/flow.h index f0736526..63974c45 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -63,6 +63,7 @@ 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 *); static inline int flow_compare(const struct flow *, const struct flow *); +static inline bool flow_equal(const struct flow *, const struct flow *); static inline size_t flow_hash(const struct flow *, uint32_t basis); static inline int @@ -71,6 +72,12 @@ flow_compare(const struct flow *a, const struct flow *b) return memcmp(a, b, sizeof *a); } +static inline bool +flow_equal(const struct flow *a, const struct flow *b) +{ + return !flow_compare(a, b); +} + static inline size_t flow_hash(const struct flow *flow, uint32_t basis) { -- 2.30.2