if (remainder) {
ofpbuf_put_zeros(b, OFP_ACTION_ALIGN - remainder);
}
+ nan = (struct nx_action_note *)((char *)b->data + start_ofs);
nan->len = htons(b->size - start_ofs);
} else if (!strcasecmp(act, "move")) {
struct nx_action_reg_move *move;
/* Convert 'string' (as described in the Flow Syntax section of the ovs-ofctl
* man page) into 'pf'. If 'actions' is specified, an action must be in
* 'string' and may be expanded or reallocated. */
-static void
+void
parse_ofp_str(struct flow_mod *fm, uint8_t *table_idx,
struct ofpbuf *actions, char *string)
{
} else {
parse_field_value(&fm->cr, f->index, value);
}
- } else if (!strncmp(name, "reg", 3) && isdigit(name[3])) {
+ } else if (!strncmp(name, "reg", 3)
+ && isdigit((unsigned char) name[3])) {
unsigned int reg_idx = atoi(name + 3);
if (reg_idx >= FLOW_N_REGS) {
ovs_fatal(0, "only %d registers supported", FLOW_N_REGS);
* 'stream' and the command is always OFPFC_ADD. Returns false if end-of-file
* is reached before reading a flow, otherwise true. */
bool
-parse_ofp_add_flow_file(struct list *packets, enum nx_flow_format *cur,
- FILE *stream)
+parse_ofp_flow_mod_file(struct list *packets, enum nx_flow_format *cur,
+ FILE *stream, uint16_t command)
{
struct ds s;
bool ok;
ds_init(&s);
ok = ds_get_preprocessed_line(&s, stream) == 0;
if (ok) {
- parse_ofp_flow_mod_str(packets, cur, ds_cstr(&s), OFPFC_ADD);
+ parse_ofp_flow_mod_str(packets, cur, ds_cstr(&s), command);
}
ds_destroy(&s);