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
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index 7724ebb..c77fc05 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 @@
 
 	/* 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 @@
 	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;