From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shivani Bhardwaj Subject: [PATCH v4] doc: Complete documentation of statements Date: Fri, 29 Jul 2016 16:12:17 +0530 Message-ID: <1469788937-4432-1-git-send-email-shivanib134@gmail.com> To: netfilter-devel@vger.kernel.org Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:35601 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123AbcG2Kma (ORCPT ); Fri, 29 Jul 2016 06:42:30 -0400 Received: by mail-pf0-f193.google.com with SMTP id h186so5267434pfg.2 for ; Fri, 29 Jul 2016 03:42:30 -0700 (PDT) Received: from localhost.localdomain ([116.202.38.105]) by smtp.gmail.com with ESMTPSA id s12sm23813002pfj.73.2016.07.29.03.42.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jul 2016 03:42:29 -0700 (PDT) Sender: netfilter-devel-owner@vger.kernel.org List-ID: Add documentation corresponding to LOG STATEMENT, REJECT STATEMENT, COUNTER STATEMENT, META STATEMENT, LIMIT STATEMENT, NAT STATEMENT, QUEUE STATEMENT. Signed-off-by: Shivani Bhardwaj --- Changes in v4: Fix the syntax as per parser_bison Changes in v3: Correct meta fields, use lowercase statement names, merge nflog with log. Changes in v2: Add more content to the description. doc/nft.xml | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 237 insertions(+), 2 deletions(-) diff --git a/doc/nft.xml b/doc/nft.xml index ea47e2b..d2f106b 100644 --- a/doc/nft.xml +++ b/doc/nft.xml @@ -2191,36 +2191,271 @@ filter input iif eth0 drop Log statement + + log + + prefix + level + group + snaplen + queue-threshold + + - + + The log statement enables logging of matching packets. When this statement is used from a rule, the Linux kernel will print some information on all matching packets, such as header fields, via the kernel log (where it can be read with dmesg(1) or read in the syslog). This is a non-terminating statement, so the rule evaluation continues after the packet is logged. It is necessary to mention the group [default 0] to consider logging with nflog. + + log statement + + + + + + + Keyword + Description + Type + + + + + level + Level of logging + unsigned integer (32 bit), emerg, alert, crit, err, warn [default], notice, info, debug + + + prefix + Prefix log messages + string + + + group + Netlink group to send messages to + unsigned integer (32 bit) + + + snaplen + Length of payload to include in netlink message + unsigned integer (32 bit) + + + queue-threshold + Queue threshold value + unsigned integer (32 bit) + + + +
+
+ Reject statement + A reject statement is used to send back an error packet in response to the matched packet otherwise it is equivalent to drop so it is a terminating statement, ending rule traversal. This statement is only valid in the input, forward and output chains, and user-defined chains which are only called from those chains. + + reject statement (ipv4) + + + + + + + Keyword + Description + Type + + + + + with icmp type + ICMP response to be sent to the host + unsigned integer (8 bit), net-unreachable, host-unreachable, prot-unreachable, port-unreachable [default], net-prohibited, host-prohibited, admin-prohibited + + + with + Used on rules which only match the TCP + tcp reset + + + +
+ + reject statement (ipv6) + + + + + + + Keyword + Description + Type + + + + + with icmpv6 type + ICMP6 response to be sent to the host + unsigned integer (8 bit), no-route, admin-prohibited, addr-unreachable, port-unreachable [default], policy-fail, reject-route + + + with + Used on rules which only match the TCP + tcp reset + + + +
Counter statement + A counter statement sets the hit count of packets along with the number of bytes. Meta statement + A meta statement sets the value of a meta expression. + The existing meta fields are: priority, mark, pkttype, nftrace. Limit statement + + limit + rate + rate + SLASH + time_unit + burst limit_burst BURST_TYPE + + + + A limit statement is used to set a specified limit attribute. + + limit statement + + + + + + + Keyword + Description + Type + + + + + rate + Maximum average matching rate + size (bytes, kbytes, mbytes)/time (second, minute, hour, day, week) + + + burst + Maximum initial number of packets + packets, size (bytes, kbytes, mbytes) + + + +
- + NAT statement + + + snat + dnat + + flags + + + + The nat statement is only valid from nat chain types. It specifies that the source/destination address of the packet should be modified (and all future packets in this connection will also be mangled), and rules should cease being examined. + + + + nat statement + + + + + + + Keyword + Description + Type + + + + + snat + Specifies that the source address of the packet should be modified + ipv4 address/ipv6 address + + + dnat + Specifies that the destination address of the packet should be modified + ipv4 address/ipv6 address + + + flags + Flags + random, fully-random, persistent + + + +
Queue statement + + queue + num + queue_num + flags + + + + + queue statement + + + + + + + Keyword + Description + Type + + + + + num + Sets queue number + unsigned integer (16 bit) + + + flags + Flags + bypass, fanout + + + total + Sets total load-balanced queues + unsigned integer (16 bit) + + + +
-- 2.7.4