]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: py: add test cases for md5sig, fastopen and mptcp mnemonics
authorFlorian Westphal <fw@strlen.de>
Sun, 21 Nov 2021 22:33:14 +0000 (23:33 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 1 Dec 2021 13:11:39 +0000 (14:11 +0100)
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/py/any/tcpopt.t
tests/py/any/tcpopt.t.json
tests/py/any/tcpopt.t.payload

index d3586eae8399a1a16e025d4ea3ed338ac325cf11..343c76e49a6ef0c7a752cae1c8e73b01ecb41eb8 100644 (file)
@@ -46,3 +46,7 @@ tcp option window exists;ok
 tcp option window missing;ok
 
 tcp option maxseg size set 1360;ok
+
+tcp option md5sig exists;ok
+tcp option fastopen exists;ok
+tcp option mptcp exists;ok
index 5468accb16b40eaa1046cceba28885b8c6a0374b..5c63fd6b2a5650023267d32a37192437db26802e 100644 (file)
         }
     }
 ]
+
+# tcp option md5sig exists
+[
+    {
+        "match": {
+            "left": {
+                "tcp option": {
+                    "name": "md5sig"
+                }
+            },
+            "op": "==",
+            "right": true
+        }
+    }
+]
+
+# tcp option fastopen exists
+[
+    {
+        "match": {
+            "left": {
+                "tcp option": {
+                    "name": "fastopen"
+                }
+            },
+            "op": "==",
+            "right": true
+        }
+    }
+]
+
+# tcp option mptcp exists
+[
+    {
+        "match": {
+            "left": {
+                "tcp option": {
+                    "name": "mptcp"
+                }
+            },
+            "op": "==",
+            "right": true
+        }
+    }
+]
index d88bcd433a10f0667b780745bf4fde8b41c6472a..7ad19183d4e7d6e18025844125171c14a3995d24 100644 (file)
@@ -153,3 +153,17 @@ inet
   [ immediate reg 1 0x00005005 ]
   [ exthdr write tcpopt reg 1 => 2b @ 2 + 2 ]
 
+# tcp option md5sig exists
+inet
+  [ exthdr load tcpopt 1b @ 19 + 0 present => reg 1 ]
+  [ cmp eq reg 1 0x00000001 ]
+
+# tcp option fastopen exists
+inet
+  [ exthdr load tcpopt 1b @ 34 + 0 present => reg 1 ]
+  [ cmp eq reg 1 0x00000001 ]
+
+# tcp option mptcp exists
+inet
+  [ exthdr load tcpopt 1b @ 30 + 0 present => reg 1 ]
+  [ cmp eq reg 1 0x00000001 ]