From: Ben Pfaff Date: Tue, 23 Dec 2008 23:05:45 +0000 (-0800) Subject: New function flow_equal(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b5707d9cec319027de4a0c3f5be6a5f375a1593;p=openvswitch New function flow_equal(). --- 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) {