aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_ms_storage.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-19 10:59:58 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-19 13:38:36 +0200
commit407851b865f49ddb0ea37a1d8a26a979f08e50d8 (patch)
tree4d96c0f500f83f97292041d7cf19c20395689073 /src/gprs_ms_storage.cpp
parent196ddc58a414bb0209e672896d1119d7297c2872 (diff)
tbf: Add BTS::ms_alloc methodjerlbeck/wip/ms-struct
Currently the code that creates the MS objects with tbf.cpp is duplicated. This commit moves the corresponding code into a new method. Since there is no TLLI available there, the GprsMsStorage::create_ms method has been refactored into two variants, one with TLLI/direction and one without. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_ms_storage.cpp')
-rw-r--r--src/gprs_ms_storage.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gprs_ms_storage.cpp b/src/gprs_ms_storage.cpp
index 1f124a5..515ed75 100644
--- a/src/gprs_ms_storage.cpp
+++ b/src/gprs_ms_storage.cpp
@@ -80,6 +80,18 @@ GprsMs *GprsMsStorage::get_ms(uint32_t tlli, uint32_t old_tlli, const char *imsi
return NULL;
}
+GprsMs *GprsMsStorage::create_ms()
+{
+ GprsMs *ms;
+
+ ms = new GprsMs(m_bts, 0);
+
+ ms->set_callback(this);
+ llist_add(&ms->list(), &m_list);
+
+ return ms;
+}
+
GprsMs *GprsMsStorage::create_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir)
{
GprsMs *ms = get_ms(tlli);
@@ -87,15 +99,12 @@ GprsMs *GprsMsStorage::create_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction d
if (ms)
return ms;
- ms = new GprsMs(m_bts, 0);
+ ms = create_ms();
if (dir == GPRS_RLCMAC_UL_TBF)
ms->set_tlli(tlli);
else
ms->confirm_tlli(tlli);
- ms->set_callback(this);
- llist_add(&ms->list(), &m_list);
-
return ms;
}