}
static void
-parse_dec_ttl(struct ofpbuf *b, char *arg)
+parse_noargs_dec_ttl(struct ofpbuf *b, enum ofputil_action_code compat)
{
struct ofpact_cnt_ids *ids;
+ uint16_t id = 0;
ids = ofpact_put_DEC_TTL(b);
+ ids->ofpact.compat = compat;
+ ofpbuf_put(b, &id, sizeof id);
+ ids = b->l2;
+ ids->n_controllers++;
+ ofpact_update_len(b, &ids->ofpact);
+}
+static void
+parse_dec_ttl(struct ofpbuf *b, char *arg, enum ofputil_action_code compat)
+{
if (*arg == '\0') {
- uint16_t id = 0;
-
- ids->ofpact.compat = OFPUTIL_NXAST_DEC_TTL;
- ofpbuf_put(b, &id, sizeof id);
- ids = b->l2;
- ids->n_controllers++;
+ parse_noargs_dec_ttl(b, compat);
} else {
+ struct ofpact_cnt_ids *ids;
char *cntr;
+ ids = ofpact_put_DEC_TTL(b);
ids->ofpact.compat = OFPUTIL_NXAST_DEC_TTL_CNT_IDS;
for (cntr = strtok_r(arg, ", ", &arg); cntr != NULL;
cntr = strtok_r(NULL, ", ", &arg)) {
ovs_fatal(0, "dec_ttl_cnt_ids: expected at least one controller "
"id.");
}
-
+ ofpact_update_len(b, &ids->ofpact);
}
- ofpact_update_len(b, &ids->ofpact);
}
static void
ofpact_put_SET_IPV4_DSCP(ofpacts)->dscp = tos;
break;
+ case OFPUTIL_OFPAT11_DEC_NW_TTL:
+ parse_noargs_dec_ttl(ofpacts, code);
+ break;
+
case OFPUTIL_OFPAT10_SET_TP_SRC:
case OFPUTIL_OFPAT11_SET_TP_SRC:
ofpact_put_SET_L4_SRC_PORT(ofpacts)->port = str_to_u32(arg);
break;
case OFPUTIL_NXAST_DEC_TTL:
- parse_dec_ttl(ofpacts, arg);
+ parse_dec_ttl(ofpacts, arg, code);
break;
case OFPUTIL_NXAST_FIN_TIMEOUT:
break;
case OVSINST_OFPIT11_CLEAR_ACTIONS:
- /* TODO:XXX */
- ovs_fatal(0, "instruction clear-actions is not supported yet");
+ ofpact_put_CLEAR_ACTIONS(ofpacts);
break;
case OVSINST_OFPIT11_WRITE_METADATA: