[ovs-dev] [xlate v3 2/8] ofpbuf: New helper ofpbuf_equal().
Ethan Jackson
ethan at nicira.com
Tue May 28 21:36:05 UTC 2013
Used in future commits.
Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
lib/ofpbuf.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h
index 8b03c7e..0c12162 100644
--- a/lib/ofpbuf.h
+++ b/lib/ofpbuf.h
@@ -107,6 +107,12 @@ static inline struct ofpbuf *ofpbuf_from_list(const struct list *list)
}
void ofpbuf_list_delete(struct list *);
+static inline bool
+ofpbuf_equal(const struct ofpbuf *a, const struct ofpbuf *b)
+{
+ return a->size == b->size && memcmp(a->data, b->data, a->size) == 0;
+}
+
#ifdef __cplusplus
}
#endif
--
1.7.9.5
More information about the dev
mailing list