summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commitc9de420557cdf546f09defbff3d5f682c01250aa (patch)
tree1a12ac269d4d04bed9324ac5d5aab8df67df925c
parent7ccad5da5585ac22877d1eb1c0ddc935176e827f (diff)
downloadconntrack-tools-c9de420557cdf546f09defbff3d5f682c01250aa.tar.gz
conntrack-tools-c9de420557cdf546f09defbff3d5f682c01250aa.zip
add support for `conntrack -E -o xml,timestamp'
-rw-r--r--ChangeLog1
-rw-r--r--configure.in2
-rw-r--r--src/conntrack.c13
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);