X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fofp-parse.c;h=a72d1aa455ba9ff5387e0b1805653bd97d14f078;hb=83c19ab15aa7b2d63632ac9694541759bc8d2351;hp=1ccbcd02cff5b1d8079adb840ac5f57d21feea8b;hpb=640c7c945f3c748240609dc572858fc188db1c06;p=openvswitch diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 1ccbcd02..a72d1aa4 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" @@ -256,12 +257,22 @@ str_to_action(char *str, struct ofpbuf *b) nar->vendor = htonl(NX_VENDOR_ID); nar->subtype = htons(NXAST_RESUBMIT); nar->in_port = htons(str_to_u32(arg)); - } else if (!strcasecmp(act, "set_tunnel")) { - struct nx_action_set_tunnel *nast; - nast = put_action(b, sizeof *nast, OFPAT_VENDOR); - nast->vendor = htonl(NX_VENDOR_ID); - nast->subtype = htons(NXAST_SET_TUNNEL); - nast->tun_id = htonl(str_to_u32(arg)); + } else if (!strcasecmp(act, "set_tunnel") + || !strcasecmp(act, "set_tunnel64")) { + uint64_t tun_id = str_to_u64(arg); + if (!strcasecmp(act, "set_tunnel64") || tun_id > UINT32_MAX) { + struct nx_action_set_tunnel64 *nast64; + nast64 = put_action(b, sizeof *nast64, OFPAT_VENDOR); + nast64->vendor = htonl(NX_VENDOR_ID); + nast64->subtype = htons(NXAST_SET_TUNNEL64); + nast64->tun_id = htonll(tun_id); + } else { + struct nx_action_set_tunnel *nast; + nast = put_action(b, sizeof *nast, OFPAT_VENDOR); + nast->vendor = htonl(NX_VENDOR_ID); + nast->subtype = htons(NXAST_SET_TUNNEL); + nast->tun_id = htonl(tun_id); + } } else if (!strcasecmp(act, "drop_spoofed_arp")) { struct nx_action_header *nah; nah = put_action(b, sizeof *nah, OFPAT_VENDOR); @@ -315,6 +326,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")) { @@ -442,7 +461,7 @@ parse_field_value(struct cls_rule *rule, enum field_index index, switch (index) { case F_TUN_ID: - cls_rule_set_tun_id(rule, htonl(str_to_u32(value))); + cls_rule_set_tun_id(rule, htonll(str_to_u64(value))); break; case F_IN_PORT: