[osmo-pcu,2/5] tbf: Add ul and dl TBF types and allocate them in tbf_alloc()
diff mbox

Message ID 078bb713e1f00b0f2d045baa7fd4e0eb254cdf29.1405530272.git.daniel@totalueberwachung.de
State Accepted
Headers show

Commit Message

Daniel Willmann July 16, 2014, 5:04 p.m. UTC
Ticket: SYS#389
Sponsored-by: On-Waves ehf
---
 src/tbf.cpp | 6 +++++-
 src/tbf.h   | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

Patch
diff mbox

diff --git a/src/tbf.cpp b/src/tbf.cpp
index f913f97..39549f1 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -495,7 +495,11 @@  struct gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts,
 	if (trx >= 8 || tfi >= 32)
 		return NULL;
 
-	tbf = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_tbf);
+	if (dir == GPRS_RLCMAC_UL_TBF)
+		tbf = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf);
+	else
+		tbf = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_dl_tbf);
+
 	if (!tbf)
 		return NULL;
 
diff --git a/src/tbf.h b/src/tbf.h
index 80e2068..8464e19 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -326,6 +326,12 @@  inline time_t gprs_rlcmac_tbf::created_ts() const
 	return m_created_ts;
 }
 
+struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf {
+};
+
+struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf {
+};
+
 #endif
 
 #ifdef __cplusplus