goto exit;
}
+ if (insts[OVSINST_OFPIT13_METER]) {
+ const struct ofp13_instruction_meter *oim;
+ struct ofpact_meter *om;
+
+ oim = (const struct ofp13_instruction_meter *)
+ insts[OVSINST_OFPIT13_METER];
+
+ om = ofpact_put_METER(ofpacts);
+ om->meter_id = ntohl(oim->meter_id);
+ }
if (insts[OVSINST_OFPIT11_APPLY_ACTIONS]) {
const union ofp_action *actions;
size_t n_actions;
case OFPACT_CLEAR_ACTIONS:
case OFPACT_WRITE_METADATA:
+ case OFPACT_METER:
case OFPACT_GOTO_TABLE:
return 0;
OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) {
enum ovs_instruction_type next;
- if (a->type == OFPACT_CLEAR_ACTIONS) {
+ if (a->type == OFPACT_METER) {
+ next = OVSINST_OFPIT13_METER;
+ } else if (a->type == OFPACT_CLEAR_ACTIONS) {
next = OVSINST_OFPIT11_CLEAR_ACTIONS;
} else if (a->type == OFPACT_WRITE_METADATA) {
next = OVSINST_OFPIT11_WRITE_METADATA;
case OFPACT_SET_L4_DST_PORT:
case OFPACT_CLEAR_ACTIONS:
case OFPACT_GOTO_TABLE:
+ case OFPACT_METER:
NOT_REACHED();
}
}
case OFPACT_PUSH_VLAN:
case OFPACT_CLEAR_ACTIONS:
case OFPACT_GOTO_TABLE:
+ case OFPACT_METER:
/* XXX */
break;
case OFPACT_CLEAR_ACTIONS:
case OFPACT_GOTO_TABLE:
+ case OFPACT_METER:
NOT_REACHED();
case OFPACT_CONTROLLER:
oiwm = instruction_put_OFPIT11_WRITE_METADATA(openflow);
oiwm->metadata = om->metadata;
oiwm->metadata_mask = om->mask;
+ } else if (a->type == OFPACT_METER) {
+ const struct ofpact_meter *om;
+ struct ofp13_instruction_meter *oim;
+
+ om = ofpact_get_METER(a);
+ oim = instruction_put_OFPIT13_METER(openflow);
+ oim->meter_id = htonl(om->meter_id);
} else if (!ofpact_is_instruction(a)) {
/* Apply-actions */
const size_t ofs = openflow->size;
case OFPACT_SAMPLE:
case OFPACT_CLEAR_ACTIONS:
case OFPACT_GOTO_TABLE:
+ case OFPACT_METER:
default:
return false;
}
OVSINST_OFPIT11_GOTO_TABLE),
ofpact_get_GOTO_TABLE(a)->table_id);
break;
+
+ case OFPACT_METER:
+ ds_put_format(s, "%s:%"PRIu32,
+ ofpact_instruction_name_from_type(OVSINST_OFPIT13_METER),
+ ofpact_get_METER(a)->meter_id);
+ break;
}
}