aboutsummaryrefslogtreecommitdiff
path: root/lib/nx-match.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-08-16 16:30:57 -0700
committerBen Pfaff <blp@nicira.com>2011-09-13 11:46:08 -0700
commit93996add1ca50e85e4b3938133fcac15b56fbf01 (patch)
tree98d4783477d32f737b11a884f46e3310fe1dd7de /lib/nx-match.c
parent333eba210b39a09a17c036335ed312ae123ba339 (diff)
ofp-util: Add type-safe functions for serializing actions.
Diffstat (limited to 'lib/nx-match.c')
-rw-r--r--lib/nx-match.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/nx-match.c b/lib/nx-match.c
index 2654dde0..422ce761 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -1093,10 +1093,7 @@ nxm_parse_reg_move(struct nx_action_reg_move *move, const char *s)
"%d bits wide", full_s, src_n_bits, dst_n_bits);
}
- move->type = htons(OFPAT_VENDOR);
- move->len = htons(sizeof *move);
- move->vendor = htonl(NX_VENDOR_ID);
- move->subtype = htons(NXAST_REG_MOVE);
+ ofputil_init_NXAST_REG_MOVE(move);
move->n_bits = htons(src_n_bits);
move->src_ofs = htons(src_ofs);
move->dst_ofs = htons(dst_ofs);
@@ -1127,10 +1124,7 @@ nxm_parse_reg_load(struct nx_action_reg_load *load, const char *s)
full_s, value, n_bits);
}
- load->type = htons(OFPAT_VENDOR);
- load->len = htons(sizeof *load);
- load->vendor = htonl(NX_VENDOR_ID);
- load->subtype = htons(NXAST_REG_LOAD);
+ ofputil_init_NXAST_REG_LOAD(load);
load->ofs_nbits = nxm_encode_ofs_nbits(ofs, n_bits);
load->dst = htonl(dst);
load->value = htonll(value);