diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-24 20:55:02 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 21:00:51 +0100 |
commit | 270f7fce1d5558f66277cbb4c08e3e7cfc4d9c4c (patch) | |
tree | 41dd9010e56c79acd8dfdb67396bf42ec6bf69d1 /src/rlc.h | |
parent | f1593b7c49bd54caae9326c79156741e6078c412 (diff) |
tbf/rlc: Move the v_n handling into a dedicated object
Diffstat (limited to 'src/rlc.h')
-rw-r--r-- | src/rlc.h | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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]; +} |