diff options
author | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-10-05 16:33:52 +0000 |
---|---|---|
committer | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-10-05 16:33:52 +0000 |
commit | f179e8af468c573d4a643fcd38980e0beeeecdbc (patch) | |
tree | 55aa7d9278cdd7a6f9b6054bd3408b19b078c354 | |
parent | 2b90455785ce4d4b304407994e379068df80aefd (diff) | |
download | conntrack-tools-f179e8af468c573d4a643fcd38980e0beeeecdbc.tar.gz conntrack-tools-f179e8af468c573d4a643fcd38980e0beeeecdbc.zip |
o Fix up counters
o Fix up compilation (IPS_* stuff missing), still need a proper fix
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | include/libct_proto.h | 7 | ||||
-rw-r--r-- | src/conntrack.c | 2 | ||||
-rw-r--r-- | src/libct.c | 6 |
4 files changed, 18 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2005-10-05 +<pablo@netfilter.org> + o Fix up counters + o Fix up compilation (IPS_* stuff missing), still need a proper fix + o Bumped version number to 0.82 + 2005-09-24 <laforge@netfilter.org> o Get rid of C++ style comments diff --git a/include/libct_proto.h b/include/libct_proto.h index 8849a3e..b358e1a 100644 --- a/include/libct_proto.h +++ b/include/libct_proto.h @@ -9,6 +9,13 @@ #define LIBCT_VERSION "0.1.0" +/* FIXME: These should be independent from kernel space */ +#define IPS_ASSURED (1 << 2) +#define IPS_SEEN_REPLY (1 << 1) +#define IPS_SRC_NAT_DONE (1 << 7) +#define IPS_DST_NAT_DONE (1 << 8) +#define IPS_CONFIRMED (1 << 3) + struct cta_proto; struct ctproto_handler { diff --git a/src/conntrack.c b/src/conntrack.c index 3731d0e..1d5227e 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -48,7 +48,7 @@ #include "libct_proto.h" #define PROGNAME "conntrack" -#define VERSION "0.81" +#define VERSION "0.82" #if 0 #define DEBUGP printf diff --git a/src/libct.c b/src/libct.c index 01307f2..16ec4db 100644 --- a/src/libct.c +++ b/src/libct.c @@ -134,16 +134,18 @@ static void parse_counters(struct nfattr *attr, struct ctnl_conntrack *ct, enum ctattr_type parent) { struct nfattr *tb[CTA_COUNTERS_MAX]; + int dir = (parent == CTA_COUNTERS_ORIG ? CTNL_DIR_REPLY + : CTNL_DIR_ORIGINAL); memset(tb, 0, CTA_COUNTERS_MAX*sizeof(struct nfattr *)); nfnl_parse_nested(tb, CTA_COUNTERS_MAX, attr); if (tb[CTA_COUNTERS_PACKETS-1]) - ct->counters[CTNL_DIR_ORIGINAL].packets + ct->counters[dir].packets = __be64_to_cpu(*(u_int64_t *) NFA_DATA(tb[CTA_COUNTERS_PACKETS-1])); if (tb[CTA_COUNTERS_BYTES-1]) - ct->counters[CTNL_DIR_ORIGINAL].bytes + ct->counters[dir].bytes = __be64_to_cpu(*(u_int64_t *) NFA_DATA(tb[CTA_COUNTERS_BYTES-1])); } |