+/* ## -------- ## */
+/* ## Ethernet ## */
+/* ## -------- ## */
+
+ /* "eth_src" (aka "dl_src").
+ *
+ * Source address in Ethernet header.
+ *
+ * This field was not maskable before Open vSwitch 1.8.
+ *
+ * Type: MAC.
+ * Maskable: bitwise.
+ * Formatting: Ethernet.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: NXM_OF_ETH_SRC(2) since v1.1.
+ * OXM: OXM_OF_ETH_SRC(4) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: bitwise mask.
+ */
+ MFF_ETH_SRC,
+
+ /* "eth_dst" (aka "dl_dst").
+ *
+ * Destination address in Ethernet header.
+ *
+ * Before Open vSwitch 1.8, the allowed masks were restricted to
+ * 00:00:00:00:00:00, fe:ff:ff:ff:ff:ff, 01:00:00:00:00:00,
+ * ff:ff:ff:ff:ff:ff.
+ *
+ * Type: MAC.
+ * Maskable: bitwise.
+ * Formatting: Ethernet.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: NXM_OF_ETH_DST(1) since v1.1.
+ * OXM: OXM_OF_ETH_DST(3) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: bitwise mask.
+ */
+ MFF_ETH_DST,
+
+ /* "eth_type" (aka "dl_type").
+ *
+ * Packet's Ethernet type.
+ *
+ * For an Ethernet II packet this is taken from the Ethernet header. For
+ * an 802.2 LLC+SNAP header with OUI 00-00-00 this is taken from the SNAP
+ * header. A packet that has neither format has value 0x05ff
+ * (OFP_DL_TYPE_NOT_ETH_TYPE).
+ *
+ * For a packet with an 802.1Q header, this is the type of the encapsulated
+ * frame.
+ *
+ * Type: be16.
+ * Maskable: no.
+ * Formatting: hexadecimal.
+ * Prerequisites: none.
+ * Access: read-only.
+ * NXM: NXM_OF_ETH_TYPE(3) since v1.1.
+ * OXM: OXM_OF_ETH_TYPE(5) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_ETH_TYPE,
+
+/* ## ---- ## */
+/* ## VLAN ## */
+/* ## ---- ## */
+
+/* It looks odd for vlan_tci, vlan_vid, and vlan_pcp to say that they are
+ * supported in OF1.0 and OF1.1, since the detailed semantics of these fields
+ * only apply to NXM or OXM. They are marked as supported for exact matches in
+ * OF1.0 and OF1.1 because exact matches on those fields can be successfully
+ * translated into the OF1.0 and OF1.1 flow formats. */
+
+ /* "vlan_tci".
+ *
+ * 802.1Q TCI.
+ *
+ * For a packet with an 802.1Q header, this is the Tag Control Information
+ * (TCI) field, with the CFI bit forced to 1. For a packet with no 802.1Q
+ * header, this has value 0.
+ *
+ * This field can be used in various ways:
+ *
+ * - If it is not constrained at all, the nx_match matches packets
+ * without an 802.1Q header or with an 802.1Q header that has any TCI
+ * value.
+ *
+ * - Testing for an exact match with 0 matches only packets without an
+ * 802.1Q header.
+ *
+ * - Testing for an exact match with a TCI value with CFI=1 matches
+ * packets that have an 802.1Q header with a specified VID and PCP.
+ *
+ * - Testing for an exact match with a nonzero TCI value with CFI=0 does
+ * not make sense. The switch may reject this combination.
+ *
+ * - Testing with a specific VID and CFI=1, with nxm_mask=0x1fff, matches
+ * packets that have an 802.1Q header with that VID (and any PCP).
+ *
+ * - Testing with a specific PCP and CFI=1, with nxm_mask=0xf000, matches
+ * packets that have an 802.1Q header with that PCP (and any VID).
+ *
+ * - Testing with nxm_value=0, nxm_mask=0x0fff matches packets with no
+ * 802.1Q header or with an 802.1Q header with a VID of 0.
+ *
+ * - Testing with nxm_value=0, nxm_mask=0xe000 matches packets with no
+ * 802.1Q header or with an 802.1Q header with a PCP of 0.
+ *
+ * - Testing with nxm_value=0, nxm_mask=0xefff matches packets with no
+ * 802.1Q header or with an 802.1Q header with both VID and PCP of 0.
+ *
+ * Type: be16.
+ * Maskable: bitwise.
+ * Formatting: hexadecimal.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: NXM_OF_VLAN_TCI(4) since v1.1.
+ * OXM: none.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_VLAN_TCI,
+
+ /* "dl_vlan" (OpenFlow 1.0).
+ *
+ * VLAN ID field. Zero if no 802.1Q header is present.
+ *
+ * Type: be16 (low 12 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: none.
+ * OXM: none.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_DL_VLAN,
+
+ /* "vlan_vid" (OpenFlow 1.2+).
+ *
+ * If an 802.1Q header is present, this field's value is 0x1000
+ * bitwise-or'd with the VLAN ID. If no 802.1Q is present, this field's
+ * value is 0.
+ *
+ * Type: be16 (low 12 bits).
+ * Maskable: bitwise.
+ * Formatting: decimal.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: none.
+ * OXM: OXM_OF_VLAN_VID(6) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_VLAN_VID,
+
+ /* "dl_vlan_pcp" (OpenFlow 1.0).
+ *
+ * VLAN priority (PCP) field. Zero if no 802.1Q header is present.
+ *
+ * Type: u8 (low 3 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: none.
+ * Access: read/write.
+ * NXM: none.
+ * OXM: none.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_DL_VLAN_PCP,
+
+ /* "vlan_pcp" (OpenFlow 1.2+).
+ *
+ * VLAN priority (PCP) field. Zero if no 802.1Q header is present.
+ *
+ * Type: u8 (low 3 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: VLAN VID.
+ * Access: read/write.
+ * NXM: none.
+ * OXM: OXM_OF_VLAN_PCP(7) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_VLAN_PCP,
+
+/* ## ---- ## */
+/* ## MPLS ## */
+/* ## ---- ## */
+
+ /* "mpls_label".
+ *
+ * The outermost MPLS label, or 0 if no MPLS labels are present.
+ *
+ * Type: be32 (low 20 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: MPLS.
+ * Access: read/write.
+ * NXM: none.
+ * OXM: OXM_OF_MPLS_LABEL(34) since OF1.2 and v1.11.
+ * OF1.1: exact match.
+ */
+ MFF_MPLS_LABEL,
+
+ /* "mpls_tc".
+ *
+ * The outermost MPLS label's traffic control (TC) field, or 0 if no MPLS
+ * labels are present.
+ *
+ * Type: u8 (low 3 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: MPLS.
+ * Access: read/write.
+ * NXM: none.
+ * OXM: OXM_OF_MPLS_TC(35) since OF1.2 and v1.11.
+ * OF1.1: exact match.
+ */
+ MFF_MPLS_TC,
+
+ /* "mpls_bos".
+ *
+ * The outermost MPLS label's bottom of stack (BoS) field, or 0 if no MPLS
+ * labels are present.
+ *
+ * Type: u8 (low 1 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: MPLS.
+ * Access: read-only.
+ * NXM: none.
+ * OXM: OXM_OF_MPLS_BOS(36) since OF1.3 and v1.11.
+ */
+ MFF_MPLS_BOS,
+
+/* ## ---- ## */
+/* ## IPv4 ## */
+/* ## ---- ## */
+
+/* Update mf_is_l3_or_higher() if MFF_IPV4_SRC is no longer the first element
+ * for a field of layer 3 or higher */
+
+ /* "ip_src" (aka "nw_src").
+ *
+ * The source address in the IPv4 header.
+ *
+ * Before Open vSwitch 1.8, only CIDR masks were supported.
+ *
+ * Type: be32.
+ * Maskable: bitwise.
+ * Formatting: IPv4.
+ * Prerequisites: IPv4.
+ * Access: read/write.
+ * NXM: NXM_OF_IP_SRC(7) since v1.1.
+ * OXM: OXM_OF_IPV4_SRC(11) since OF1.2 and v1.7.
+ * OF1.0: CIDR mask.
+ * OF1.1: bitwise mask.
+ * Prefix lookup member: nw_src.
+ */
+ MFF_IPV4_SRC,
+
+ /* "ip_dst" (aka "nw_dst").
+ *
+ * The destination address in the IPv4 header.
+ *
+ * Before Open vSwitch 1.8, only CIDR masks were supported.
+ *
+ * Type: be32.
+ * Maskable: bitwise.
+ * Formatting: IPv4.
+ * Prerequisites: IPv4.
+ * Access: read/write.
+ * NXM: NXM_OF_IP_DST(8) since v1.1.
+ * OXM: OXM_OF_IPV4_DST(12) since OF1.2 and v1.7.
+ * OF1.0: CIDR mask.
+ * OF1.1: bitwise mask.
+ * Prefix lookup member: nw_dst.
+ */
+ MFF_IPV4_DST,
+
+/* ## ---- ## */
+/* ## IPv6 ## */
+/* ## ---- ## */
+
+ /* "ipv6_src".
+ *
+ * The source address in the IPv6 header.
+ *
+ * Type: be128.
+ * Maskable: bitwise.
+ * Formatting: IPv6.
+ * Prerequisites: IPv6.
+ * Access: read/write.
+ * NXM: NXM_NX_IPV6_SRC(19) since v1.1.
+ * OXM: OXM_OF_IPV6_SRC(26) since OF1.2 and v1.1.
+ * Prefix lookup member: ipv6_src.
+ */
+ MFF_IPV6_SRC,
+
+ /* "ipv6_dst".
+ *
+ * The destination address in the IPv6 header.
+ *
+ * Type: be128.
+ * Maskable: bitwise.
+ * Formatting: IPv6.
+ * Prerequisites: IPv6.
+ * Access: read/write.
+ * NXM: NXM_NX_IPV6_DST(20) since v1.1.
+ * OXM: OXM_OF_IPV6_DST(27) since OF1.2 and v1.1.
+ * Prefix lookup member: ipv6_dst.
+ */
+ MFF_IPV6_DST,
+
+ /* "ipv6_label".
+ *
+ * The flow label in the IPv6 header.
+ *
+ * Type: be32 (low 20 bits).
+ * Maskable: bitwise.
+ * Formatting: hexadecimal.
+ * Prerequisites: IPv6.
+ * Access: read/write.
+ * NXM: NXM_NX_IPV6_LABEL(27) since v1.4.
+ * OXM: OXM_OF_IPV6_FLABEL(28) since OF1.2 and v1.7.
+ */
+ MFF_IPV6_LABEL,
+
+/* ## ----------------------- ## */
+/* ## IPv4/IPv6 common fields ## */
+/* ## ----------------------- ## */
+
+ /* "nw_proto" (aka "ip_proto").
+ *
+ * The "protocol" byte in the IPv4 or IPv6 header.
+ *
+ * Type: u8.
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: IPv4/IPv6.
+ * Access: read-only.
+ * NXM: NXM_OF_IP_PROTO(6) since v1.1.
+ * OXM: OXM_OF_IP_PROTO(10) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_IP_PROTO,
+
+/* Both views of the DSCP below are marked as supported in all of the versions
+ * of OpenFlow because a match on either view can be successfully translated
+ * into every OpenFlow flow format. */
+
+ /* "nw_tos" (OpenFlow 1.0/1.1).
+ *
+ * The DSCP byte in the IPv4 header or the traffic class byte from the IPv6
+ * header, with the ECN bits forced to 0. (That is, bits 2-7 contain the
+ * type of service and bits 0-1 are zero.)
+ *
+ * Type: u8.
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: IPv4/IPv6.
+ * Access: read/write.
+ * NXM: NXM_OF_IP_TOS(5) since v1.1.
+ * OXM: none.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_IP_DSCP,
+
+ /* "ip_dscp" (OpenFlow 1.2+).
+ *
+ * The DSCP byte in the IPv4 header or the traffic class byte from the IPv6
+ * header, shifted right 2 bits. (That is, bits 0-5 contain the type of
+ * service and bits 6-7 are zero.)
+ *
+ * Type: u8 (low 6 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: IPv4/IPv6.
+ * Access: read/write.
+ * NXM: none.
+ * OXM: OXM_OF_IP_DSCP(8) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_IP_DSCP_SHIFTED,
+
+ /* "nw_ecn" (aka "ip_ecn").
+ *
+ * The ECN bits in the IPv4 or IPv6 header.
+ *
+ * Type: u8 (low 2 bits).
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: IPv4/IPv6.
+ * Access: read/write.
+ * NXM: NXM_NX_IP_ECN(28) since v1.4.
+ * OXM: OXM_OF_IP_ECN(9) since OF1.2 and v1.7.
+ */
+ MFF_IP_ECN,
+
+ /* "nw_ttl".
+ *
+ * The time-to-live (TTL) in the IPv4 header or hop limit in the IPv6
+ * header.
+ *
+ * Type: u8.
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: IPv4/IPv6.
+ * Access: read/write.
+ * NXM: NXM_NX_IP_TTL(29) since v1.4.
+ * OXM: none.
+ */
+ MFF_IP_TTL,
+
+ /* "ip_frag".
+ *
+ * IP fragment information.
+ *
+ * This field has three possible values:
+ *
+ * - A packet that is not an IP fragment has value 0.
+ *
+ * - A packet that is an IP fragment with offset 0 (the first fragment)
+ * has bit 0 set and thus value 1.
+ *
+ * - A packet that is an IP fragment with nonzero offset has bits 0 and 1
+ * set and thus value 3.
+ *
+ * NX_IP_FRAG_ANY and NX_IP_FRAG_LATER are declared to symbolically
+ * represent the meanings of bits 0 and 1.
+ *
+ * The switch may reject matches against values that can never appear.
+ *
+ * It is important to understand how this field interacts with the OpenFlow
+ * IP fragment handling mode:
+ *
+ * - In OFPC_FRAG_DROP mode, the OpenFlow switch drops all IP fragments
+ * before they reach the flow table, so every packet that is available
+ * for matching will have value 0 in this field.
+ *
+ * - Open vSwitch does not implement OFPC_FRAG_REASM mode, but if it did
+ * then IP fragments would be reassembled before they reached the flow
+ * table and again every packet available for matching would always
+ * have value 0.
+ *
+ * - In OFPC_FRAG_NORMAL mode, all three values are possible, but
+ * OpenFlow 1.0 says that fragments' transport ports are always 0, even
+ * for the first fragment, so this does not provide much extra
+ * information.
+ *
+ * - In OFPC_FRAG_NX_MATCH mode, all three values are possible. For
+ * fragments with offset 0, Open vSwitch makes L4 header information
+ * available.
+ *
+ * Type: u8 (low 2 bits).
+ * Maskable: bitwise.
+ * Formatting: frag.
+ * Prerequisites: IPv4/IPv6.
+ * Access: read-only.
+ * NXM: NXM_NX_IP_FRAG(26) since v1.3.
+ * OXM: none.
+ */
+ MFF_IP_FRAG,
+
+/* ## --- ## */
+/* ## ARP ## */
+/* ## --- ## */
+
+ /* "arp_op".
+ *
+ * ARP opcode.
+ *
+ * For an Ethernet+IP ARP packet, the opcode in the ARP header. Always 0
+ * otherwise. Only ARP opcodes between 1 and 255 should be specified for
+ * matching.
+ *
+ * Type: be16.
+ * Maskable: no.
+ * Formatting: decimal.
+ * Prerequisites: ARP.
+ * Access: read/write.
+ * NXM: NXM_OF_ARP_OP(15) since v1.1.
+ * OXM: OXM_OF_ARP_OP(21) since OF1.2 and v1.7.
+ * OF1.0: exact match.
+ * OF1.1: exact match.
+ */
+ MFF_ARP_OP,
+
+ /* "arp_spa".
+ *
+ * For an Ethernet+IP ARP packet, the source protocol (IPv4) address in the
+ * ARP header. Always 0 otherwise.
+ *
+ * Before Open vSwitch 1.8, only CIDR masks were supported.
+ *
+ * Type: be32.
+ * Maskable: bitwise.
+ * Formatting: IPv4.
+ * Prerequisites: ARP.
+ * Access: read/write.
+ * NXM: NXM_OF_ARP_SPA(16) since v1.1.
+ * OXM: OXM_OF_ARP_SPA(22) since OF1.2 and v1.7.
+ * OF1.0: CIDR mask.
+ * OF1.1: bitwise mask.
+ */
+ MFF_ARP_SPA,
+
+ /* "arp_tpa".
+ *
+ * For an Ethernet+IP ARP packet, the target protocol (IPv4) address in the
+ * ARP header. Always 0 otherwise.
+ *
+ * Before Open vSwitch 1.8, only CIDR masks were supported.
+ *
+ * Type: be32.
+ * Maskable: bitwise.
+ * Formatting: IPv4.
+ * Prerequisites: ARP.
+ * Access: read/write.
+ * NXM: NXM_OF_ARP_TPA(17) since v1.1.
+ * OXM: OXM_OF_ARP_TPA(23) since OF1.2 and v1.7.
+ * OF1.0: CIDR mask.
+ * OF1.1: bitwise mask.
+ */
+ MFF_ARP_TPA,
+
+ /* "arp_sha".
+ *
+ * For an Ethernet+IP ARP packet, the source hardware (Ethernet) address in
+ * the ARP header. Always 0 otherwise.
+ *
+ * Type: MAC.
+ * Maskable: bitwise.
+ * Formatting: Ethernet.
+ * Prerequisites: ARP.
+ * Access: read/write.
+ * NXM: NXM_NX_ARP_SHA(17) since v1.1.
+ * OXM: OXM_OF_ARP_SHA(24) since OF1.2 and v1.7.
+ */
+ MFF_ARP_SHA,
+
+ /* "arp_tha".
+ *
+ * For an Ethernet+IP ARP packet, the target hardware (Ethernet) address in
+ * the ARP header. Always 0 otherwise.
+ *
+ * Type: MAC.
+ * Maskable: bitwise.
+ * Formatting: Ethernet.
+ * Prerequisites: ARP.
+ * Access: read/write.
+ * NXM: NXM_NX_ARP_THA(18) since v1.1.
+ * OXM: OXM_OF_ARP_THA(25) since OF1.2 and v1.7.
+ */
+ MFF_ARP_THA,