X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fofp-parse.c;h=1c7ce4fcff83ca9c594daee0790401b3a6e78562;hb=2986c21ea17a4f31ce153dea12d1f39d05ae5996;hp=72c115ba6bd88349f28e1853eab2b640483c93e2;hpb=88ca35eed0ce0bc65e45122c24e33f50e8339bb8;p=openvswitch diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 72c115ba..1c7ce4fc 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -25,6 +25,7 @@ #include "byte-order.h" #include "dynamic-string.h" #include "netdev.h" +#include "nx-match.h" #include "ofp-util.h" #include "ofpbuf.h" #include "openflow/openflow.h" @@ -315,6 +316,14 @@ str_to_action(char *str, struct ofpbuf *b) ofpbuf_put_zeros(b, OFP_ACTION_ALIGN - remainder); } nan->len = htons(b->size - start_ofs); + } else if (!strcasecmp(act, "move")) { + struct nx_action_reg_move *move; + move = ofpbuf_put_uninit(b, sizeof *move); + nxm_parse_reg_move(move, arg); + } else if (!strcasecmp(act, "load")) { + struct nx_action_reg_load *load; + load = ofpbuf_put_uninit(b, sizeof *load); + nxm_parse_reg_load(load, arg); } else if (!strcasecmp(act, "output")) { put_output_action(b, str_to_u32(arg)); } else if (!strcasecmp(act, "enqueue")) { @@ -648,13 +657,14 @@ void parse_ofp_flow_mod_str(struct list *packets, enum nx_flow_format *cur_format, char *string, uint16_t command) { + bool is_del = command == OFPFC_DELETE || command == OFPFC_DELETE_STRICT; enum nx_flow_format min_format, next_format; struct ofpbuf actions; struct ofpbuf *ofm; struct flow_mod fm; ofpbuf_init(&actions, 64); - parse_ofp_str(&fm, NULL, &actions, string); + parse_ofp_str(&fm, NULL, is_del ? NULL : &actions, string); fm.command = command; min_format = ofputil_min_flow_format(&fm.cr, true, fm.cookie);