From 70c0d26675194ba66cb3c3d5c6af5bdbdf8504f1 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sat, 11 Mar 2017 14:31:41 +0100 Subject: doc: Document boolean type and applications Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- doc/nft.xml | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) (limited to 'doc') diff --git a/doc/nft.xml b/doc/nft.xml index 990b9368..de86d2a1 100644 --- a/doc/nft.xml +++ b/doc/nft.xml @@ -1329,6 +1329,110 @@ filter output ip6 daddr ::1 + + + Boolean type + + + + + + + + + + Name + Keyword + Size + Base type + + + + + Boolean + boolean + 1 bit + integer + + + +
+
+ + The boolean type is a syntactical helper type in user space. + It's use is in the right-hand side of a (typically implicit) + relational expression to change the expression on the left-hand + side into a boolean check (usually for existence). + + + The following keywords will automatically resolve into a boolean + type with given value: + + + + + + + Keyword + Value + + + + + exists + 1 + + + missing + 0 + + + +
+
+ + Boolean specification + + The following expressions support a boolean comparison: + + + + + + + Expression + Behaviour + + + + + fib + Check route existence. + + + exthdr + Check IPv6 extension header existence. + + + tcp option + Check TCP option header existence. + + + +
+
+ +# match if route exists +filter input fib iif saddr exists + +# match only non-fragmented packets in IPv6 traffic +filter input exthdr frag missing + +# match if TCP timestamp option is present +filter input tcp option timestamp exists + +
+
@@ -2535,6 +2639,36 @@ inet filter meta nfproto ipv6 output rt nexthop fd00::1 tcp_option_field + + The following syntaxes are valid only in a relational expression + with boolean type on right-hand side for checking header existence only: + + + exthdr + + hbh + frag + rt + dst + mh + + + + tcp option + + eol + noop + maxseg + window + sack-permitted + sack + sack0 + sack1 + sack2 + sack3 + timestamp + + IPv6 extension headers -- cgit v1.2.3