[PATCH nft] test: py: Add test cases for socket matching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Máté Eckl <ecklm94@xxxxxxxxx>
---
 tests/py/inet/socket.t         |  7 +++++++
 tests/py/inet/socket.t.payload | 15 +++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 tests/py/inet/socket.t
 create mode 100644 tests/py/inet/socket.t.payload

diff --git a/tests/py/inet/socket.t b/tests/py/inet/socket.t
new file mode 100644
index 0000000..03ecaa8
--- /dev/null
+++ b/tests/py/inet/socket.t
@@ -0,0 +1,7 @@
+:sockchain;type filter hook prerouting priority -150
+
+*ip;sockip4;sockchain
+*ip6;sockip6;sockchain
+*inet;sockin;sockchain
+
+socket transparent 1;ok
diff --git a/tests/py/inet/socket.t.payload b/tests/py/inet/socket.t.payload
new file mode 100644
index 0000000..37d009c
--- /dev/null
+++ b/tests/py/inet/socket.t.payload
@@ -0,0 +1,15 @@
+# socket transparent 1
+ip sockip4 sockchain 
+  [ socket load transparent => reg 1 ]
+  [ cmp eq reg 1 0x00000001 ]
+
+# socket transparent 1
+ip6 sockip6 sockchain 
+  [ socket load transparent => reg 1 ]
+  [ cmp eq reg 1 0x00000001 ]
+
+# socket transparent 1
+inet sockin sockchain 
+  [ socket load transparent => reg 1 ]
+  [ cmp eq reg 1 0x00000001 ]
+
-- 
ecklm

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux