aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-08 12:13:08 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-20 11:31:07 +0200
commitfecece0e59ab5ff705887a1247df6e02836d7c66 (patch)
tree1359a27a39d5474981b6aa24bdffcff064c9be5b /src/tbf.h
parente04e0b0a20fb2b93855de0106873c90a88c53052 (diff)
tbf: Add MS object management to TBF code
This commit adds MS object creation and cleanup to the TBF related code. MS objects are created when a TBF that has been "anonymous" so far gets associated with a TLLI. When a TBF is replaced by another, the old TBF is detached and the new one is attached to the MS. When all TBFs have been detached, the MS object gets deleted. The TBF related code should not call attach_tbf/detach_tbf directly but use set_ms instead to make sure, that the references are updated properly. GprsMs::detach_tbf also calls set_ms(NULL) on the detached TBF object. The MS object is not really used yet, the focus is still on object creation, TBF association, and cleanup. Ticket: #1674 Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.h')
-rw-r--r--src/tbf.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tbf.h b/src/tbf.h
index bfe2875a..43b0a271 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -30,6 +30,7 @@
struct bssgp_bvc_ctx;
struct rlc_ul_header;
struct msgb;
+class GprsMs;
/*
* TBF instance
@@ -122,6 +123,9 @@ struct gprs_rlcmac_tbf {
struct msgb *create_dl_ass(uint32_t fn);
struct msgb *create_ul_ass(uint32_t fn);
+ GprsMs *ms();
+ void set_ms(GprsMs *ms);
+
uint8_t tsc() const;
int rlcmac_diag();
@@ -139,6 +143,9 @@ struct gprs_rlcmac_tbf {
bool is_tlli_valid() const;
void tlli_mark_valid();
+ /** MS updating */
+ void update_ms(uint32_t tlli);
+
uint8_t tfi() const;
const char *imsi() const;
@@ -229,6 +236,7 @@ protected:
static const char *tbf_state_name[6];
+ class GprsMs *m_ms;
private:
mutable char m_name_buf[60];
};
@@ -280,6 +288,11 @@ inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state)
state = new_state;
}
+inline GprsMs *gprs_rlcmac_tbf::ms()
+{
+ return m_ms;
+}
+
inline uint32_t gprs_rlcmac_tbf::tlli() const
{
return m_tlli;