From 13965aed74ae1c59cfd4f52275ac3e98f9aa9e3a Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 19 Jan 2016 14:10:40 +0100 Subject: tbf: Add gprs_rlcmac_tbf::window() method This method returns a gprs_rlc_window independently of the TBF's direction. Sponsored-by: On-Waves ehf --- src/tbf.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/tbf.h b/src/tbf.h index 11e1fc73..ab4145c2 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -107,6 +107,8 @@ struct gprs_rlcmac_tbf { GprsMs *ms() const; void set_ms(GprsMs *ms); + gprs_rlc_window *window(); + uint8_t tsc() const; int rlcmac_diag(); @@ -460,4 +462,14 @@ inline gprs_rlcmac_dl_tbf *as_dl_tbf(gprs_rlcmac_tbf *tbf) return NULL; } +inline gprs_rlc_window *gprs_rlcmac_tbf::window() +{ + switch (direction) + { + case GPRS_RLCMAC_UL_TBF: return &as_ul_tbf(this)->m_window; + case GPRS_RLCMAC_DL_TBF: return &as_dl_tbf(this)->m_window; + } + return NULL; +} + #endif -- cgit v1.2.3