fm->flags = learn->flags;
fm->ofpacts = NULL;
fm->ofpacts_len = 0;
+ fm->delete_reason = OFPRR_DELETE;
if (learn->fin_idle_timeout || learn->fin_hard_timeout) {
struct ofpact_fin_timeout *oft;
/*
- * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
fm->out_port = OFPP_ANY;
fm->flags = 0;
fm->out_group = OFPG11_ANY;
+ fm->delete_reason = OFPRR_DELETE;
if (fields & F_ACTIONS) {
act_str = strstr(string, "action");
if (!act_str) {
struct ofpbuf b;
enum ofpraw raw;
+ /* Ignored for non-delete actions */
+ fm->delete_reason = OFPRR_DELETE;
+
ofpbuf_use_const(&b, oh, ntohs(oh->length));
raw = ofpraw_pull_assert(&b);
if (raw == OFPRAW_OFPT11_FLOW_MOD) {
enum ofputil_flow_mod_flags flags;
struct ofpact *ofpacts; /* Series of "struct ofpact"s. */
size_t ofpacts_len; /* Length of ofpacts, in bytes. */
+
+ /* Reason for delete; ignored for non-delete commands */
+ enum ofp_flow_removed_reason delete_reason;
};
enum ofperr ofputil_decode_flow_mod(struct ofputil_flow_mod *,
fm->flags = 0;
fm->ofpacts = CONST_CAST(struct ofpact *, ofpacts);
fm->ofpacts_len = ofpacts_len;
+ fm->delete_reason = OFPRR_DELETE;
}
static int
rule_criteria_destroy(&criteria);
if (!error && rules.n > 0) {
- error = delete_flows__(ofproto, ofconn, request, &rules, OFPRR_DELETE);
+ error = delete_flows__(ofproto, ofconn, request, &rules,
+ fm->delete_reason);
}
rule_collection_destroy(&rules);
rule_criteria_destroy(&criteria);
if (!error && rules.n > 0) {
- error = delete_flows__(ofproto, ofconn, request, &rules, OFPRR_DELETE);
+ error = delete_flows__(ofproto, ofconn, request, &rules,
+ fm->delete_reason);
}
rule_collection_destroy(&rules);
/* Delete all flow entries containing this group in a group action */
match_init_catchall(&match);
flow_mod_init(&fm, &match, 0, NULL, 0, OFPFC_DELETE);
+ fm.delete_reason = OFPRR_GROUP_DELETE;
fm.out_group = ofgroup->group_id;
handle_flow_mod__(ofproto, NULL, &fm, NULL);
if test X"$1" = X"OFPRR_DELETE"; then shift;
echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
fi
+
+ # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
+ ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
+ ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
+ ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
+ if test X"$1" = X"OFPRR_DELETE"; then shift;
+ echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
+ fi
+
AT_FAIL_IF([test X"$1" != X])
ovs-appctl -t ovs-ofctl ofctl/barrier
fm.ofpacts = NULL;
fm.ofpacts_len = 0;
}
+ fm.delete_reason = OFPRR_DELETE;
ofm = ofputil_encode_flow_mod(&fm, protocol);
list_push_back(packets, &ofm->list_node);