aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_llc.c
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-07-05 11:04:27 +0200
committerHarald Welte <laforge@gnumonks.org>2016-08-27 01:27:43 +0000
commit4e699a9cbf418518265dc7b8b6b7fe250d87222d (patch)
treeecf5b476bd6e91498b529c51213a9ed7ae6777dc /openbsc/src/gprs/gprs_llc.c
parent76a0ad7fe93fce9bea56be5610b3bffbb8822887 (diff)
sgsn: add statistics counter for LLC packets
new counters are: llc.dl_bytes llc.ul_bytes llc.dl_packets llc.ul_packets The ip payload bytes are waiting for payload compression because those data are known then. Change-Id: I068376d35e84283cb98523cd3097a12c55cdb709
Diffstat (limited to 'openbsc/src/gprs/gprs_llc.c')
-rw-r--r--openbsc/src/gprs/gprs_llc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index 7724ebb5b..c77fc0580 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -29,6 +29,7 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/talloc.h>
+#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <openbsc/gsm_data.h>
@@ -331,6 +332,9 @@ int gprs_llc_tx_u(struct msgb *msg, uint8_t sapi, int command,
/* Identifiers passed down: (BVCI, NSEI) */
+ rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_PACKETS]);
+ rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_BYTES], msg->len);
+
/* Send BSSGP-DL-UNITDATA.req */
return _bssgp_tx_dl_ud(msg, NULL);
}
@@ -673,6 +677,9 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
if (rc < 0)
return rc;
+ rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_PACKETS]);
+ rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_BYTES], msg->len);
+
/* llhp.data is only set when we need to send LL_[UNIT]DATA_IND up */
if (llhp.cmd == GPRS_LLC_UI && llhp.data && llhp.data_len) {
msgb_gmmh(msg) = llhp.data;