diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-13 16:14:17 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-13 16:14:17 +0000 |
commit | c9de420557cdf546f09defbff3d5f682c01250aa (patch) | |
tree | 1a12ac269d4d04bed9324ac5d5aab8df67df925c /src/conntrack.c | |
parent | 7ccad5da5585ac22877d1eb1c0ddc935176e827f (diff) | |
download | conntrack-tools-c9de420557cdf546f09defbff3d5f682c01250aa.tar.gz conntrack-tools-c9de420557cdf546f09defbff3d5f682c01250aa.zip |
add support for `conntrack -E -o xml,timestamp'
Diffstat (limited to 'src/conntrack.c')
-rw-r--r-- | src/conntrack.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/conntrack.c b/src/conntrack.c index fa6ae0a..20d86f9 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -591,11 +591,14 @@ static int event_cb(enum nf_conntrack_msg_type type, output_type = NFCT_O_XML; if (output_mask & _O_EXT) output_flags = NFCT_OF_SHOW_LAYER3; - if ((output_mask & _O_TMS) && !(output_mask & _O_XML)) { - struct timeval tv; - gettimeofday(&tv, NULL); - printf("[%-8ld.%-6ld]\t", tv.tv_sec, tv.tv_usec); - } + if (output_mask & _O_TMS) { + if (!(output_mask & _O_XML)) { + struct timeval tv; + gettimeofday(&tv, NULL); + printf("[%-8ld.%-6ld]\t", tv.tv_sec, tv.tv_usec); + } else + output_flags |= NFCT_OF_TIME; + } nfct_snprintf(buf, 1024, ct, type, output_type, output_flags); printf("%s\n", buf); |