From: Ander Juaristi <a@juaristi.eus>
To: netfilter-devel@vger.kernel.org
Cc: Ander Juaristi <a@juaristi.eus>
Subject: [PATCH v5 3/3] nft: Update documentation
Date: Sun, 7 Jul 2019 22:55:31 +0200 [thread overview]
Message-ID: <20190707205531.6628-3-a@juaristi.eus> (raw)
In-Reply-To: <20190707205531.6628-1-a@juaristi.eus>
Signed-off-by: Ander Juaristi <a@juaristi.eus>
---
doc/nft.txt | 6 +++++-
doc/primary-expression.txt | 27 +++++++++++++++++++++++++--
src/main.c | 2 +-
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/doc/nft.txt b/doc/nft.txt
index 3f1074b..b7a8ee8 100644
--- a/doc/nft.txt
+++ b/doc/nft.txt
@@ -9,7 +9,7 @@ nft - Administration tool of the nftables framework for packet filtering and cla
SYNOPSIS
--------
[verse]
-*nft* [ *-nNscaeSupyj* ] [ *-I* 'directory' ] [ *-f* 'filename' | *-i* | 'cmd' ...]
+*nft* [ *-nNscaeSupyjt* ] [ *-I* 'directory' ] [ *-f* 'filename' | *-i* | 'cmd' ...]
*nft* *-h*
*nft* *-v*
@@ -93,6 +93,10 @@ For a full summary of options, run *nft --help*.
Read input from an interactive readline CLI. You can use quit to exit, or use the EOF marker,
normally this is CTRL-D.
+*-t*::
+*--seconds*::
+ Show time, day and hour values in seconds.
+
INPUT FILE FORMATS
------------------
LEXICAL CONVENTIONS
diff --git a/doc/primary-expression.txt b/doc/primary-expression.txt
index 6eb9583..cef2afc 100644
--- a/doc/primary-expression.txt
+++ b/doc/primary-expression.txt
@@ -2,7 +2,7 @@ META EXPRESSIONS
~~~~~~~~~~~~~~~~
[verse]
*meta* {*length* | *nfproto* | *l4proto* | *protocol* | *priority*}
-[*meta*] {*mark* | *iif* | *iifname* | *iiftype* | *oif* | *oifname* | *oiftype* | *skuid* | *skgid* | *nftrace* | *rtclassid* | *ibrname* | *obrname* | *pkttype* | *cpu* | *iifgroup* | *oifgroup* | *cgroup* | *random* | *ipsec* | *iifkind* | *oifkind*}
+[*meta*] {*mark* | *iif* | *iifname* | *iiftype* | *oif* | *oifname* | *oiftype* | *skuid* | *skgid* | *nftrace* | *rtclassid* | *ibrname* | *obrname* | *pkttype* | *cpu* | *iifgroup* | *oifgroup* | *cgroup* | *random* | *ipsec* | *iifkind* | *oifkind* | *time* | *hour* | *day* }
A meta expression refers to meta data associated with a packet.
@@ -115,7 +115,16 @@ boolean (1 bit)
|iifkind|
Input interface kind |
|oifkind|
-Output interface kind
+Output interface kind|
+|time|
+Absolute time of packet reception|
+Integer (32 bit) or string
+|day|
+Day of week|
+Integer (8 bit) or string
+|hour|
+Hour of day|
+String
|====================
.Meta expression specific types
@@ -141,6 +150,20 @@ Packet type: *host* (addressed to local host), *broadcast* (to all),
*multicast* (to group), *other* (addressed to another host).
|ifkind|
Interface kind (16 byte string). Does not have to exist.
+|time|
+Either an integer or a date in ISO format. For example: "2019-06-06 17:00".
+Hour and seconds are optional and can be omitted if desired. If omitted,
+midnight will be assumed.
+The following three would be equivalent: "2019-06-06", "2019-06-06 00:00"
+and "2019-06-06 00:00:00".
+When an integer is given, it is assumed to be a UNIX timestamp.
+|day|
+Either a day of week ("Monday", "Tuesday", etc.), or an integer between 0 and 6.
+Strings are matched case-insensitively, and a full match is not expected (e.g. "Mon" would match "Monday").
+When an integer is given, 0 is Sunday and 6 is Saturday.
+|hour|
+A string representing an hour in 24-hour format. Seconds can optionally be specified.
+For example, 17:00 and 17:00:00 would be equivalent.
|=============================
.Using meta expressions
diff --git a/src/main.c b/src/main.c
index 73036a9..ab0d4e2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -148,7 +148,7 @@ static void show_help(const char *name)
" -a, --handle Output rule handle.\n"
" -e, --echo Echo what has been added, inserted or replaced.\n"
" -I, --includepath <directory> Add <directory> to the paths searched for include files. Default is: %s\n"
-" -t, --seconds Show hour values in seconds since midnight.\n"
+" -t, --seconds Show time, day and hour values in seconds.\n"
" --debug <level [,level...]> Specify debugging level (scanner, parser, eval, netlink, mnl, proto-ctx, segtree, all)\n"
"\n",
name, DEFAULT_INCLUDE_PATH);
--
2.17.1
next prev parent reply other threads:[~2019-07-07 20:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-07 20:55 [PATCH v5 1/3] meta: Introduce new conditions 'time', 'day' and 'hour' Ander Juaristi
2019-07-07 20:55 ` [PATCH v5 2/3] tests/py: Add tests for " Ander Juaristi
2019-07-14 23:20 ` Florian Westphal
2019-07-07 20:55 ` Ander Juaristi [this message]
2019-07-14 23:19 ` [PATCH v5 1/3] meta: Introduce new conditions " Florian Westphal
2019-07-14 23:34 ` Florian Westphal
2019-07-18 12:56 ` Ander Juaristi
2019-07-18 13:41 ` Florian Westphal
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=20190707205531.6628-3-a@juaristi.eus \
--to=a@juaristi.eus \
--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).