From: Ethan Jackson Date: Tue, 19 Mar 2013 21:46:12 +0000 (-0700) Subject: ofpbuf: New helper ofpbuf_equal(). X-Git-Tag: sliver-openvswitch-1.10.90-3~6^2~198 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=df35ec51b3ae4981746945b824fd375a2d74539a;p=sliver-openvswitch.git ofpbuf: New helper ofpbuf_equal(). Used in future commits. Signed-off-by: Ethan Jackson --- 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