aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_ms.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-21 11:07:16 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-28 12:28:40 +0200
commitb0e5eaf59adbefc44e01850a6784c9da0c3abbf9 (patch)
treec7c628b9dd7db86d584e23a8c6d1031928059711 /src/gprs_ms.h
parent9a2845d491b088cb9e1962ba6dc8af5a4e279401 (diff)
tbf: Move IMSI to MS object
Currently the IMSI is stored in the TBFs. Since it directly refers to an MS, it should rather be stored in an MS object. This patch move the m_imsi field from gprs_rlcmac_tbf to GprsMs, changes gprs_rlcmac_tbf::imsi() to get the IMSI from the associated MS object, and adds getter and setter to GprsMs. Before changing the IMSI of the associated MS object, assign_imsi() checks if there is already another MS object with the same IMSI and eventually resets the IMSI of that one. So using update_ms() and assign_imsi() ensures that there are not two MS object entries is the storage with the same TLLI or the same IMSI. Ticket: #1674 Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_ms.h')
-rw-r--r--src/gprs_ms.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index e84ff9e7..7f8af414 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -56,6 +56,9 @@ public:
bool confirm_tlli(uint32_t tlli);
bool check_tlli(uint32_t tlli);
+ const char *imsi() const;
+ void set_imsi(const char *imsi);
+
void attach_tbf(gprs_rlcmac_tbf *tbf);
void attach_ul_tbf(gprs_rlcmac_ul_tbf *tbf);
void attach_dl_tbf(gprs_rlcmac_dl_tbf *tbf);
@@ -82,6 +85,10 @@ private:
uint32_t m_tlli;
uint32_t m_new_ul_tlli;
uint32_t m_new_dl_tlli;
+
+ /* store IMSI for look-up and PCH retransmission */
+ char m_imsi[16];
+
bool m_is_idle;
int m_ref;
LListHead<GprsMs> m_list;
@@ -99,3 +106,8 @@ inline bool GprsMs::check_tlli(uint32_t tlli)
return tlli != 0 &&
(tlli == m_tlli || tlli == m_new_ul_tlli || tlli == m_new_dl_tlli);
}
+
+inline const char *GprsMs::imsi() const
+{
+ return m_imsi;
+}