mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
ofp-util: Abstract flow_mod OFPFF_* flags.
The OFPFF_* flags used in flow_mods are just confusing enough that it seems worthwhile to try to abstract them out. In particular: * OFPFF_EMERG was introduced in OF1.0, deleted in OF1.1, and then its bit was reused for a different purpose in OF1.2. * OFPFF_RESET_COUNTS was introduced in OF1.2 but the semantics that it specifies are implied by "add" commands in earlier versions, so proper translation requires the OpenFlow version number and flow_mod command. This commit does the abstraction. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
@@ -1161,15 +1161,15 @@ parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string)
|
||||
match_set_nw_proto(&fm->match, p->nw_proto);
|
||||
}
|
||||
} else if (fields & F_FLAGS && !strcmp(name, "send_flow_rem")) {
|
||||
fm->flags |= OFPFF_SEND_FLOW_REM;
|
||||
fm->flags |= OFPUTIL_FF_SEND_FLOW_REM;
|
||||
} else if (fields & F_FLAGS && !strcmp(name, "check_overlap")) {
|
||||
fm->flags |= OFPFF_CHECK_OVERLAP;
|
||||
fm->flags |= OFPUTIL_FF_CHECK_OVERLAP;
|
||||
} else if (fields & F_FLAGS && !strcmp(name, "reset_counts")) {
|
||||
fm->flags |= OFPFF12_RESET_COUNTS;
|
||||
fm->flags |= OFPUTIL_FF_RESET_COUNTS;
|
||||
} else if (fields & F_FLAGS && !strcmp(name, "no_packet_counts")) {
|
||||
fm->flags |= OFPFF13_NO_PKT_COUNTS;
|
||||
fm->flags |= OFPUTIL_FF_NO_PKT_COUNTS;
|
||||
} else if (fields & F_FLAGS && !strcmp(name, "no_byte_counts")) {
|
||||
fm->flags |= OFPFF13_NO_BYT_COUNTS;
|
||||
fm->flags |= OFPUTIL_FF_NO_BYT_COUNTS;
|
||||
} else {
|
||||
char *value;
|
||||
|
||||
|
Reference in New Issue
Block a user