aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tbf.cpp48
-rw-r--r--src/tbf.h1
-rw-r--r--tests/tbf/TbfTest.err4
3 files changed, 31 insertions, 22 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 590d1151..556f6e83 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -992,31 +992,14 @@ int gprs_rlcmac_tbf::establish_dl_tbf_on_pacch()
return 0;
}
-int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len)
+int gprs_rlcmac_tbf::set_tlli_from_ul(uint32_t new_tlli)
{
struct gprs_rlcmac_tbf *dl_tbf = NULL;
struct gprs_rlcmac_tbf *ul_tbf = NULL;
- struct rlc_ul_header *rh = (struct rlc_ul_header *)data;
- uint32_t new_tlli;
- int rc;
GprsMs *old_ms;
OSMO_ASSERT(direction == GPRS_RLCMAC_UL_TBF);
- /* no TLLI yet */
- if (!rh->ti) {
- LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA TFI=%d without "
- "TLLI, but no TLLI received yet\n", rh->tfi);
- return 0;
- }
- rc = Decoding::tlli_from_ul_data(data, len, &new_tlli);
- if (rc) {
- bts->decode_error();
- LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI "
- "of UL DATA TFI=%d.\n", rh->tfi);
- return 0;
- }
-
old_ms = bts->ms_by_tlli(new_tlli);
/* Keep the old MS object for the update_ms() */
GprsMs::Guard guard(old_ms);
@@ -1036,8 +1019,6 @@ int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len)
/* The TLLI has been taken from an UL message */
update_ms(new_tlli, GPRS_RLCMAC_UL_TBF);
- LOGP(DRLCMACUL, LOGL_INFO, "Decoded premier TLLI=0x%08x of "
- "UL DATA TFI=%d.\n", tlli(), rh->tfi);
if (dl_tbf && dl_tbf->ms() != ms()) {
LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from "
"TLLI=0x%08x while %s still exists. "
@@ -1057,6 +1038,33 @@ int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len)
return 1;
}
+int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len)
+{
+ struct rlc_ul_header *rh = (struct rlc_ul_header *)data;
+ uint32_t new_tlli;
+ int rc;
+
+ OSMO_ASSERT(direction == GPRS_RLCMAC_UL_TBF);
+
+ /* no TLLI yet */
+ if (!rh->ti) {
+ LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA TFI=%d without "
+ "TLLI, but no TLLI received yet\n", rh->tfi);
+ return 0;
+ }
+ rc = Decoding::tlli_from_ul_data(data, len, &new_tlli);
+ if (rc) {
+ bts->decode_error();
+ LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI "
+ "of UL DATA TFI=%d.\n", rh->tfi);
+ return 0;
+ }
+ LOGP(DRLCMACUL, LOGL_INFO, "Decoded premier TLLI=0x%08x of "
+ "UL DATA TFI=%d.\n", new_tlli, rh->tfi);
+
+ return set_tlli_from_ul(new_tlli);
+}
+
const char *tbf_name(gprs_rlcmac_tbf *tbf)
{
return tbf->name();
diff --git a/src/tbf.h b/src/tbf.h
index 7b13eebb..252e9d52 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -239,6 +239,7 @@ protected:
gprs_rlcmac_bts *bts_data() const;
int extract_tlli(const uint8_t *data, const size_t len);
+ int set_tlli_from_ul(uint32_t new_tlli);
void merge_and_clear_ms(GprsMs *old_ms);
static const char *tbf_state_name[6];
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 1664e85d..9655830f 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -1395,8 +1395,8 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Upli
Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b
Got RLC block, coding scheme: CS-1, length: 23 (23))
UL DATA TFI=0 received (V(Q)=0 .. V(R)=0)
-Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
Decoded premier TLLI=0xf1223344 of UL DATA TFI=0.
+Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) restarting timer 3169 while old timer 3169 pending
- BSN 0 storing in window (0..63)
- Raising V(R) to 1
@@ -1989,13 +1989,13 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Upli
Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b
Got RLC block, coding scheme: CS-1, length: 23 (23))
UL DATA TFI=0 received (V(Q)=0 .. V(R)=0)
+Decoded premier TLLI=0xf1223344 of UL DATA TFI=0.
Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN)
Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=ASSIGN)
Modifying MS object, TLLI = 0x00000000, IMSI '' -> '0011223344'
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Clearing MS object, TLLI: 0xf1223344, IMSI: '0011223344'
Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
-Decoded premier TLLI=0xf1223344 of UL DATA TFI=0.
Destroying MS object, TLLI = 0x00000000
TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) restarting timer 3169 while old timer 3169 pending
- BSN 0 storing in window (0..63)