# Invalid field number.
01020304(1111/2222)
])
-AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm < oxm.txt],
+AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt],
[0], [dnl
<any>
OXM_OF_IN_PORT(00000001), 01020304(1111/2222), OXM_OF_ETH_TYPE(0800)
])
-AT_CHECK([ovs-ofctl --strict parse-oxm < oxm.txt], [0], [dnl
+AT_CHECK([ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
nx_pull_match() returned error OFPBMC_BAD_FIELD
])
-AT_CHECK([ovs-ofctl parse-oxm < oxm.txt], [0], [dnl
+AT_CHECK([ovs-ofctl parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
])
AT_CLEANUP
+AT_SETUP([check TCP flags expression in OXM and NXM])
+# NXM/OXM input for matching on TCP flags.
+tcp_flags='OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)'
+
+# Check that marshaling into NXM gives all NXM headers.
+AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-nxm], [0],
+ [NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
+])
+
+# Check that marshaling in OXM for OF1.2 through OF1.4 gives OXM
+# headers except for TCP flags, which didn't have an OXM definition until
+# OF1.5.
+for version in OpenFlow12 OpenFlow13 OpenFlow14; do
+ AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm $version], [0],
+ [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
+])
+done
+
+# OpenFlow 1.5 added an OXM header for TCP flags:
+AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15], [0],
+ [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)
+])
+AT_CLEANUP
+
dnl Check all of the patterns mentioned in the "VLAN Matching" section
dnl in the DESIGN file at top level.
AT_SETUP([ovs-ofctl check-vlan])
[ovs-ofctl: ack: Each TCP flag can be specified only once
])
-AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
+AT_CHECK([ovs-appctl dpif/show | tail -n +4], [0], [dnl
p1 1/1: (dummy)
p2 2/2: (dummy)
])