flow: Fully separate flow_wildcards from OpenFlow wildcard bits.
authorBen Pfaff <blp@nicira.com>
Wed, 10 Nov 2010 22:39:54 +0000 (14:39 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 22 Nov 2010 18:11:40 +0000 (10:11 -0800)
commitd8ae4d672673cd72285eb405a96b4ac3590a7639
treefb6c030b086cc5f2b492d3c4411d12d81c9093b3
parent844dff325b1f6a6f520fce9242c85162275ab7ad
flow: Fully separate flow_wildcards from OpenFlow wildcard bits.

Originally, wildcards were just the OpenFlow OFPFW_* bits.  Then, when
OpenFlow added CIDR masks for IP addresses, struct flow_wildcards was born
with additional members for those masks, derived from the wildcard bits.
Then, when OVS added support for tunnels, we added another bit
NXFW_TUN_ID that coexisted with the OFPFW_*.  Later we added even more bits
that do not appear in the OpenFlow 1.0 match structure at all.  This had
become really confusing, and the difficulties were especially visible in
the long list of invariants in comments on struct flow_wildcards.

This commit cleanly separates the OpenFlow 1.0 wildcard bits from the
bits used inside Open vSwitch, by defining a new set of bits that are
used only internally to Open vSwitch and converting to and from those
wildcard bits at the point where data comes off or goes onto the wire.
It also moves those functions into ofp-util.[ch] since they are only for
dealing with OpenFlow wire protocol now.
14 files changed:
include/openvswitch/types.h
lib/classifier.c
lib/classifier.h
lib/flow.c
lib/flow.h
lib/nx-match.c
lib/nx-match.def
lib/ofp-parse.c
lib/ofp-util.c
lib/ofp-util.h
ofproto/ofproto.c
tests/test-classifier.c
tests/test-flows.c
utilities/ovs-ofctl.c