ids->ofpact.compat = compat;
ids->n_controllers = 1;
ofpbuf_put(out, &id, sizeof id);
- ids = out->l2;
+ ids = out->frame;
ofpact_update_len(out, &ids->ofpact);
return error;
}
for (i = 0; i < ids->n_controllers; i++) {
uint16_t id = ntohs(((ovs_be16 *)(nac_ids + 1))[i]);
ofpbuf_put(out, &id, sizeof id);
- ids = out->l2;
+ ids = out->frame;
}
ofpact_update_len(out, &ids->ofpact);
break;
case OFPUTIL_NXAST_POP_MPLS:
- if (eth_type_mpls(a->pop_mpls.ethertype)) {
- return OFPERR_OFPBAC_BAD_ARGUMENT;
- }
ofpact_put_POP_MPLS(out)->ethertype = a->pop_mpls.ethertype;
break;
static void
set_field_to_openflow12(const struct ofpact_set_field *sf,
- struct ofpbuf *openflow)
+ struct ofpbuf *openflow,
+ enum ofp_version version)
{
uint16_t padded_value_len = ROUND_UP(sf->field->n_bytes, 8);
struct ofp12_action_set_field *oasf;
char *value;
oasf = ofputil_put_OFPAT12_SET_FIELD(openflow);
- oasf->dst = htonl(sf->field->oxm_header);
+ oasf->dst = htonl(mf_oxm_header(sf->field->id, version));
oasf->len = htons(sizeof *oasf + padded_value_len);
value = ofpbuf_put_zeros(openflow, padded_value_len);
set_field_to_openflow(const struct ofpact_set_field *sf,
struct ofpbuf *openflow)
{
- struct ofp_header *oh = (struct ofp_header *)openflow->l2;
+ struct ofp_header *oh = (struct ofp_header *)openflow->frame;
if (oh->version >= OFP12_VERSION) {
- set_field_to_openflow12(sf, openflow);
+ set_field_to_openflow12(sf, openflow, oh->version);
} else if (oh->version == OFP11_VERSION) {
set_field_to_openflow11(sf, openflow);
} else if (oh->version == OFP10_VERSION) {
break;
case OFPUTIL_OFPAT11_POP_MPLS:
- if (eth_type_mpls(a->ofp11_pop_mpls.ethertype)) {
- return OFPERR_OFPBAC_BAD_ARGUMENT;
- }
ofpact_put_POP_MPLS(out)->ethertype = a->ofp11_pop_mpls.ethertype;
break;
}
if (out[type]) {
- return OFPERR_ONFBIC_DUP_INSTRUCTION;
+ return OFPERR_OFPBIC_DUP_INST;
}
out[type] = inst;
}
* follow this action. */
break;
+ case OFPACT_SET_IP_ECN:
+ case OFPACT_SET_IP_TTL:
case OFPACT_CLEAR_ACTIONS:
case OFPACT_WRITE_ACTIONS:
case OFPACT_GOTO_TABLE:
case OFPACT_STACK_PUSH:
case OFPACT_STACK_POP:
case OFPACT_DEC_TTL:
- case OFPACT_SET_IP_ECN:
- case OFPACT_SET_IP_TTL:
case OFPACT_SET_MPLS_LABEL:
case OFPACT_SET_MPLS_TC:
case OFPACT_SET_MPLS_TTL:
struct ofpact *ofpact;
ofpact_pad(ofpacts);
- ofpact = ofpacts->l2 = ofpbuf_put_uninit(ofpacts, len);
+ ofpact = ofpacts->frame = ofpbuf_put_uninit(ofpacts, len);
ofpact_init(ofpact, type, len);
return ofpact;
}
void
ofpact_update_len(struct ofpbuf *ofpacts, struct ofpact *ofpact)
{
- ovs_assert(ofpact == ofpacts->l2);
+ ovs_assert(ofpact == ofpacts->frame);
ofpact->len = (char *) ofpbuf_tail(ofpacts) - (char *) ofpact;
}