action.output.port = htons(OFPP_NORMAL);
cls_rule_init_catchall(&rule, FAIL_OPEN_PRIORITY);
- ofproto_add_flow(fo->ofproto, &rule, &action, 1, 0);
+ ofproto_add_flow(fo->ofproto, &rule, &action, 1);
}
}
action.output.len = htons(sizeof action);
action.output.port = htons(OFPP_NORMAL);
action.output.max_len = htons(0);
- ofproto_add_flow(ib->ofproto, rule, &action, 1, 0);
+ ofproto_add_flow(ib->ofproto, rule, &action, 1);
}
/* Inserts flows into the flow table for the current state of 'ib'. */
return 0;
}
+/* Adds a flow to the OpenFlow flow table in 'p' that matches 'cls_rule' and
+ * performs the 'n_actions' actions in 'actions'. The new flow will not
+ * timeout.
+ *
+ * If cls_rule->priority is in the range of priorities supported by OpenFlow
+ * (0...65535, inclusive) then the flow will be visible to OpenFlow
+ * controllers; otherwise, it will be hidden.
+ *
+ * The caller retains ownership of 'cls_rule' and 'actions'. */
void
ofproto_add_flow(struct ofproto *p, const struct cls_rule *cls_rule,
- const union ofp_action *actions, size_t n_actions,
- int idle_timeout)
+ const union ofp_action *actions, size_t n_actions)
{
struct rule *rule;
- rule = rule_create(p, NULL, actions, n_actions,
- idle_timeout >= 0 ? idle_timeout : 5 /* XXX */,
- 0, 0, false);
+ rule = rule_create(p, NULL, actions, n_actions, 0, 0, 0, false);
rule->cr = *cls_rule;
rule_insert(p, rule, NULL, 0);
}
const union ofp_action *, size_t n_actions,
const struct ofpbuf *);
void ofproto_add_flow(struct ofproto *, const struct cls_rule *,
- const union ofp_action *, size_t n_actions,
- int idle_timeout);
+ const union ofp_action *, size_t n_actions);
void ofproto_delete_flow(struct ofproto *, const struct cls_rule *);
void ofproto_flush_flows(struct ofproto *);
action.output.len = htons(sizeof action);
action.output.port = htons(OFPP_NORMAL);
cls_rule_init_catchall(&rule, 0);
- ofproto_add_flow(br->ofproto, &rule, &action, 1, 0);
+ ofproto_add_flow(br->ofproto, &rule, &action, 1);
}
}