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' --- ChangeLog | 1 + configure.in | 2 +- src/conntrack.c | 13 ++++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0bea030..6d4759a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ o fix missing `-g' and `-n' options in getopt_long control string o add support for secmark (requires Linux kernel >= 2.6.25) o add mark and secmark information to the manpage o cleanup error message +o add support for -E -o xml,timestamp = conntrackd = o Remove window tracking disabling limitation (requires Linux kernel >= 2.6.22) diff --git a/configure.in b/configure.in index 78d88bd..75c6898 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ esac dnl Dependencies LIBNFNETLINK_REQUIRED=0.0.25 -LIBNETFILTER_CONNTRACK_REQUIRED=0.0.87 +LIBNETFILTER_CONNTRACK_REQUIRED=0.0.88 PKG_CHECK_MODULES(LIBNFNETLINK, libnfnetlink >= $LIBNFNETLINK_REQUIRED,, AC_MSG_ERROR(Cannot find libnfnetlink >= $LIBNFNETLINK_REQUIRED)) 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