--- openflow-2011-10-12-2.h	2015-07-23 09:54:16.596479339 -0700
+++ openflow-2011-08-31-4.h	2015-07-23 09:54:16.604479340 -0700
@@ -597,38 +597,91 @@
     OFPGC_DELETE,           /* Delete all matching groups. */
 };
 
-/* Flow wildcards. */
-enum ofp_flow_wildcards {
-    OFPFW_IN_PORT     = 1 << 0,  /* Switch input port. */
-    OFPFW_DL_VLAN     = 1 << 1,  /* VLAN id. */
-    OFPFW_DL_VLAN_PCP = 1 << 2,  /* VLAN priority. */
-    OFPFW_DL_TYPE     = 1 << 3,  /* Ethernet frame type. */
-    OFPFW_NW_TOS      = 1 << 4,  /* IP ToS (DSCP field, 6 bits). */
-    OFPFW_NW_PROTO    = 1 << 5,  /* IP protocol. */
-    OFPFW_TP_SRC      = 1 << 6,  /* TCP/UDP/SCTP source port. */
-    OFPFW_TP_DST      = 1 << 7,  /* TCP/UDP/SCTP destination port. */
-    OFPFW_MPLS_LABEL  = 1 << 8,  /* MPLS label. */
-    OFPFW_MPLS_TC     = 1 << 9,  /* MPLS TC. */
-
-    /* Wildcard all fields. */
-    OFPFW_ALL           = ((1 << 10) - 1)
-};
-
-/* The wildcards for ICMP type and code fields use the transport source
- * and destination port fields, respectively. */
-#define OFPFW_ICMP_TYPE OFPFW_TP_SRC
-#define OFPFW_ICMP_CODE OFPFW_TP_DST
-
-/* Values below this cutoff are 802.3 packets and the two bytes
- * following MAC addresses are used as a frame length.  Otherwise, the
- * two bytes are used as the Ethernet type.
+/* ## -------------------------- ## */
+/* ## OpenFlow Extensible Match. ## */
+/* ## -------------------------- ## */
+
+/* The match type indicates the match structure (set of fields that compose the
+ * match) in use. The match type is placed in the type field at the beginning
+ * of all match structures. The "OpenFlow Extensible Match" type corresponds
+ * to OXM TLV format described below and must be supported by all OpenFlow
+ * switches. Extensions that define other match types may be published on the
+ * OpenFlow wiki. Support for extensions is optional.
  */
-#define OFP_DL_TYPE_ETH2_CUTOFF   0x0600
+enum ofp_match_type {
+    OFPMT_STANDARD,           /* Deprecated. */
+    OFPMT_OXM,		      /* OpenFlow Extensible Match */
+};
 
-/* Value of dl_type to indicate that the frame does not include an
- * Ethernet type.
+/* Fields to match against flows */
+struct ofp_match {
+    uint16_t type;             /* One of OFPMT_* */
+    uint16_t length;           /* Length of ofp_match */
+    /* Followed by:
+     *   - Exactly match_len (possibly 0) bytes containing OXM TLVs, then
+     *   - Exactly (match_len + 7)/8*8 - match_len (between 0 and 7) bytes of
+     *     all-zero bytes
+     */
+};
+OFP_ASSERT(sizeof(struct ofp_match) == 4);
+
+#define OXM_HEADER__(EXPERIMENTER, FIELD, HASMASK, LENGTH) \
+    (((EXPERIMENTER) << 16) | ((FIELD) << 9) | ((HASMASK) << 8) | (LENGTH))
+#define OXM_HEADER(EXPERIMENTER, FIELD, LENGTH) \
+    OXM_HEADER__(EXPERIMENTER, FIELD, 0, LENGTH)
+#define OXM_HEADER_W(EXPERIMENTER, FIELD, LENGTH) \
+    OXM_HEADER__(EXPERIMENTER, FIELD, 1, (LENGTH) * 2)
+#define OXM_EXPERIMENTER(HEADER) ((HEADER) >> 16)
+#define OXM_FIELD(HEADER) (((HEADER) >> 9) & 0x7f)
+#define OXM_TYPE(HEADER) (((HEADER) >> 9) & 0x7fffff)
+#define OXM_HASMASK(HEADER) (((HEADER) >> 8) & 1)
+#define OXM_LENGTH(HEADER) ((HEADER) & 0xff)
+
+#define OXM_MAKE_WILD_HEADER(HEADER) \
+        OXM_HEADER_W(OXM_EXPERIMENTER(HEADER), OXM_FIELD(HEADER), OXM_LENGTH(HEADER))
+
+/* Physical or virtual port on which the packet was received.
+ *
+ * Prereqs: None.
+ *
+ * Format: 16-bit integer in network byte order.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_IN_PORT    OXM_HEADER  (0x0000,  0, 2)
+
+/* Table metadata.
+ *
+ * Prereqs: None.
+ *
+ * Format: 64-bit integer in network byte order.
+ *
+ * Masking: Arbitrary masks.
  */
-#define OFP_DL_TYPE_NOT_ETH_TYPE  0x05ff
+#define OXM_OF_METADATA   OXM_HEADER  (0x0000,  1, 8)
+#define OXM_OF_METADATA_W OXM_HEADER_W(0x0000,  1, 8)
+
+/* Source or destination address in Ethernet header.
+ *
+ * Prereqs: None.
+ *
+ * Format: 48-bit Ethernet MAC address.
+ *
+ * Masking: The nxm_mask patterns 01:00:00:00:00:00 and FE:FF:FF:FF:FF:FF must
+ *   be supported for OXM_OF_ETH_DST_W (as well as the trivial patterns that
+ *   are all-0-bits or all-1-bits).  Support for other patterns and for masking
+ *   of OXM_OF_ETH_SRC is optional. */
+#define OXM_OF_ETH_DST    OXM_HEADER  (0x0000,  2, 6)
+#define OXM_OF_ETH_DST_W  OXM_HEADER_W(0x0000,  2, 6)
+#define OXM_OF_ETH_SRC    OXM_HEADER  (0x0000,  3, 6)
+
+/* Packet's Ethernet type.
+ *
+ * Prereqs: None.
+ *
+ * Format: 16-bit integer in network byte order.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_ETH_TYPE   OXM_HEADER  (0x0000,  4, 2)
 
 /* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate
  * special conditions.
@@ -642,63 +695,244 @@
 /* Define for compatibility */
 #define OFP_VLAN_NONE      OFPVID_NONE
 
-/* The match type indicates the match structure (set of fields that compose the
- * match) in use. The match type is placed in the type field at the beginning
- * of all match structures. The "standard" type corresponds to ofp_match and
- * must be supported by all OpenFlow switches. Extensions that define other
- * match types may be published on the OpenFlow wiki. Support for extensions is
- * optional.
+/* 802.1Q VID.
+ *
+ * For a packet with an 802.1Q header, this is the VLAN-ID (VID) from the
+ * outermost tag.  For a packet with no 802.1Q header, this has value
+ * OFPVID_NONE.
+ *
+ * Prereqs: None.
+ *
+ * Format: 16-bit integer in network byte order.
+ *
+ * Masking: Arbitrary masks.
+ *
+ * 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 VID value.
+ *
+ *   - Testing for an exact match with OFPVID_NONE matches only packets
+ *     without an 802.1Q header.
+ *
+ *   - Testing for an exact match with OFPVID_ANY matches only packets
+ *     with an 802.1Q header that has any VID value.
+ *
+ *   - Testing for an exact match with a VID value matches packets
+ *     that have an 802.1Q header with a specified VID.
  */
-enum ofp_match_type {
-    OFPMT_STANDARD,           /* The match fields defined in the ofp_match
-                                 structure apply */
-};
+#define OXM_OF_VLAN_VID   OXM_HEADER  (0x0000,  5, 2)
+#define OXM_OF_VLAN_VID_W OXM_HEADER_W(0x0000,  5, 2)
 
-/* Size/length of STANDARD match */
-#define OFPMT_STANDARD_LENGTH   88
-
-/* Fields to match against flows */
-struct ofp_match {
-    uint16_t type;             /* One of OFPMT_* */
-    uint16_t length;           /* Length of ofp_match */
-    uint32_t in_port;          /* Input switch port. */
-    uint32_t wildcards;        /* Wildcard fields. */
-    uint8_t dl_src[OFP_ETH_ALEN]; /* Ethernet source address. */
-    uint8_t dl_src_mask[OFP_ETH_ALEN]; /* Ethernet source address mask. */
-    uint8_t dl_dst[OFP_ETH_ALEN]; /* Ethernet destination address. */
-    uint8_t dl_dst_mask[OFP_ETH_ALEN]; /* Ethernet destination address mask. */
-    uint16_t dl_vlan;          /* Input VLAN id. */
-    uint8_t dl_vlan_pcp;       /* Input VLAN priority. */
-    uint8_t pad1[1];           /* Align to 32-bits */
-    uint16_t dl_type;          /* Ethernet frame type. */
-    uint8_t nw_tos;            /* IP ToS (actually DSCP field, 6 bits). */
-    uint8_t nw_proto;          /* IP protocol or lower 8 bits of
-                                * ARP opcode. */
-    uint32_t nw_src;           /* IP source address. */
-    uint32_t nw_src_mask;      /* IP source address mask. */
-    uint32_t nw_dst;           /* IP destination address. */
-    uint32_t nw_dst_mask;      /* IP destination address mask. */
-    uint16_t tp_src;           /* TCP/UDP/SCTP source port. */
-    uint16_t tp_dst;           /* TCP/UDP/SCTP destination port. */
-    uint32_t mpls_label;       /* MPLS label. */
-    uint8_t mpls_tc;           /* MPLS TC. */
-    uint8_t pad2[3];           /* Align to 64-bits */
-    uint64_t metadata;         /* Metadata passed between tables. */
-    uint64_t metadata_mask;    /* Mask for metadata. */
-};
-OFP_ASSERT(sizeof(struct ofp_match) == OFPMT_STANDARD_LENGTH);
-
-/* The match fields for ICMP type and code use the transport source and
- * destination port fields, respectively. */
-#define icmp_type tp_src
-#define icmp_code tp_dst
-
-/* Value used in "idle_timeout" and "hard_timeout" to indicate that the entry
- * is permanent. */
-#define OFP_FLOW_PERMANENT 0
+/* 802.1Q PCP.
+ *
+ * For a packet with an 802.1Q header, this is the VLAN-PCP from the
+ * outermost tag.  For a packet with no 802.1Q header, this has value
+ * 0.
+ *
+ * Prereqs: None.
+ *
+ * Format: 8-bit integer in network byte order.
+ *
+ * Masking: Arbitrary masks.
+ */
+#define OXM_OF_VLAN_PCP   OXM_HEADER  (0x0000,  6, 2)
+#define OXM_OF_VLAN_PCP_W OXM_HEADER_W(0x0000,  6, 2)
 
-/* By default, choose a priority in the middle. */
-#define OFP_DEFAULT_PRIORITY 0x8000
+/* The "type of service" byte of the IP header, with the ECN bits forced to 0.
+ *
+ * Prereqs: OXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd.
+ *
+ * Format: 8-bit integer with 2 least-significant bits forced to 0.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_IP_TOS     OXM_HEADER  (0x0000,  7, 1)
+
+/* The "protocol" byte in the IP header.
+ *
+ * Prereqs: OXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd.
+ *
+ * Format: 8-bit integer.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_IP_PROTO   OXM_HEADER  (0x0000,  8, 1)
+
+/* The source or destination address in the IP header.
+ *
+ * Prereqs: OXM_OF_ETH_TYPE must match 0x0800 exactly.
+ *
+ * Format: 32-bit integer in network byte order.
+ *
+ * Masking: Arbitrary masks.
+ */
+#define OXM_OF_IPV4_SRC     OXM_HEADER  (0x0000,  9, 4)
+#define OXM_OF_IPV4_SRC_W   OXM_HEADER_W(0x0000,  9, 4)
+#define OXM_OF_IPV4_DST     OXM_HEADER  (0x0000, 10, 4)
+#define OXM_OF_IPV4_DST_W   OXM_HEADER_W(0x0000, 10, 4)
+
+/* The source or destination port in the TCP header.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd.
+ *   OXM_OF_IP_PROTO must match 6 exactly.
+ *
+ * Format: 16-bit integer in network byte order.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_TCP_SRC    OXM_HEADER  (0x0000, 11, 2)
+#define OXM_OF_TCP_DST    OXM_HEADER  (0x0000, 12, 2)
+
+/* The source or destination port in the UDP header.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match either 0x0800 or 0x86dd.
+ *   OXM_OF_IP_PROTO must match 17 exactly.
+ *
+ * Format: 16-bit integer in network byte order.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_UDP_SRC    OXM_HEADER  (0x0000, 13, 2)
+#define OXM_OF_UDP_DST    OXM_HEADER  (0x0000, 14, 2)
+
+/* The source or destination port in the SCTP header.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match either 0x0800 or 0x86dd.
+ *   OXM_OF_IP_PROTO must match 132 exactly.
+ *
+ * Format: 16-bit integer in network byte order.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_SCTP_SRC   OXM_HEADER  (0x0000, 15, 2)
+#define OXM_OF_SCTP_DST   OXM_HEADER  (0x0000, 16, 2)
+
+/* The type or code in the ICMP header.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match 0x0800 exactly.
+ *   OXM_OF_IP_PROTO must match 1 exactly.
+ *
+ * Format: 8-bit integer.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_ICMPV4_TYPE  OXM_HEADER  (0x0000, 17, 1)
+#define OXM_OF_ICMPV4_CODE  OXM_HEADER  (0x0000, 18, 1)
+
+/* 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.
+ *
+ * Prereqs: OXM_OF_ETH_TYPE must match 0x0806 exactly.
+ *
+ * Format: 16-bit integer in network byte order.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_ARP_OP     OXM_HEADER  (0x0000, 19, 2)
+
+/* For an Ethernet+IP ARP packet, the source or target protocol address
+ * in the ARP header.  Always 0 otherwise.
+ *
+ * Prereqs: OXM_OF_ETH_TYPE must match 0x0806 exactly.
+ *
+ * Format: 32-bit integer in network byte order.
+ *
+ * Masking: Only CIDR masks are allowed, that is, masks that consist of N
+ *   high-order bits set to 1 and the other 32-N bits set to 0. */
+#define OXM_OF_ARP_SPA    OXM_HEADER  (0x0000, 20, 4)
+#define OXM_OF_ARP_SPA_W  OXM_HEADER_W(0x0000, 20, 4)
+#define OXM_OF_ARP_TPA    OXM_HEADER  (0x0000, 21, 4)
+#define OXM_OF_ARP_TPA_W  OXM_HEADER_W(0x0000, 21, 4)
+
+/* For an Ethernet+IP ARP packet, the source or target hardware address
+ * in the ARP header.  Always 0 otherwise.
+ *
+ * Prereqs: OXM_OF_ETH_TYPE must match 0x0806 exactly.
+ *
+ * Format: 48-bit Ethernet MAC address.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_ARP_SHA    OXM_HEADER  (0x0000, 22, 6)
+#define OXM_OF_ARP_THA    OXM_HEADER  (0x0000, 23, 6)
+
+/* The source or destination address in the IPv6 header.
+ *
+ * Prereqs: OXM_OF_ETH_TYPE must match 0x86dd exactly.
+ *
+ * Format: 128-bit IPv6 address.
+ *
+ * Masking: Only CIDR masks are allowed, that is, masks that consist of N
+ *   high-order bits set to 1 and the other 128-N bits set to 0. */
+#define OXM_OF_IPV6_SRC    OXM_HEADER  (0x0000, 24, 16)
+#define OXM_OF_IPV6_SRC_W  OXM_HEADER_W(0x0000, 24, 16)
+#define OXM_OF_IPV6_DST    OXM_HEADER  (0x0000, 25, 16)
+#define OXM_OF_IPV6_DST_W  OXM_HEADER_W(0x0000, 25, 16)
+
+/* The type or code in the ICMPv6 header.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
+ *   OXM_OF_IP_PROTO must match 58 exactly.
+ *
+ * Format: 8-bit integer.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_ICMPV6_TYPE OXM_HEADER  (0x0000, 26, 1)
+#define OXM_OF_ICMPV6_CODE OXM_HEADER  (0x0000, 27, 1)
+
+/* The target address in an IPv6 Neighbor Discovery message.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
+ *   OXM_OF_IP_PROTO must match 58 exactly.
+ *   OXM_OF_ICMPV6_TYPE must be either 135 or 136.
+ *
+ * Format: 128-bit IPv6 address.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_IPV6_ND_TARGET OXM_HEADER  (0x0000, 28, 16)
+
+/* The source link-layer address option in an IPv6 Neighbor Discovery
+ * message.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
+ *   OXM_OF_IP_PROTO must match 58 exactly.
+ *   OXM_OF_ICMPV6_TYPE must be exactly 135.
+ *
+ * Format: 48-bit Ethernet MAC address.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_IPV6_ND_SLL OXM_HEADER  (0x0000, 29, 6)
+
+/* The target link-layer address option in an IPv6 Neighbor Discovery
+ * message.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
+ *   OXM_OF_IP_PROTO must match 58 exactly.
+ *   OXM_OF_ICMPV6_TYPE must be exactly 136.
+ *
+ * Format: 48-bit Ethernet MAC address.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_IPV6_ND_TLL      OXM_HEADER  (0x0000, 30, 6)
+
+/* The LABEL and TC in the first MPLS shim header.
+ *
+ * Prereqs:
+ *   OXM_OF_ETH_TYPE must match 0x8847 or 0x8848 exactly.
+ *
+ * Format: 32-bit and 8-bit integer.
+ *
+ * Masking: Not maskable. */
+#define OXM_OF_MPLS_LABEL  OXM_HEADER  (0x0000, 31, 4)
+#define OXM_OF_MPLS_TC     OXM_HEADER  (0x0000, 32, 1)
+
+/* ## ------------- ## */
+/* ## Instructions. ## */
+/* ## ------------- ## */
 
 enum ofp_instruction_type {
     OFPIT_GOTO_TABLE = 1,       /* Setup the next table in the lookup
@@ -762,6 +996,13 @@
 };
 OFP_ASSERT(sizeof(struct ofp_instruction_experimenter) == 8);
 
+/* Value used in "idle_timeout" and "hard_timeout" to indicate that the entry
+ * is permanent. */
+#define OFP_FLOW_PERMANENT 0
+
+/* By default, choose a priority in the middle. */
+#define OFP_DEFAULT_PRIORITY 0x8000
+
 enum ofp_flow_mod_flags {
     OFPFF_SEND_FLOW_REM = 1 << 0,  /* Send flow removed message when flow
                                     * expires or is deleted. */
@@ -799,10 +1040,10 @@
                                      indicates no restriction. */
     uint16_t flags;               /* One of OFPFF_*. */
     uint8_t pad[2];
-    struct ofp_match match;       /* Fields to match */
-    struct ofp_instruction instructions[0]; /* Instruction set */
+    struct ofp_match match;       /* Fields to match. Variable size. */
+    //struct ofp_instruction instructions[0]; /* Instruction set */
 };
-OFP_ASSERT(sizeof(struct ofp_flow_mod) == 136);
+OFP_ASSERT(sizeof(struct ofp_flow_mod) == 48);
 
 /* Group numbering. Groups can use any number up to OFPG_MAX. */
 enum ofp_group {
@@ -883,9 +1124,9 @@
     uint16_t hard_timeout;    /* Hard timeout from original flow mod. */
     uint64_t packet_count;
     uint64_t byte_count;
-    struct ofp_match match;   /* Description of fields. */
+    struct ofp_match match;   /* Description of fields. Variable size. */
 };
-OFP_ASSERT(sizeof(struct ofp_flow_removed) == 136);
+OFP_ASSERT(sizeof(struct ofp_flow_removed) == 48);
 
 /* Values for 'type' in ofp_error_message.  These values are immutable: they
  * will not change in future versions of the protocol (although new values may
@@ -1178,9 +1419,9 @@
     uint64_t cookie_mask;     /* Mask used to restrict the cookie bits that
                                  must match. A value of 0 indicates
                                  no restriction. */
-    struct ofp_match match;   /* Fields to match. */
+    struct ofp_match match;   /* Fields to match. Variable size. */
 };
-OFP_ASSERT(sizeof(struct ofp_flow_stats_request) == 120);
+OFP_ASSERT(sizeof(struct ofp_flow_stats_request) == 32);
 
 /* Body of reply to OFPST_FLOW request. */
 struct ofp_flow_stats {
@@ -1198,10 +1439,10 @@
     uint64_t cookie;          /* Opaque controller-issued identifier. */
     uint64_t packet_count;    /* Number of packets in flow. */
     uint64_t byte_count;      /* Number of bytes in flow. */
-    struct ofp_match match;   /* Description of fields. */
-    struct ofp_instruction instructions[0]; /* Instruction set. */
+    struct ofp_match match;   /* Description of fields. Variable size. */
+    //struct ofp_instruction instructions[0]; /* Instruction set. */
 };
-OFP_ASSERT(sizeof(struct ofp_flow_stats) == 136);
+OFP_ASSERT(sizeof(struct ofp_flow_stats) == 48);
 
 /* Body for ofp_stats_request of type OFPST_AGGREGATE. */
 struct ofp_aggregate_stats_request {
@@ -1220,9 +1461,9 @@
     uint64_t cookie_mask;     /* Mask used to restrict the cookie bits that
                                  must match. A value of 0 indicates
                                  no restriction. */
-    struct ofp_match match;   /* Fields to match. */
+    struct ofp_match match;   /* Fields to match. Variable size. */
 };
-OFP_ASSERT(sizeof(struct ofp_aggregate_stats_request) == 120);
+OFP_ASSERT(sizeof(struct ofp_aggregate_stats_request) == 32);
 
 /* Body of reply to OFPST_AGGREGATE request. */
 struct ofp_aggregate_stats_reply {
@@ -1235,25 +1476,39 @@
 
 /* Flow match fields. */
 enum ofp_flow_match_fields {
-    OFPFMF_IN_PORT     = 1 << 0,  /* Switch input port. */
-    OFPFMF_DL_VLAN     = 1 << 1,  /* VLAN id. */
-    OFPFMF_DL_VLAN_PCP = 1 << 2,  /* VLAN priority. */
-    OFPFMF_DL_TYPE     = 1 << 3,  /* Ethernet frame type. */
-    OFPFMF_NW_TOS      = 1 << 4,  /* IP ToS (DSCP field, 6 bits). */
-    OFPFMF_NW_PROTO    = 1 << 5,  /* IP protocol. */
-    OFPFMF_TP_SRC      = 1 << 6,  /* TCP/UDP/SCTP source port. */
-    OFPFMF_TP_DST      = 1 << 7,  /* TCP/UDP/SCTP destination port. */
-    OFPFMF_MPLS_LABEL  = 1 << 8,  /* MPLS label. */
-    OFPFMF_MPLS_TC     = 1 << 9,  /* MPLS TC. */
-    OFPFMF_TYPE        = 1 << 10, /* Match type. */
-    OFPFMF_DL_SRC      = 1 << 11, /* Ethernet source address. */
-    OFPFMF_DL_DST      = 1 << 12, /* Ethernet destination address. */
-    OFPFMF_NW_SRC      = 1 << 13, /* IP source address. */
-    OFPFMF_NW_DST      = 1 << 14, /* IP destination address. */
-    OFPFMF_METADATA    = 1 << 15, /* Metadata passed between tables. */
-
-    /* Support all fields. */
-    OFPFMF_ALL         = ((1 << 16) - 1)
+    OFPFMF_OF_IN_PORT     = 1 << 0,  /* Switch input port. */
+    OFPFMF_OF_METADATA    = 1 << 1,  /* Metadata passed between tables. */
+    OFPFMF_OF_ETH_DST     = 1 << 2,  /* Ethernet destination address. */
+    OFPFMF_OF_ETH_SRC     = 1 << 3,  /* Ethernet source address. */
+    OFPFMF_OF_ETH_TYPE    = 1 << 4,  /* Ethernet frame type. */
+    OFPFMF_OF_VLAN_VID    = 1 << 5,  /* VLAN id. */
+    OFPFMF_OF_VLAN_PCP    = 1 << 6,  /* VLAN priority. */
+    OFPFMF_OF_IP_TOS      = 1 << 7,  /* IP ToS (DSCP field, 6 bits). */
+    OFPFMF_OF_IP_PROTO    = 1 << 8,  /* IP protocol. */
+    OFPFMF_OF_IPV4_SRC    = 1 << 9,  /* IPv4 source address. */
+    OFPFMF_OF_IPV4_DST    = 1 << 10, /* IPv4 destination address. */
+    OFPFMF_OF_TCP_SRC     = 1 << 11, /* TCP source port. */
+    OFPFMF_OF_TCP_DST     = 1 << 12, /* TCP destination port. */
+    OFPFMF_OF_UDP_SRC     = 1 << 13, /* UDP source port. */
+    OFPFMF_OF_UDP_DST     = 1 << 14, /* UDP destination port. */
+    OFPFMF_OF_SCTP_SRC    = 1 << 15, /* SCTP source port. */
+    OFPFMF_OF_SCTP_DST    = 1 << 16, /* SCTP destination port. */
+    OFPFMF_OF_ICMPV4_TYPE = 1 << 17, /* ICMP type. */
+    OFPFMF_OF_ICMPV4_CODE = 1 << 18, /* ICMP code. */
+    OFPFMF_OF_ARP_OP      = 1 << 19, /* ARP opcode. */
+    OFPFMF_OF_ARP_SPA     = 1 << 20, /* ARP source IPv4 address. */
+    OFPFMF_OF_ARP_TPA     = 1 << 21, /* ARP target IPv4 address. */
+    OFPFMF_OF_ARP_SHA     = 1 << 22, /* ARP source hardware address. */
+    OFPFMF_OF_ARP_THA     = 1 << 23, /* ARP target hardware address. */
+    OFPFMF_OF_IPV6_SRC    = 1 << 24, /* IPv6 source address. */
+    OFPFMF_OF_IPV6_DST    = 1 << 25, /* IPv6 destination address. */
+    OFPFMF_OF_ICMPV6_TYPE = 1 << 26, /* ICMP type. */
+    OFPFMF_OF_ICMPV6_CODE = 1 << 27, /* ICMP code. */
+    OFPFMF_OF_IPV6_ND_TARGET = 1 << 28, /* Target address for ND. */
+    OFPFMF_OF_IPV6_ND_SLL = 1 << 29, /* Source link-layer for ND. */
+    OFPFMF_OF_IPV6_ND_TLL = 1 << 30, /* Target link-layer for ND. */
+    OFPFMF_OF_MPLS_LABEL  = 1 << 31, /* MPLS label. */
+    OFPFMF_OF_MPLS_TC     = 1 << 32, /* MPLS TC. */
 };
 
 /* Body of reply to OFPST_TABLE request. */
@@ -1262,9 +1517,9 @@
                                 are consulted first. */
     uint8_t pad[7];          /* Align to 64-bits. */
     char name[OFP_MAX_TABLE_NAME_LEN];
-    uint32_t wildcards;      /* Bitmap of OFPFMF_* wildcards that are
+    uint64_t wildcards;      /* Bitmap of OFPFMF_* wildcards that are
                                 supported by the table. */
-    uint32_t match;          /* Bitmap of OFPFMF_* that indicate the fields
+    uint64_t match;          /* Bitmap of OFPFMF_* that indicate the fields
                                 the table can match on. */
     uint64_t metadata_match; /* Bits of metadata table can match. */
     uint64_t metadata_write; /* Bits of metadata table can write. */
@@ -1279,7 +1534,7 @@
     uint64_t lookup_count;   /* Number of packets looked up in table. */
     uint64_t matched_count;  /* Number of packets that hit table. */
 };
-OFP_ASSERT(sizeof(struct ofp_table_stats) == 104);
+OFP_ASSERT(sizeof(struct ofp_table_stats) == 112);
 
 /* Body for ofp_stats_request of type OFPST_PORT. */
 struct ofp_port_stats_request {
