diff options
author | Ben Pfaff <blp@nicira.com> | 2010-11-22 10:10:14 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-11-22 10:10:14 -0800 |
commit | 844dff325b1f6a6f520fce9242c85162275ab7ad (patch) | |
tree | 29f3140c56bee750f37b80890b8078cde7b8db08 /tests/test-flows.c | |
parent | 0596e89755cea856d9615a46c17c4df2574107a3 (diff) | |
download | openvswitch-844dff325b1f6a6f520fce9242c85162275ab7ad.tar.gz |
flow: Remove flow_to/from_match() in favor of cls_rule_to/from_match().
The flow_from_match() and flow_to_match() functions have to deal with most
of the state in a cls_rule anyhow, and this will increase in upcoming
commits, to the point that we might as well just use a cls_rule anyhow.
This commit therefore deletes flow_from_match() and flow_to_match(),
integrating their code into cls_rule_from_match() and the new function
cls_rule_to_match(), respectively. It also changes each of the functions'
callers to use the new cls_rule_*() function.
Diffstat (limited to 'tests/test-flows.c')
-rw-r--r-- | tests/test-flows.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test-flows.c b/tests/test-flows.c index a4649b3f8..b53d8532c 100644 --- a/tests/test-flows.c +++ b/tests/test-flows.c @@ -19,10 +19,12 @@ #include <errno.h> #include <stdlib.h> #include <string.h> +#include "classifier.h" #include "openflow/openflow.h" #include "timeval.h" #include "ofpbuf.h" #include "ofp-print.h" +#include "ofp-util.h" #include "pcap.h" #include "util.h" #include "vlog.h" @@ -54,6 +56,7 @@ main(int argc OVS_UNUSED, char *argv[]) while (fread(&expected_match, sizeof expected_match, 1, flows)) { struct ofpbuf *packet; struct ofp_match extracted_match; + struct cls_rule rule; struct flow flow; n++; @@ -66,7 +69,8 @@ main(int argc OVS_UNUSED, char *argv[]) } flow_extract(packet, 0, 1, &flow); - flow_to_match(&flow, 0, false, &extracted_match); + cls_rule_init_exact(&flow, 0, &rule); + cls_rule_to_match(&rule, NXFF_OPENFLOW10, &extracted_match); if (memcmp(&expected_match, &extracted_match, sizeof expected_match)) { char *exp_s = ofp_match_to_string(&expected_match, 2); |