tbf: Always call set_tlli/confirm_tlli in update_ms
Currently the m_tlli member in GprsMs is set by the constructor,
circumventing the TLLI confirmation mechanism.
This commit replaces the get_or_create_ms() method by a create_ms()
method which takes the TLLI and the direction (UL or DL) as
parameters to select either set_tlli() or confirm_tlli(). The MS
object is instantiated with TLLI = 0, and therefore GprsMs::tlli() is
extended to return the DL TLLI if both of the other TLLI are not set.
Note that create_ms() will not check whether an MS object with a
matching TLLI is already stored in the list, so it should only be
called after a corresponding get_ms() in general.
Sponsored-by: On-Waves ehf
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 1ba76c7..bdae443 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -72,6 +72,7 @@
dl_tbf, 0,
0, 0, 0);
ul_tbf->update_tlli(0x2342);
+ ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF);
ms = the_bts.ms_by_tlli(0x2342);
@@ -84,7 +85,7 @@
* has changed.
*/
dl_tbf->update_tlli(0x4232);
- ms->confirm_tlli(0x4232);
+ dl_tbf->update_ms(0x4232, GPRS_RLCMAC_DL_TBF);
/* It is still there, since the new TLLI has not been used for UL yet */
ms_new = the_bts.ms_by_tlli(0x2342);
@@ -96,7 +97,7 @@
OSMO_ASSERT(ms->ul_tbf() == ul_tbf);
/* Now use the new TLLI for UL */
- ms->set_tlli(0x4232);
+ ul_tbf->update_ms(0x4232, GPRS_RLCMAC_UL_TBF);
ms_new = the_bts.ms_by_tlli(0x2342);
OSMO_ASSERT(ms_new == NULL);