From c9de420557cdf546f09defbff3d5f682c01250aa Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Sun, 13 Jan 2008 16:14:17 +0000 Subject: add support for `conntrack -E -o xml,timestamp' --- src/conntrack.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') 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); -- cgit v1.2.3