From 7b3f57d5007dd2cf4127c2c3a9a7cd0f64d5d6e9 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 21 Dec 2008 19:39:39 +0100 Subject: src: add network statistics via `-s network' This patch adds networks statistics that you can check via `conntrackd -s network'. This information is useful for trouble-shooting. This patch replaces several log messages that can be triggered in runtime. The idea behind this patch is to avoid log message flooding under errors. Signed-off-by: Pablo Neira Ayuso --- include/conntrackd.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/conntrackd.h b/include/conntrackd.h index 3b5620e..7199985 100644 --- a/include/conntrackd.h +++ b/include/conntrackd.h @@ -26,6 +26,7 @@ #define DUMP_EXT_XML 25 /* dump external cache in XML */ #define RESET_TIMERS 26 /* reset kernel timers */ #define DEBUG_INFO 27 /* show debug info (if any) */ +#define STATS_NETWORK 28 /* extended network stats */ #define DEFAULT_CONFIGFILE "/etc/conntrackd/conntrackd.conf" #define DEFAULT_LOCKFILE "/var/lock/conntrackd.lock" @@ -109,7 +110,6 @@ struct ct_general_state { struct fds *fds; /* statistics */ - uint64_t malformed; uint64_t bytes[NFCT_DIR_MAX]; uint64_t packets[NFCT_DIR_MAX]; }; @@ -126,10 +126,22 @@ struct ct_sync_state { struct sync_mode *sync; /* sync mode */ + /* statistics */ + struct { + uint64_t msg_rcv_malformed; + uint32_t msg_rcv_bad_version; + uint32_t msg_rcv_bad_payload; + uint32_t msg_rcv_bad_header; + uint32_t msg_rcv_bad_type; + uint32_t msg_rcv_truncated; + uint32_t msg_rcv_bad_size; + uint32_t msg_snd_malformed; + uint64_t msg_rcv_lost; + uint64_t msg_rcv_before; + } error; + uint32_t last_seq_sent; /* last sequence number sent */ uint32_t last_seq_recv; /* last sequence number recv */ - uint64_t packets_replayed; /* number of replayed packets */ - uint64_t packets_lost; /* lost packets: sequence tracking */ }; #define STATE_STATS(x) state.stats->x -- cgit v1.2.3