aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_dl.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-15 15:50:43 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-21 17:10:42 +0200
commit939904672961fa7e28397e27f942a7d1fff4bbdf (patch)
treef17d491b73f8c54982da96a2431b45e8d98f6000 /src/tbf_dl.cpp
parente43460b50fc152026ab96b5095b94fbac6939ab2 (diff)
ms: Support new and old TLLIs
According to the specification (GSM 04.08/24.008, 4.7.1.5) after a new P-TMSI has been assigned, the old P-TMSI must be kept basically until it has been used by both sides. Since the TLLI will be derived from the P-TMSI, the old TLLI must also be kept until the new TLLI has been used by both MS and SGSN. This commit modifies the TLLI handling of GprsMs accordingly. set_tlli() is only used with TLLIs derived from MS messages, confirm_tlli() is used with TLLIs derived from messages received from the SGSN. tlli() returns the value set by the MS. check_tlli() matches each of the TLLI used by either MS or SGSN as well as the old TLLI until it has been confirmed. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r--src/tbf_dl.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 5cdac5f5..b258a3c8 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -135,9 +135,10 @@ int gprs_rlcmac_dl_tbf::append_data(const uint8_t ms_class,
}
static struct gprs_rlcmac_dl_tbf *tbf_lookup_dl(BTS *bts,
- const uint32_t tlli, const char *imsi)
+ const uint32_t tlli, const uint32_t tlli_old,
+ const char *imsi)
{
- GprsMs *ms = bts->ms_store().get_ms(tlli, 0, imsi);
+ GprsMs *ms = bts->ms_store().get_ms(tlli, tlli_old, imsi);
if (!ms)
return NULL;
@@ -146,7 +147,8 @@ static struct gprs_rlcmac_dl_tbf *tbf_lookup_dl(BTS *bts,
static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
const char *imsi,
- const uint32_t tlli, const uint8_t ms_class,
+ const uint32_t tlli, const uint32_t tlli_old,
+ const uint8_t ms_class,
const uint8_t *data, const uint16_t len)
{
uint8_t trx, ta, ss;
@@ -160,7 +162,7 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
/* check for uplink data, so we copy our informations */
#warning "Do the same look up for IMSI, TLLI and OLD_TLLI"
#warning "Refactor the below lines... into a new method"
- ms = bts->bts->ms_store().get_ms(tlli, 0, imsi);
+ ms = bts->bts->ms_store().get_ms(tlli, tlli_old, imsi);
if (ms)
ul_tbf = ms->ul_tbf();
@@ -229,22 +231,25 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
* TODO: split into unit test-able parts...
*/
int gprs_rlcmac_dl_tbf::handle(struct gprs_rlcmac_bts *bts,
- const uint32_t tlli, const char *imsi,
+ const uint32_t tlli, const uint32_t tlli_old, const char *imsi,
const uint8_t ms_class, const uint16_t delay_csec,
const uint8_t *data, const uint16_t len)
{
struct gprs_rlcmac_dl_tbf *dl_tbf;
/* check for existing TBF */
- dl_tbf = tbf_lookup_dl(bts->bts, tlli, imsi);
+ dl_tbf = tbf_lookup_dl(bts->bts, tlli, tlli_old, imsi);
if (dl_tbf) {
int rc = dl_tbf->append_data(ms_class, delay_csec, data, len);
if (rc >= 0)
dl_tbf->assign_imsi(imsi);
+
+ if (dl_tbf->ms())
+ dl_tbf->ms()->confirm_tlli(tlli);
return rc;
}
- return tbf_new_dl_assignment(bts, imsi, tlli, ms_class, data, len);
+ return tbf_new_dl_assignment(bts, imsi, tlli, tlli_old, ms_class, data, len);
}
struct msgb *gprs_rlcmac_dl_tbf::llc_dequeue(bssgp_bvc_ctx *bctx)