From: Fernando Fernandez Mancera <ffmancera@riseup.net>
To: netfilter-devel@vger.kernel.org
Cc: Fernando Fernandez Mancera <ffmancera@riseup.net>
Subject: [PATCH nft v2 3/6] tests: py: add osf tests with versions
Date: Mon, 11 Mar 2019 16:14:14 +0100 [thread overview]
Message-ID: <20190311151417.17772-3-ffmancera@riseup.net> (raw)
In-Reply-To: <20190311151417.17772-1-ffmancera@riseup.net>
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
---
v1: initial patch
v2: flags type is now u32
---
tests/py/inet/osf.t | 4 +++
tests/py/inet/osf.t.json | 16 +++++++++
tests/py/inet/osf.t.payload | 66 +++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+)
diff --git a/tests/py/inet/osf.t b/tests/py/inet/osf.t
index fd5d9ed..c8cac9b 100644
--- a/tests/py/inet/osf.t
+++ b/tests/py/inet/osf.t
@@ -7,8 +7,12 @@
osf name "Linux";ok
osf ttl loose name "Linux";ok
osf ttl skip name "Linux";ok
+osf ttl skip name version "Linux:3.0";ok
+osf ttl skip name version "morethan:sixteenbytes";fail
osf ttl nottl name "Linux";fail
osf name "morethansixteenbytes";fail
osf name ;fail
osf name { "Windows", "MacOs" };ok
+osf name version { "Windows:XP", "MacOs:Sierra" };ok
ct mark set osf name map { "Windows" : 0x00000001, "MacOs" : 0x00000002 };ok
+ct mark set osf name version map { "Windows:XP" : 0x00000003, "MacOs:Sierra" : 0x00000004 };ok
diff --git a/tests/py/inet/osf.t.json b/tests/py/inet/osf.t.json
index 452f302..82a2638 100644
--- a/tests/py/inet/osf.t.json
+++ b/tests/py/inet/osf.t.json
@@ -45,6 +45,22 @@
}
]
+# osf name version "Linux:3.0"
+[
+ {
+ "match": {
+ "left": {
+ "osf": {
+ "key": "name",
+ "flags": "version"
+ }
+ },
+ "op": "==",
+ "right": "Linux:3.0"
+ }
+ }
+]
+
# osf name { "Windows", "MacOs" }
[
{
diff --git a/tests/py/inet/osf.t.payload b/tests/py/inet/osf.t.payload
index 9b8f0bc..8f708f2 100644
--- a/tests/py/inet/osf.t.payload
+++ b/tests/py/inet/osf.t.payload
@@ -43,6 +43,21 @@ inet osfinet osfchain
[ osf dreg 1 ]
[ cmp eq reg 1 0x756e694c 0x00000078 0x00000000 0x00000000 ]
+# osf ttl skip name version "Linux:3.0"
+ip osfip osfchain
+ [ osf dreg 1 ]
+ [ cmp eq reg 1 0x756e694c 0x2e333a78 0x00000030 0x00000000 ]
+
+# osf ttl skip name version "Linux:3.0"
+ip6 osfip6 osfchain
+ [ osf dreg 1 ]
+ [ cmp eq reg 1 0x756e694c 0x2e333a78 0x00000030 0x00000000 ]
+
+# osf ttl skip name version "Linux:3.0"
+inet osfinet osfchain
+ [ osf dreg 1 ]
+ [ cmp eq reg 1 0x756e694c 0x2e333a78 0x00000030 0x00000000 ]
+
# osf name { "Windows", "MacOs" }
__set%d osfip 3 size 2
__set%d osfip 0
@@ -67,6 +82,30 @@ inet osfinet osfchain
[ osf dreg 1 ]
[ lookup reg 1 set __set%d ]
+# osf name version { "Windows:XP", "MacOs:Sierra" }
+__set%d osfip 3 size 2
+__set%d osfip 0
+ element 646e6957 3a73776f 00005058 00000000 : 0 [end] element 4f63614d 69533a73 61727265 00000000 : 0 [end]
+ip osfip osfchain
+ [ osf dreg 1 ]
+ [ lookup reg 1 set __set%d ]
+
+# osf name version { "Windows:XP", "MacOs:Sierra" }
+__set%d osfip6 3 size 2
+__set%d osfip6 0
+ element 646e6957 3a73776f 00005058 00000000 : 0 [end] element 4f63614d 69533a73 61727265 00000000 : 0 [end]
+ip6 osfip6 osfchain
+ [ osf dreg 1 ]
+ [ lookup reg 1 set __set%d ]
+
+# osf name version { "Windows:XP", "MacOs:Sierra" }
+__set%d osfinet 3 size 2
+__set%d osfinet 0
+ element 646e6957 3a73776f 00005058 00000000 : 0 [end] element 4f63614d 69533a73 61727265 00000000 : 0 [end]
+inet osfinet osfchain
+ [ osf dreg 1 ]
+ [ lookup reg 1 set __set%d ]
+
# ct mark set osf name map { "Windows" : 0x00000001, "MacOs" : 0x00000002 }
__map%d osfip b size 2
__map%d osfip 0
@@ -93,3 +132,30 @@ inet osfinet osfchain
[ osf dreg 1 ]
[ lookup reg 1 set __map%d dreg 1 ]
[ ct set mark with reg 1 ]
+
+# ct mark set osf name version map { "Windows:XP" : 0x00000003, "MacOs:Sierra" : 0x00000004 }
+__map%d osfip b size 2
+__map%d osfip 0
+ element 646e6957 3a73776f 00005058 00000000 : 00000003 0 [end] element 4f63614d 69533a73 61727265 00000000 : 00000004 0 [end]
+ip osfip osfchain
+ [ osf dreg 1 ]
+ [ lookup reg 1 set __map%d dreg 1 ]
+ [ ct set mark with reg 1 ]
+
+# ct mark set osf name version map { "Windows:XP" : 0x00000003, "MacOs:Sierra" : 0x00000004 }
+__map%d osfip6 b size 2
+__map%d osfip6 0
+ element 646e6957 3a73776f 00005058 00000000 : 00000003 0 [end] element 4f63614d 69533a73 61727265 00000000 : 00000004 0 [end]
+ip6 osfip6 osfchain
+ [ osf dreg 1 ]
+ [ lookup reg 1 set __map%d dreg 1 ]
+ [ ct set mark with reg 1 ]
+
+# ct mark set osf name version map { "Windows:XP" : 0x00000003, "MacOs:Sierra" : 0x00000004 }
+__map%d osfinet b size 2
+__map%d osfinet 0
+ element 646e6957 3a73776f 00005058 00000000 : 00000003 0 [end] element 4f63614d 69533a73 61727265 00000000 : 00000004 0 [end]
+inet osfinet osfchain
+ [ osf dreg 1 ]
+ [ lookup reg 1 set __map%d dreg 1 ]
+ [ ct set mark with reg 1 ]
--
2.20.1
next prev parent reply other threads:[~2019-03-11 15:14 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 15:14 [PATCH nft v2 1/6] osf: add version fingerprint support Fernando Fernandez Mancera
2019-03-11 15:14 ` [PATCH nft v2 2/6] json: osf: add version json support Fernando Fernandez Mancera
2019-03-11 15:14 ` Fernando Fernandez Mancera [this message]
2019-03-11 15:14 ` [PATCH nft v2 4/6] doc: add osf version option to man page Fernando Fernandez Mancera
2019-03-11 15:14 ` [PATCH nft v2 5/6] files: osf: update pf.os with newer OS fingerprints Fernando Fernandez Mancera
2019-03-11 15:14 ` [PATCH nft v2 6/6] files: pf.os: merge the signatures spllited by version Fernando Fernandez Mancera
2019-03-13 9:44 ` [PATCH nft v2 1/6] osf: add version fingerprint support Phil Sutter
2019-03-13 10:14 ` Fernando Fernandez Mancera
2019-03-13 11:27 ` Phil Sutter
2019-03-13 14:15 ` Fernando Fernandez Mancera
2019-03-13 15:06 ` Phil Sutter
2019-03-13 15:22 ` Fernando Fernandez Mancera
2019-03-13 15:34 ` Phil Sutter
2019-03-13 16:46 ` Fernando Fernandez Mancera
2019-03-14 11:14 ` Fernando Fernandez Mancera
2019-03-14 13:58 ` Pablo Neira Ayuso
2019-03-14 17:34 ` Phil Sutter
2019-03-14 18:24 ` Fernando Fernandez Mancera
2019-03-15 10:03 ` Phil Sutter
2019-03-15 17:13 ` Pablo Neira Ayuso
2019-03-15 20:21 ` Fernando Fernandez Mancera
2019-03-16 9:05 ` Pablo Neira Ayuso
2019-03-17 17:10 ` Fernando Fernandez Mancera
2019-03-18 17:42 ` Phil Sutter
2019-03-19 11:06 ` Pablo Neira Ayuso
2019-03-20 13:46 ` Phil Sutter
2019-03-21 8:32 ` Pablo Neira Ayuso
2019-03-21 11:15 ` Phil Sutter
2019-03-21 11:18 ` Pablo Neira Ayuso
2019-03-21 14:06 ` Phil Sutter
2019-03-21 16:57 ` Pablo Neira Ayuso
2019-03-21 18:14 ` Phil Sutter
2019-03-14 20:07 ` Pablo Neira Ayuso
2019-03-14 20:13 ` [PATCH nft v2 1/6] osf: add version fingerprint supportg Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190311151417.17772-3-ffmancera@riseup.net \
--to=ffmancera@riseup.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).