I found that introducing these helper functions provided a very modest
increase in readability.
*n_actionsp = 0;
return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_LEN);
}
+
+bool
+ofputil_actions_equal(const union ofp_action *a, size_t n_a,
+ const union ofp_action *b, size_t n_b)
+{
+ return n_a == n_b && (!n_a || !memcmp(a, b, n_a * sizeof *a));
+}
+
+union ofp_action *
+ofputil_actions_clone(const union ofp_action *actions, size_t n)
+{
+ return n ? xmemdup(actions, n * sizeof *actions) : NULL;
+}
int ofputil_pull_actions(struct ofpbuf *, unsigned int actions_len,
union ofp_action **, size_t *);
+
+bool ofputil_actions_equal(const union ofp_action *a, size_t n_a,
+ const union ofp_action *b, size_t n_b);
+union ofp_action *ofputil_actions_clone(const union ofp_action *, size_t n);
\f
/* OpenFlow vendors.
*