X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fofp-util.c;h=4ee09ebe4048fbefb09d12be1e3dfa81ac01e1c6;hb=9cfcdadf934213982a0fb96a29d100e8ba0187f7;hp=cc448bcd6b9ce8efe1dba00f61ca33108355115e;hpb=a6159a233e5e9aad04278bffa54ad8cc29ded1f8;p=openvswitch diff --git a/lib/ofp-util.c b/lib/ofp-util.c index cc448bcd..4ee09ebe 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -19,6 +19,7 @@ #include #include #include +#include "autopath.h" #include "byte-order.h" #include "classifier.h" #include "dynamic-string.h" @@ -136,7 +137,7 @@ ofputil_cls_rule_from_match(const struct ofp_match *match, wc->nw_dst_mask = ofputil_wcbits_to_netmask(ofpfw >> OFPFW_NW_DST_SHIFT); if (flow_format == NXFF_TUN_ID_FROM_COOKIE && !(ofpfw & NXFW_TUN_ID)) { - rule->flow.tun_id = htonll(ntohll(cookie) >> 32); + cls_rule_set_tun_id(rule, htonll(ntohll(cookie) >> 32)); } if (ofpfw & OFPFW_DL_DST) { @@ -1863,19 +1864,6 @@ make_echo_reply(const struct ofp_header *rq) return out; } -/* Converts the members of 'opp' from host to network byte order. */ -void -hton_ofp_phy_port(struct ofp_phy_port *opp) -{ - opp->port_no = htons(opp->port_no); - opp->config = htonl(opp->config); - opp->state = htonl(opp->state); - opp->curr = htonl(opp->curr); - opp->advertised = htonl(opp->advertised); - opp->supported = htonl(opp->supported); - opp->peer = htonl(opp->peer); -} - static int check_action_exact_len(const union ofp_action *a, unsigned int len, unsigned int required_len) @@ -1958,7 +1946,7 @@ check_nicira_action(const union ofp_action *a, unsigned int len, const struct flow *flow) { const struct nx_action_header *nah; - uint16_t subtype; + int subtype; int error; if (len < 16) { @@ -1970,7 +1958,7 @@ check_nicira_action(const union ofp_action *a, unsigned int len, subtype = ntohs(nah->subtype); if (subtype > TYPE_MAXIMUM(enum nx_action_subtype)) { - /* This is necessary because enum nx_action_subtype is probably an + /* This is necessary because enum nx_action_subtype may be an * 8-bit type, so the cast below throws away the top 8 bits. */ return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_VENDOR_TYPE); } @@ -2014,11 +2002,18 @@ check_nicira_action(const union ofp_action *a, unsigned int len, } return multipath_check((const struct nx_action_multipath *) a); + case NXAST_AUTOPATH: + error = check_nx_action_exact_len( + nah, len, sizeof(struct nx_action_autopath)); + if (error) { + return error; + } + return autopath_check((const struct nx_action_autopath *) a); + case NXAST_SNAT__OBSOLETE: default: VLOG_WARN_RL(&bad_ofmsg_rl, - "unknown Nicira vendor action subtype %"PRIu16, - ntohs(nah->subtype)); + "unknown Nicira vendor action subtype %d", subtype); return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_VENDOR_TYPE); } }