ofpbuf: New helper ofpbuf_equal().
authorEthan Jackson <ethan@nicira.com>
Tue, 19 Mar 2013 21:46:12 +0000 (14:46 -0700)
committerEthan Jackson <ethan@nicira.com>
Wed, 29 May 2013 20:15:15 +0000 (13:15 -0700)
Used in future commits.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
lib/ofpbuf.h

index 8b03c7e..0c12162 100644 (file)
@@ -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