From f179e8af468c573d4a643fcd38980e0beeeecdbc Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org" Date: Wed, 5 Oct 2005 16:33:52 +0000 Subject: o Fix up counters o Fix up compilation (IPS_* stuff missing), still need a proper fix --- ChangeLog | 6 ++++++ include/libct_proto.h | 7 +++++++ src/conntrack.c | 2 +- src/libct.c | 6 ++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87daa18..f9b93a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-05 + + 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 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])); } -- cgit v1.2.3