aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2013-12-04 17:07:51 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-18 12:09:47 +0100
commit2bf6f6e8759fdb8924ff9d7159197a2a340c4461 (patch)
tree5da744043647a68f5e73c83581e8b65e5fbf6375
parent4df5f1d8f07c54542a8d7f577957632fa6c67314 (diff)
bts: Add methods to BTS to track octets sent over the downlink
-rw-r--r--src/bts.cpp17
-rw-r--r--src/bts.h4
2 files changed, 21 insertions, 0 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 69e5ad40..d2417cc1 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -100,6 +100,7 @@ BTS::BTS()
: m_cur_fn(0)
, m_pollController(*this)
, m_sba(*this)
+ , m_dl_octets_sent(0)
{
memset(&m_bts, 0, sizeof(m_bts));
INIT_LLIST_HEAD(&m_bts.ul_tbfs);
@@ -512,6 +513,22 @@ void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi)
bitvec_free(immediate_assignment);
}
+/* Counts the number of octets sent over the downlink */
+void BTS::dl_octets_sent(size_t octets)
+{
+ m_dl_octets_sent += octets;
+}
+
+/* Counts the number of octets sent over the downlink */
+size_t BTS::dl_octets_sent_reset()
+{
+ size_t octets;
+
+ octets = m_dl_octets_sent;
+ m_dl_octets_sent = 0;
+
+ return octets;
+}
/*
* PDCH code below. TODO: move to a separate file
diff --git a/src/bts.h b/src/bts.h
index 924e2e1e..923a6ed2 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -223,6 +223,9 @@ public:
void llc_frame_sched();
void rach_frame();
+ void dl_octets_sent(size_t octets);
+ size_t dl_octets_sent_reset();
+
/*
* Below for C interface for the VTY
*/
@@ -235,6 +238,7 @@ private:
SBAController m_sba;
TimingAdvance m_ta;
struct rate_ctr_group *m_ratectrs;
+ size_t m_dl_octets_sent;
private:
/* disable copying to avoid slicing */