+static void
+parse_output(struct ofpbuf *b, char *arg)
+{
+ if (strchr(arg, '[')) {
+ struct nx_action_output_reg *naor;
+ int ofs, n_bits;
+ uint32_t src;
+
+ nxm_parse_field_bits(arg, &src, &ofs, &n_bits);
+
+ naor = put_action(b, sizeof *naor, OFPAT_VENDOR);
+ naor->vendor = htonl(NX_VENDOR_ID);
+ naor->subtype = htons(NXAST_OUTPUT_REG);
+ naor->ofs_nbits = nxm_encode_ofs_nbits(ofs, n_bits);
+ naor->src = htonl(src);
+ naor->max_len = htons(UINT16_MAX);
+ } else {
+ put_output_action(b, str_to_u32(arg));
+ }
+}
+
+static void
+parse_resubmit(struct nx_action_resubmit *nar, char *arg)
+{
+ char *in_port_s, *table_s;
+ uint16_t in_port;
+ uint8_t table;
+
+ in_port_s = strsep(&arg, ",");
+ if (in_port_s && in_port_s[0]) {
+ if (!parse_port_name(in_port_s, &in_port)) {
+ in_port = str_to_u32(in_port_s);
+ }
+ } else {
+ in_port = OFPP_IN_PORT;
+ }
+
+ table_s = strsep(&arg, ",");
+ table = table_s && table_s[0] ? str_to_u32(table_s) : 255;
+
+ if (in_port == OFPP_IN_PORT && table == 255) {
+ ovs_fatal(0, "at least one \"in_port\" or \"table\" must be specified "
+ " on resubmit");
+ }
+
+ nar->vendor = htonl(NX_VENDOR_ID);
+ nar->in_port = htons(in_port);
+ if (in_port != OFPP_IN_PORT && table == 255) {
+ nar->subtype = htons(NXAST_RESUBMIT);
+ } else {
+ nar->subtype = htons(NXAST_RESUBMIT_TABLE);
+ nar->table = table;
+ }
+}
+