summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-09-03 21:53:45 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-09-03 21:53:45 +0200
commit02c1cb4ce21dca6cc63545cd5bd7ed621ed61529 (patch)
tree7c953fbb9c062936b66f63a8d95b5702da7ece8e /src/fastd.h
parentf0fa4e0c9085e0b4476b144185040ce9fbdc11e3 (diff)
downloadfastd-02c1cb4ce21dca6cc63545cd5bd7ed621ed61529.tar
fastd-02c1cb4ce21dca6cc63545cd5bd7ed621ed61529.zip
Add packet/byte statistics
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/fastd.h b/src/fastd.h
index dcb35b4..1fe639e 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -161,6 +161,11 @@ struct fastd_peer_group {
unsigned n_connections;
};
+struct fastd_stats {
+ uint64_t packets;
+ uint64_t bytes;
+};
+
struct fastd_config {
struct timespec long_ago;
@@ -294,6 +299,12 @@ struct fastd_context {
fastd_socket_t *sock_default_v4;
fastd_socket_t *sock_default_v6;
+ fastd_stats_t rx;
+
+ fastd_stats_t tx;
+ fastd_stats_t tx_dropped;
+ fastd_stats_t tx_error;
+
#ifdef USE_CRYPTO_AES128CTR
fastd_crypto_aes128ctr_context_t *crypto_aes128ctr;
#endif
@@ -316,7 +327,7 @@ struct fastd_string_stack {
};
-void fastd_send(fastd_context_t *ctx, const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_buffer_t buffer);
+void fastd_send(fastd_context_t *ctx, const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_buffer_t buffer, size_t stat_size);
void fastd_send_all(fastd_context_t *ctx, fastd_peer_t *source_peer, fastd_buffer_t buffer);
void fastd_send_handshake(fastd_context_t *ctx, const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_buffer_t buffer);
void fastd_receive(fastd_context_t *ctx, fastd_socket_t *sock);