aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-pcap
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-08-19 19:15:39 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-08-19 19:23:00 +0200
commit99526a6ad07c02e40e0831fd952974c5b7446f31 (patch)
tree9bc1fe1e69567224ed7c85e23a9ecc9b1c184bfc /include/osmo-pcap
parentc3455dcb7951069dab99effae71aac2a14961823 (diff)
server: Add global and per client counters and begin to count
Add the basics for getting a picture what a client and the server is doing. We need to create unique descriptions as the code is working with names and not numbers for clients. Change-Id: I4a9be5bdd815d280cccf0199efc2ca79fc77d393
Diffstat (limited to 'include/osmo-pcap')
-rw-r--r--include/osmo-pcap/osmo_pcap_server.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/osmo-pcap/osmo_pcap_server.h b/include/osmo-pcap/osmo_pcap_server.h
index 5af0838..a386a2a 100644
--- a/include/osmo-pcap/osmo_pcap_server.h
+++ b/include/osmo-pcap/osmo_pcap_server.h
@@ -1,7 +1,7 @@
/*
* osmo-pcap-server code
*
- * (C) 2011 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2011-2016 by Holger Hans Peter Freyther <holger@moiji-mobile.com>
* (C) 2011 by On-Waves
* All Rights Reserved
*
@@ -36,6 +36,9 @@
#include <time.h>
+struct rate_ctr_group;
+struct rate_ctr_group_desc;
+
struct osmo_pcap_server;
@@ -44,6 +47,21 @@ struct osmo_pcap_server;
#define SERVER_MAX_DATA_SIZE 10000
+enum {
+ PEER_CTR_CONNECT,
+ PEER_CTR_BYTES,
+ PEER_CTR_PKTS,
+ PEER_CTR_PROTATE,
+};
+
+enum {
+ SERVER_CTR_CONNECT,
+ SERVER_CTR_BYTES,
+ SERVER_CTR_PKTS,
+ SERVER_CTR_PROTATE,
+ SERVER_CTR_NOCLIENT,
+};
+
struct osmo_pcap_conn {
/* list of connections */
struct llist_head entry;
@@ -72,6 +90,9 @@ struct osmo_pcap_conn {
int reopen;
char buf[SERVER_MAX_DATA_SIZE + sizeof(struct osmo_pcap_data)];
struct osmo_pcap_data *data;
+
+ /* statistics */
+ struct rate_ctr_group *ctrg;
};
struct osmo_pcap_server {
@@ -89,9 +110,13 @@ struct osmo_pcap_server {
char *base_path;
off_t max_size;
+
+ /* statistics */
+ struct rate_ctr_group *ctrg;
};
extern struct osmo_pcap_server *pcap_server;
+extern const struct rate_ctr_group_desc pcap_peer_group_desc;
void osmo_pcap_server_reopen(struct osmo_pcap_server *server);
int osmo_pcap_server_listen(struct osmo_pcap_server *server);