aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/netif/osmux.h8
-rw-r--r--src/osmux.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h
index 2ee845c..03da1b6 100644
--- a/include/osmocom/netif/osmux.h
+++ b/include/osmocom/netif/osmux.h
@@ -45,6 +45,14 @@ struct osmux_in_handle {
uint8_t osmux_seq;
uint8_t batch_factor;
uint16_t batch_size;
+
+ struct {
+ uint32_t input_rtp_msgs;
+ uint32_t output_osmux_msgs;
+ uint64_t input_rtp_bytes;
+ uint64_t output_osmux_bytes;
+ } stats;
+
void (*deliver)(struct msgb *msg, void *data);
void *data;
char *internal_data; /* internal data to store batch */
diff --git a/src/osmux.c b/src/osmux.c
index b699cd1..8ff5274 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -327,6 +327,10 @@ void osmux_xfrm_input_deliver(struct osmux_in_handle *h)
LOGP(DLMIB, LOGL_DEBUG, "invoking delivery function\n");
batch_msg = osmux_build_batch(h);
+
+ h->stats.output_osmux_msgs++;
+ h->stats.output_osmux_bytes += batch_msg->len;
+
h->deliver(batch_msg, h->data);
osmo_timer_del(&batch->timer);
batch->remaining_bytes = h->batch_size;
@@ -536,6 +540,9 @@ int osmux_xfrm_input(struct osmux_in_handle *h, struct msgb *msg, int ccid)
if (ret < 0)
return 0;
+ h->stats.input_rtp_msgs++;
+ h->stats.input_rtp_bytes += msg->len;
+
if (first_rtp_msg) {
LOGP(DLMIB, LOGL_DEBUG,
"osmux start timer batch\n");