]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
doc: libnftables-json: make the example valid libnftables JSON input
authorŠtěpán Němec <snemec@redhat.com>
Mon, 11 Oct 2021 11:59:04 +0000 (13:59 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 11 Oct 2021 16:31:28 +0000 (18:31 +0200)
- Add missing comma between array elements.
- Fix chain 'name' property.
- Match 'op' property is mandatory.

Fixes: 2e56f533b36a ("doc: Improve example in libnftables-json(5)")
Fixes: 90d4ee087171 ("JSON: Make match op mandatory, introduce 'in' operator")
Signed-off-by: Štěpán Němec <snemec@redhat.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
doc/libnftables-json.adoc

index c152dc055b50e6ee3bfe40f6d747ba46f6685d23..9cc17ff26306a8d89931751ae090a839b94c7a42 100644 (file)
@@ -91,14 +91,15 @@ translates into JSON as such:
        { "add": { "chain": {
                        "family": "inet",
                        "table": "mytable",
-                       "chain": "mychain"
-       }}}
+                       "name": "mychain"
+       }}},
        { "add": { "rule": {
                        "family": "inet",
                        "table": "mytable",
                        "chain": "mychain",
                        "expr": [
                                { "match": {
+                                       "op": "==",
                                        "left": { "payload": {
                                                        "protocol": "tcp",
                                                        "field": "dport"