+/* Open vSwitch internal-only wildcard bits.
+ *
+ * These are used only internally to Open vSwitch, in the 'wildcards' member of
+ * struct flow_wildcards. They never appear in the wire protocol in this
+ * form. */
+
+/* Set to 1 if any bits in any of the reg_masks are wildcarded. This maintains
+ * the invariant that 'wildcards' is nonzero if and only if any bits are
+ * wildcarded. */
+#define FWW_REGS (1u << 31)
+
+/* Set to 1 if bit 0 (the multicast bit) of the flow's dl_dst is wildcarded.
+ *
+ * (We reinterpret OFPFW_DL_DST as excluding bit 0. Both OFPFW_DL_DST and
+ * FWW_ETH_MCAST have to be set to wildcard the entire Ethernet destination
+ * address.) */
+#define FWW_ETH_MCAST (1u << 30)
+
+/* Avoid collisions. */
+#define FWW_ALL (FWW_REGS | FWW_ETH_MCAST)
+BUILD_ASSERT_DECL(!(FWW_ALL & OVSFW_ALL));
+
+/* Information on wildcards for a flow, as a supplement to "struct flow".
+ *
+ * The flow_wildcards_*() functions below both depend on and maintain the
+ * following important invariants:
+ *
+ * 1. 'wildcards' is nonzero if and only if at least one bit or field is
+ * wildcarded.
+ *
+ * 2. Bits in 'wildcards' not included in OVSFW_ALL or FWW_ALL are set to 0.
+ * (This is a corollary to invariant #1.)
+ *
+ * 3. The fields in 'wildcards' masked by OFPFW_NW_SRC_MASK and
+ * OFPFW_NW_DST_MASK have values between 0 and 32, inclusive.
+ *
+ * 4. The fields masked by OFPFW_NW_SRC_MASK and OFPFW_NW_DST_MASK correspond
+ * correctly to the masks in 'nw_src_mask' and 'nw_dst_mask', respectively.
+ *
+ * 5. FWW_REGS is set to 1 in 'wildcards' if and only if at least one bit in
+ * 'reg_masks[]' is nonzero. (This allows wildcarded 'reg_masks[]' to
+ * satisfy invariant #1.)
+ *
+ * 6. If FWW_REGS is set to 0 in 'wildcards', then the values of all of the
+ * other members can be correctly predicted based on 'wildcards' alone.
+ */