From df35ec51b3ae4981746945b824fd375a2d74539a Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Tue, 19 Mar 2013 14:46:12 -0700 Subject: [PATCH] ofpbuf: New helper ofpbuf_equal(). Used in future commits. Signed-off-by: Ethan Jackson --- lib/ofpbuf.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h index 8b03c7efa..0c12162c7 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 -- 2.47.0