# actions=set_tunnel64:0x885f3298
ffff 0018 00002320 0009 000000000000 00000000885f3298
-# bad OF1.0 actions: OFPBIC_UNSUP_INST
+# bad OpenFlow10 actions: OFPBIC_UNSUP_INST
& ofp_actions|WARN|write_metadata instruction not allowed here
ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff
-# bad OF1.0 actions: OFPBIC_UNSUP_INST
+# bad OpenFlow10 actions: OFPBIC_UNSUP_INST
& ofp_actions|WARN|write_metadata instruction not allowed here
ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffff0000ffff0000
AT_CAPTURE_FILE([expout])
AT_CAPTURE_FILE([experr])
AT_CHECK(
- [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-actions < input.txt],
+ [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow10 < input.txt],
[0], [expout], [experr])
AT_CLEANUP
AT_CAPTURE_FILE([expout])
AT_CAPTURE_FILE([experr])
AT_CHECK(
- [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-instructions < input.txt],
+ [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-instructions OpenFlow10 < input.txt],
[0], [expout], [experr])
AT_CLEANUP
dnl Write-Metadata is only allowed in contexts that allow instructions.
& ofp_actions|WARN|write_metadata instruction not allowed here
-# bad OF1.1 actions: OFPBIC_UNSUP_INST
+# bad OpenFlow11 actions: OFPBIC_UNSUP_INST
ffff 0020 00002320 0016 000000000000 fedcba9876543210 ffffffffffffffff
# actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[])
# actions=exit
ffff 0010 00002320 0011 000000000000
-dnl NXAST_DEC_TTL
-# actions=dec_ttl
-ffff 0010 00002320 0012 000000000000
-
dnl OpenFlow 1.1 OFPAT_DEC_TTL
# actions=dec_ttl
0018 0008 00000000
AT_CAPTURE_FILE([expout])
AT_CAPTURE_FILE([experr])
AT_CHECK(
- [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-actions < input.txt],
+ [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow11 < input.txt],
[0], [expout], [experr])
AT_CLEANUP
0004 0008 00000000
dnl Duplicate instruction type:
-# bad OF1.1 instructions: OFPBIC_DUP_INST
+# bad OpenFlow11 instructions: OFPBIC_DUP_INST
0004 0008 00000000 0004 0008 00000000
dnl Instructions not multiple of 8 in length.
& ofp_actions|WARN|OpenFlow message instructions length 9 is not a multiple of 8
-# bad OF1.1 instructions: OFPBIC_BAD_LEN
+# bad OpenFlow11 instructions: OFPBIC_BAD_LEN
0004 0009 01 00000000
dnl Goto-Table instruction too long.
-# bad OF1.1 instructions: OFPBIC_BAD_LEN
+# bad OpenFlow11 instructions: OFPBIC_BAD_LEN
0001 0010 01 000000 0000000000000000
dnl Goto-Table 1 instruction non-zero padding
0001 0008 01 000001
dnl Goto-Table 1 instruction go back to the previous table.
-# bad OF1.1 instructions: OFPBRC_BAD_TABLE_ID
+# bad OpenFlow11 instructions: OFPBIC_BAD_TABLE_ID
2,0001 0008 01 000000
dnl Goto-Table 1
0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00
dnl Write-Metadata too short.
-# bad OF1.1 instructions: OFPBIC_BAD_LEN
+# bad OpenFlow11 instructions: OFPBIC_BAD_LEN
0002 0010 00000000 fedcba9876543210
dnl Write-Metadata too long.
-# bad OF1.1 instructions: OFPBIC_BAD_LEN
+# bad OpenFlow11 instructions: OFPBIC_BAD_LEN
0002 0020 00000000 fedcba9876543210 ffffffffffffffff 0000000000000000
dnl Write-Metadata duplicated.
-# bad OF1.1 instructions: OFPBIC_DUP_INST
+# bad OpenFlow11 instructions: OFPBIC_DUP_INST
0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00 0002 0018 00000000 fedcba9876543210 ff00ff00ff00ff00
dnl Write-Metadata in wrong position (OpenFlow 1.1+ disregards the order
0003 0008 00000000
dnl Clear-Actions too-long
-# bad OF1.1 instructions: OFPBIC_BAD_LEN
+# bad OpenFlow11 instructions: OFPBIC_BAD_LEN
0005 0010 00000000 0000000000000000
dnl Clear-Actions non-zero padding
0005 0008 00000000
dnl Experimenter actions not supported yet.
-# bad OF1.1 instructions: OFPBIC_BAD_EXPERIMENTER
+# bad OpenFlow11 instructions: OFPBIC_BAD_EXPERIMENTER
ffff 0008 01 000000
dnl Bad instruction number (0 not assigned).
-# bad OF1.1 instructions: OFPBIC_UNKNOWN_INST
+# bad OpenFlow11 instructions: OFPBIC_UNKNOWN_INST
0000 0008 01 000000
])
AT_CAPTURE_FILE([expout])
AT_CAPTURE_FILE([experr])
AT_CHECK(
- [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-instructions < input.txt],
+ [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-instructions OpenFlow11 < input.txt],
+ [0], [expout], [experr])
+AT_CLEANUP
+
+dnl Our primary goal here is to verify OpenFlow 1.2-specific changes,
+dnl so the list of tests is short.
+AT_SETUP([OpenFlow 1.2 action translation])
+AT_KEYWORDS([ofp-actions OF1.2])
+AT_DATA([test-data], [dnl
+# actions=LOCAL
+0000 0010 fffffffe 04d2 000000000000
+
+# bad OpenFlow12 actions: OFPBAC_BAD_SET_MASK
+& ofp_actions|WARN|bad action at offset 0 (OFPBAC_BAD_SET_MASK):
+& 00000000 00 19 00 18 80 00 09 0c-00 00 00 00 12 34 00 00
+& 00000010 00 00 ff ff 00 00 00 00-
+0019 0018 8000090c 000000001234 00000000ffff 00000000
+
+])
+sed '/^[[#&]]/d' < test-data > input.txt
+sed -n 's/^# //p; /^$/p' < test-data > expout
+sed -n 's/^& //p' < test-data > experr
+AT_CAPTURE_FILE([input.txt])
+AT_CAPTURE_FILE([expout])
+AT_CAPTURE_FILE([experr])
+AT_CHECK(
+ [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow12 < input.txt],
+ [0], [expout], [experr])
+AT_CLEANUP
+
+dnl Our primary goal here is to verify that OpenFlow 1.5-specific changes,
+dnl so the list of tests is short.
+AT_SETUP([OpenFlow 1.5 action translation])
+AT_KEYWORDS([ofp-actions OF1.5])
+AT_DATA([test-data], [dnl
+# actions=LOCAL
+0000 0010 fffffffe 04d2 000000000000
+
+# actions=move:NXM_OF_IN_PORT[]->NXM_OF_VLAN_TCI[]
+001c 0018 0010 0000 0000 0008 00000002 00000802 00000000
+
+# actions=set_field:00:00:00:00:12:34/00:00:00:00:ff:ff->eth_src
+0019 0018 8000090c 000000001234 00000000ffff 00000000
+
+])
+sed '/^[[#&]]/d' < test-data > input.txt
+sed -n 's/^# //p; /^$/p' < test-data > expout
+sed -n 's/^& //p' < test-data > experr
+AT_CAPTURE_FILE([input.txt])
+AT_CAPTURE_FILE([expout])
+AT_CAPTURE_FILE([experr])
+AT_CHECK(
+ [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-actions OpenFlow15 < input.txt],
[0], [expout], [experr])
AT_CLEANUP