aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlc.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-24 20:55:02 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-26 21:00:51 +0100
commit270f7fce1d5558f66277cbb4c08e3e7cfc4d9c4c (patch)
tree41dd9010e56c79acd8dfdb67396bf42ec6bf69d1 /src/rlc.h
parentf1593b7c49bd54caae9326c79156741e6078c412 (diff)
tbf/rlc: Move the v_n handling into a dedicated object
Diffstat (limited to 'src/rlc.h')
-rw-r--r--src/rlc.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/rlc.h b/src/rlc.h
index e08a5d70..d9e0e6cc 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -129,6 +129,16 @@ private:
char m_v_b[RLC_MAX_SNS/2]; /* acknowledge state array */
};
+struct gprs_rlc_v_n {
+ void mark_received(int index);
+ void mark_missing(int index);
+
+ bool is_received(int index) const;
+
+ char state(int index) const;
+private:
+ char m_v_n[RLC_MAX_SNS/2]; /* receive state array */
+};
extern "C" {
/* TS 04.60 10.2.2 */
@@ -329,3 +339,23 @@ inline void gprs_rlc_ul_window::increment_q(int incr)
{
m_v_q = (m_v_q + incr) & mod_sns();
}
+
+inline void gprs_rlc_v_n::mark_received(int index)
+{
+ m_v_n[index] = 'R';
+}
+
+inline void gprs_rlc_v_n::mark_missing(int index)
+{
+ m_v_n[index] = 'N';
+}
+
+inline bool gprs_rlc_v_n::is_received(int index) const
+{
+ return m_v_n[index] == 'R';
+}
+
+inline char gprs_rlc_v_n::state(int index) const
+{
+ return m_v_n[index];
+}