static void parse_output(char *arg, struct ofpbuf *ofpacts) { if (strchr(arg, '[')) { struct ofpact_output_reg *output_reg; output_reg = ofpact_put_OUTPUT_REG(ofpacts); mf_parse_subfield(&output_reg->src, arg); output_reg->max_len = UINT16_MAX; } else { struct ofpact_output *output; output = ofpact_put_OUTPUT(ofpacts); output->port = u16_to_ofp(str_to_u32(arg)); output->max_len = output->port == OFPP_CONTROLLER ? UINT16_MAX : 0; } }
void act_output_reg(struct ofpbuf* buf, int srcRegId) { struct ofpact_output_reg *outputReg = ofpact_put_OUTPUT_REG(buf); outputReg->max_len = UINT16_MAX; //assert(outputReg->ofpact.raw == (uint8_t)(-1)); initSubField(&outputReg->src, srcRegId); }