X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-flows.c;h=6528b0781c0bfd28413f2d9648269f4dcd86985e;hb=ac60863f78e412004c5b69f5a64a49bc6f0bc46d;hp=33417e0211e8b77e55fcb6e3af071769e77c7e33;hpb=eec25dc1ae3ed49ad5e2eda0ca04450c4f75d6f7;p=sliver-openvswitch.git diff --git a/tests/test-flows.c b/tests/test-flows.c index 33417e021..6528b0781 100644 --- a/tests/test-flows.c +++ b/tests/test-flows.c @@ -25,7 +25,7 @@ #include "ofpbuf.h" #include "ofp-print.h" #include "ofp-util.h" -#include "pcap.h" +#include "pcap-file.h" #include "util.h" #include "vlog.h" @@ -56,9 +56,9 @@ main(int argc OVS_UNUSED, char *argv[]) while (fread(&expected_match, sizeof expected_match, 1, flows)) { struct ofpbuf *packet; struct ofp10_match extracted_match; - struct cls_rule rule; + struct match match; struct flow flow; - + union flow_in_port in_port_; n++; retval = pcap_read(pcap, &packet); @@ -68,9 +68,10 @@ main(int argc OVS_UNUSED, char *argv[]) ovs_fatal(retval, "error reading pcap file"); } - flow_extract(packet, 0, 0, 1, &flow); - cls_rule_init_exact(&flow, 0, &rule); - ofputil_cls_rule_to_ofp10_match(&rule, &extracted_match); + in_port_.ofp_port = u16_to_ofp(1); + flow_extract(packet, 0, 0, NULL, &in_port_, &flow); + match_wc_init(&match, &flow); + ofputil_match_to_ofp10_match(&match, &extracted_match); if (memcmp(&expected_match, &extracted_match, sizeof expected_match)) { char *exp_s = ofp10_match_to_string(&expected_match, 2); @@ -80,7 +81,7 @@ main(int argc OVS_UNUSED, char *argv[]) printf("Packet:\n"); ofp_print_packet(stdout, packet->data, packet->size); ovs_hex_dump(stdout, packet->data, packet->size, 0, true); - cls_rule_print(&rule); + match_print(&match); printf("Expected flow:\n%s\n", exp_s); printf("Actually extracted flow:\n%s\n", got_s); ovs_hex_dump(stdout, &expected_match, sizeof expected_match, 0, false);