int ofproto_class_register(const struct ofproto_class *);
int ofproto_class_unregister(const struct ofproto_class *);
-int ofproto_flow_mod(struct ofproto *, struct ofputil_flow_mod *)
+enum ofperr ofproto_flow_mod(struct ofproto *, struct ofputil_flow_mod *)
OVS_EXCLUDED(ofproto_mutex);
void ofproto_add_flow(struct ofproto *, const struct match *, int priority,
const struct ofpact *ofpacts, size_t ofpacts_len)
}
}
-/* Executes the flow modification specified in 'fm'. Returns 0 on success, an
- * OFPERR_* OpenFlow error code on failure, or OFPROTO_POSTPONE if the
- * operation cannot be initiated now but may be retried later.
+/* Executes the flow modification specified in 'fm'. Returns 0 on success, or
+ * an OFPERR_* OpenFlow error code on failure.
*
* This is a helper function for in-band control and fail-open and the "learn"
* action. */
-int
+enum ofperr
ofproto_flow_mod(struct ofproto *ofproto, struct ofputil_flow_mod *fm)
OVS_EXCLUDED(ofproto_mutex)
{
if (!rule) {
cls_rule_destroy(cr);
VLOG_WARN_RL(&rl, "%s: failed to allocate a rule.", ofproto->name);
- return ENOMEM;
+ return OFPERR_OFPFMFC_UNKNOWN;
}
/* Initialize base state. */
{
struct oftable *table;
size_t n_readonly = 0;
- int error = 0;
+ enum ofperr error = 0;
rule_collection_init(rules);
* in which no matching flow already exists in the flow table.
*
* Adds the flow specified by 'ofm', which is followed by 'n_actions'
- * ofp_actions, to the ofproto's flow table. Returns 0 on success, an OpenFlow
- * error code on failure, or OFPROTO_POSTPONE if the operation cannot be
- * initiated now but may be retried later.
+ * ofp_actions, to the ofproto's flow table. Returns 0 on success, or an
+ * OpenFlow error code on failure.
*
* The caller retains ownership of 'fm->ofpacts'.
*
struct cls_rule cr;
struct rule *rule;
uint8_t table_id;
- int error = 0;
+ enum ofperr error = 0;
if (!check_table_id(ofproto, fm->table_id)) {
error = OFPERR_OFPBRC_BAD_TABLE_ID;
{
struct rule_criteria criteria;
struct rule_collection rules;
- int error;
+ enum ofperr error;
rule_criteria_init(&criteria, fm->table_id, &fm->match, 0,
fm->cookie, fm->cookie_mask, OFPP_ANY, OFPG11_ANY);
{
struct rule_criteria criteria;
struct rule_collection rules;
- int error;
+ enum ofperr error;
rule_criteria_init(&criteria, fm->table_id, &fm->match, fm->priority,
fm->cookie, fm->cookie_mask, OFPP_ANY, OFPG11_ANY);
return error;
}
-
static enum ofperr
handle_bundle_add(struct ofconn *ofconn, const struct ofp_header *oh)
{
handle_openflow(struct ofconn *ofconn, const struct ofpbuf *ofp_msg)
OVS_EXCLUDED(ofproto_mutex)
{
- int error = handle_openflow__(ofconn, ofp_msg);
+ enum ofperr error = handle_openflow__(ofconn, ofp_msg);
+
if (error) {
ofconn_send_error(ofconn, ofp_msg->data, error);
}