diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2013-08-30 08:50:22 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2013-09-05 15:38:59 (GMT) |
commit | 56d2bbe173b41913cf4b701d812ce2d39a86612c (patch) | |
tree | f1a3f32009450adf444534b1f63e9241a2a7ec39 /include/netlink-private | |
parent | 8a4f16b5bffd32c53af1eb273b657273a794c18e (diff) | |
download | libnl-56d2bbe173b41913cf4b701d812ce2d39a86612c.zip libnl-56d2bbe173b41913cf4b701d812ce2d39a86612c.tar.gz libnl-56d2bbe173b41913cf4b701d812ce2d39a86612c.tar.bz2 |
netfilter/ct: support optional CTA_TIMESTAMP attribute
Recent kernels support conntrack time stamping, which is a helpful
feature to determine the duration of a flow without building a flow
cache in your user space application, just to keep the 'start' time of
your flow.
Timestamps are recorded with nanosecond resolution once this feature
is enabled.
This patch adds optional support for the CTA_TIMESTAMP, then
modifies the dump routine to write that info in a format similar
to /proc/net/nf_conntrack. This is an example output when using
NL_DUMP_LINE:
udp 10.128.128.28:56836 <-> 10.128.129.255:8612 delta-time 30
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'include/netlink-private')
-rw-r--r-- | include/netlink-private/netlink.h | 2 | ||||
-rw-r--r-- | include/netlink-private/types.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/netlink-private/netlink.h b/include/netlink-private/netlink.h index 2e511bf..2315e71 100644 --- a/include/netlink-private/netlink.h +++ b/include/netlink-private/netlink.h @@ -67,6 +67,8 @@ #include <netlink-private/cache-api.h> #include <netlink-private/types.h> +#define NSEC_PER_SEC 1000000000L + struct trans_tbl { int i; const char *a; diff --git a/include/netlink-private/types.h b/include/netlink-private/types.h index 05a6a45..ab5eea4 100644 --- a/include/netlink-private/types.h +++ b/include/netlink-private/types.h @@ -19,6 +19,7 @@ #include <netlink/route/rtnl.h> #include <netlink/route/route.h> #include <netlink/idiag/idiagnl.h> +#include <netlink/netfilter/ct.h> #include <netlink-private/route/tc-api.h> #define NL_SOCK_BUFSIZE_SET (1<<0) @@ -794,6 +795,8 @@ struct nfnl_ct { struct nfnl_ct_dir ct_orig; struct nfnl_ct_dir ct_repl; + + struct nfnl_ct_timestamp ct_tstamp; }; union nfnl_exp_protodata { |