static void emit_ct(struct action_context *ctx, bool recirc_next, bool commit) { struct ofpact_conntrack *ct = ofpact_put_CT(ctx->ofpacts); ct->flags |= commit ? NX_CT_F_COMMIT : 0; /* If "recirc" is set, we automatically go to the next table. */ if (recirc_next) { if (ctx->cur_ltable < ctx->n_tables) { ct->recirc_table = ctx->first_ptable + ctx->cur_ltable + 1; } else { action_error(ctx, "\"ct_next\" action not allowed in last table."); return; } } else { ct->recirc_table = NX_CT_RECIRC_NONE; } ct->zone_src.field = mf_from_id(MFF_LOG_CT_ZONE); ct->zone_src.ofs = 0; ct->zone_src.n_bits = 16; /* We do not support ALGs yet. */ ct->alg = 0; /* CT only works with IP, so set up a prerequisite. */ struct expr *expr; char *error; expr = expr_parse_string("ip", ctx->symtab, &error); ovs_assert(!error); ctx->prereqs = expr_combine(EXPR_T_AND, ctx->prereqs, expr); }
void act_conntrack(struct ofpbuf* buf, uint16_t flags, uint16_t zoneImm, int zoneSrc, uint8_t recircTable, uint16_t alg) { struct ofpact_conntrack* act = ofpact_put_CT(buf); act->flags = flags; act->zone_imm = zoneImm; if (zoneSrc) { const struct mf_field *field = mf_from_id(zoneSrc); act->zone_src.field = field; act->zone_src.ofs = 0; act->zone_src.n_bits = 16; } act->alg = alg; act->recirc_table = recircTable; }