summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-21 19:39:39 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-21 19:39:39 +0100
commit7b3f57d5007dd2cf4127c2c3a9a7cd0f64d5d6e9 (patch)
treeaf5056d1a50fc62e640508c735114c3c4157ab0e /include
parentb666e6ebbd0c0ae7967ff8167790166858544297 (diff)
downloadconntrack-tools-7b3f57d5007dd2cf4127c2c3a9a7cd0f64d5d6e9.tar.gz
conntrack-tools-7b3f57d5007dd2cf4127c2c3a9a7cd0f64d5d6e9.zip
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 <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/conntrackd.h18
1 files changed, 15 insertions, 3 deletions
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