diff options
author | Ben Pfaff <blp@nicira.com> | 2011-08-16 16:30:57 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-09-13 11:46:08 -0700 |
commit | 93996add1ca50e85e4b3938133fcac15b56fbf01 (patch) | |
tree | 98d4783477d32f737b11a884f46e3310fe1dd7de /lib/bundle.c | |
parent | 333eba210b39a09a17c036335ed312ae123ba339 (diff) |
ofp-util: Add type-safe functions for serializing actions.
Diffstat (limited to 'lib/bundle.c')
-rw-r--r-- | lib/bundle.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/bundle.c b/lib/bundle.c index 86762f92..ac0badef 100644 --- a/lib/bundle.c +++ b/lib/bundle.c @@ -193,6 +193,7 @@ bundle_parse__(struct ofpbuf *b, const char *s, char **save_ptr, const char *slave_type, const char *dst, const char *slave_delim) { + enum ofputil_action_code code; struct nx_action_bundle *nab; uint16_t n_slaves; @@ -205,7 +206,8 @@ bundle_parse__(struct ofpbuf *b, const char *s, char **save_ptr, s, slave_delim); } - b->l2 = ofpbuf_put_zeros(b, sizeof *nab); + code = dst ? OFPUTIL_NXAST_BUNDLE_LOAD : OFPUTIL_NXAST_BUNDLE; + b->l2 = ofputil_put_action(code, b); n_slaves = 0; for (;;) { @@ -229,10 +231,7 @@ bundle_parse__(struct ofpbuf *b, const char *s, char **save_ptr, } nab = b->l2; - nab->type = htons(OFPAT_VENDOR); nab->len = htons(b->size - ((char *) b->l2 - (char *) b->data)); - nab->vendor = htonl(NX_VENDOR_ID); - nab->subtype = htons(dst ? NXAST_BUNDLE_LOAD: NXAST_BUNDLE); nab->n_slaves = htons(n_slaves); nab->basis = htons(atoi(basis)); |