void
ofputil_wildcard_from_ofpfw10(uint32_t ofpfw, struct flow_wildcards *wc)
{
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 23);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 24);
/* Initialize most of wc. */
flow_wildcards_init_catchall(wc);
if (eth_type_mpls(match->flow.dl_type)) {
if (!(wc & OFPFW11_MPLS_LABEL)) {
- match_set_mpls_label(match, ofmatch->mpls_label);
+ match_set_mpls_label(match, 0, ofmatch->mpls_label);
}
if (!(wc & OFPFW11_MPLS_TC)) {
- match_set_mpls_tc(match, ofmatch->mpls_tc);
+ match_set_mpls_tc(match, 0, ofmatch->mpls_tc);
}
}
ofmatch->tp_dst = match->flow.tp_dst;
}
- if (!(match->wc.masks.mpls_lse & htonl(MPLS_LABEL_MASK))) {
+ if (!(match->wc.masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK))) {
wc |= OFPFW11_MPLS_LABEL;
} else {
- ofmatch->mpls_label = htonl(mpls_lse_to_label(match->flow.mpls_lse));
+ ofmatch->mpls_label = htonl(mpls_lse_to_label(
+ match->flow.mpls_lse[0]));
}
- if (!(match->wc.masks.mpls_lse & htonl(MPLS_TC_MASK))) {
+ if (!(match->wc.masks.mpls_lse[0] & htonl(MPLS_TC_MASK))) {
wc |= OFPFW11_MPLS_TC;
} else {
- ofmatch->mpls_tc = mpls_lse_to_tc(match->flow.mpls_lse);
+ ofmatch->mpls_tc = mpls_lse_to_tc(match->flow.mpls_lse[0]);
}
ofmatch->metadata = match->flow.metadata;
return NXM_TYPICAL_LEN;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
case OFPUTIL_P_OF10_STD_TID:
case OFPUTIL_P_OF10_NXM:
case OFPUTIL_P_OF10_NXM_TID:
- NOT_REACHED();
+ OVS_NOT_REACHED();
case OFPUTIL_P_OF11_STD: {
struct ofp11_match *om;
return oxm_put_match(b, match);
}
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
/* Given a 'dl_type' value in the format used in struct flow, returns the
return OFP13_VERSION;
}
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
/* Returns a bitmap of OpenFlow versions that are supported by at
return OFPUTIL_P_OF13_OXM;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
return ofputil_protocol_set_tid(OFPUTIL_P_OF13_OXM, tid);
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
goto match;
}
}
- NOT_REACHED();
+ OVS_NOT_REACHED();
match: ;
}
case OFP13_VERSION:
return "OpenFlow13";
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
case NXPIF_NXM:
return "nxm";
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
case OFPUTIL_P_OF13_OXM:
/* There is only one variant of each OpenFlow 1.1+ protocol, and we
* verified above that we're not trying to change versions. */
- NOT_REACHED();
+ OVS_NOT_REACHED();
case OFPUTIL_P_OF10_STD_TID:
case OFPUTIL_P_OF10_NXM_TID:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
case NXFF_NXM:
return "nxm";
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
if (error) {
return error;
}
- fm->out_group = ntohl(ofm->out_group);
- if ((ofm->command == OFPFC_DELETE
- || ofm->command == OFPFC_DELETE_STRICT)
- && ofm->out_group != htonl(OFPG_ANY)) {
- return OFPERR_OFPFMFC_UNKNOWN;
- }
+ fm->out_group = (ofm->command == OFPFC_DELETE ||
+ ofm->command == OFPFC_DELETE_STRICT
+ ? ntohl(ofm->out_group)
+ : OFPG11_ANY);
raw_flags = ofm->flags;
} else {
uint16_t command;
fm->out_group = OFPG11_ANY;
raw_flags = nfm->flags;
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
fm->modify_cookie = fm->new_cookie != OVS_BE64_MAX;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
ofpmsg_update_length(msg);
return ofputil_port_from_ofp11(qgcr11->port, port);
}
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
/* Constructs and returns the beginning of a reply to
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return reply;
return ofputil_port_from_ofp11(qgcr11->port, port);
}
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
static enum ofperr
default:
/* Hey, the caller lied. */
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return msg;
fs->byte_count = ntohll(nfs->byte_count);
fs->flags = 0;
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
fs->ofpacts = ofpacts->data;
nfs->packet_count = htonll(fs->packet_count);
nfs->byte_count = htonll(fs->byte_count);
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
ofpmp_postappend(replies, start_ofs);
fr->packet_count = ntohll(nfr->packet_count);
fr->byte_count = ntohll(nfr->byte_count);
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return 0;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return msg;
pin->reason = opi->reason;
pin->buffer_id = ntohl(opi->buffer_id);
pin->total_len = ntohs(opi->total_len);
+ } else if (raw == OFPRAW_OFPT11_PACKET_IN) {
+ const struct ofp11_packet_in *opi;
+ enum ofperr error;
+
+ opi = ofpbuf_pull(&b, sizeof *opi);
+
+ pin->packet = b.data;
+ pin->packet_len = b.size;
+
+ pin->buffer_id = ntohl(opi->buffer_id);
+ error = ofputil_port_from_ofp11(opi->in_port, &pin->fmd.in_port);
+ if (error) {
+ return error;
+ }
+ pin->total_len = ntohs(opi->total_len);
+ pin->reason = opi->reason;
+ pin->table_id = opi->table_id;
} else if (raw == OFPRAW_NXT_PACKET_IN) {
const struct nx_packet_in *npi;
struct match match;
ofputil_decode_packet_in_finish(pin, &match, &b);
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return 0;
return packet;
}
+static struct ofpbuf *
+ofputil_encode_ofp11_packet_in(const struct ofputil_packet_in *pin)
+{
+ struct ofp11_packet_in *opi;
+ struct ofpbuf *packet;
+
+ packet = ofpraw_alloc_xid(OFPRAW_OFPT11_PACKET_IN, OFP11_VERSION,
+ htonl(0), pin->packet_len);
+ opi = ofpbuf_put_zeros(packet, sizeof *opi);
+ opi->buffer_id = htonl(pin->buffer_id);
+ opi->in_port = ofputil_port_to_ofp11(pin->fmd.in_port);
+ opi->in_phy_port = opi->in_port;
+ opi->total_len = htons(pin->total_len);
+ opi->reason = pin->reason;
+ opi->table_id = pin->table_id;
+
+ ofpbuf_put(packet, pin->packet, pin->packet_len);
+
+ return packet;
+}
+
static struct ofpbuf *
ofputil_encode_ofp12_packet_in(const struct ofputil_packet_in *pin,
enum ofputil_protocol protocol)
break;
case OFPUTIL_P_OF11_STD:
- NOT_REACHED();
+ packet = ofputil_encode_ofp11_packet_in(pin);
+ break;
case OFPUTIL_P_OF12_OXM:
case OFPUTIL_P_OF13_OXM:
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
ofpmsg_update_length(packet);
return error;
}
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
if (ofp_to_u16(po->in_port) >= ofp_to_u16(OFPP_MAX)
case OFP13_VERSION:
return sizeof(struct ofp11_port);
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
\f
raw = OFPRAW_OFPT13_FEATURES_REPLY;
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
b = ofpraw_alloc_xid(raw, version, xid, 0);
osf = ofpbuf_put_zeros(b, sizeof *osf);
}
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return b;
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
b = ofpraw_alloc_xid(raw, version, htonl(0), 0);
break;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return b;
break;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return b;
rr->have_generation_id = false;
rr->generation_id = 0;
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return 0;
nrr = ofpbuf_put_zeros(buf, sizeof *nrr);
nrr->role = htonl(rr->role - 1);
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return buf;
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
if (po->buffer_id == UINT32_MAX) {
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return ofpraw_alloc(type, ofp_version, 0);
case OFPC_FRAG_NX_MATCH: return "nx-match";
}
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
bool
return op ? ofputil_decode_ofp11_port(pp, op) : EOF;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
{
switch (code) {
case OFPUTIL_ACTION_INVALID:
- NOT_REACHED();
+ OVS_NOT_REACHED();
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) \
case OFPUTIL_##ENUM: return ofputil_put_##ENUM(buf);
case OFPUTIL_##ENUM: return ofputil_put_##ENUM(buf);
#include "ofp-util.def"
}
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) \
wc.masks.nd_target = in6addr_any;
}
if (!(may_match & MAY_MPLS)) {
- wc.masks.mpls_lse = htonl(0);
+ memset(wc.masks.mpls_lse, 0, sizeof wc.masks.mpls_lse);
}
/* Log any changes. */
break;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return request;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
case OFP13_VERSION:
return sizeof(struct ofp13_port_stats);
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
}
return ofputil_port_stats_from_ofp10(ps, ps10);
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
bad_len:
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
break;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return request;
break;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return request;
case OFP10_VERSION:
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
break;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return request;
ogs11 = NULL;
}
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
if (!ogs11) {
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return b;
}
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
break;
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
return request;
case OFP13_VERSION:
return sizeof(struct ofp13_queue_stats);
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
}
return ofputil_queue_stats_from_ofp10(qs, qs10);
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
bad_len:
}
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}