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
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 3a58351..32f9efc 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -6,6 +6,8 @@
- Assign downlink TS=2
- Setting Control TS 2
TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changing tlli from TLLI=0x00000000 TLLI=0x00002342 ul_changed=0
+Creating MS object, TLLI = 0x00002342
+Attaching TBF to MS object, TLLI = 0x00002342, TBF = TBF(TFI=0 TLLI=0x00002342 DIR=DL STATE=NULL)
********** TBF starts here **********
Allocating UL TBF: TFI=0 TRX=0 MS_CLASS=0
Slot Allocation (Algorithm A) for class 0
@@ -13,8 +15,11 @@
- Skipping TS 1, because not enabled
- Assign uplink TS=2 USF=0
- Setting Control TS 2
+Attaching TBF to MS object, TLLI = 0x00002342, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL)
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changing tlli from TLLI=0x00000000 TLLI=0x00002342 ul_changed=0
-TBF(TFI=0 TLLI=0x00002342 DIR=DL STATE=NULL) changing tlli from TLLI=0x00002342 TLLI=0x00004232 ul_changed=1
+TBF(TFI=0 TLLI=0x00002342 DIR=DL STATE=NULL) changing tlli from TLLI=0x00002342 TLLI=0x00004232 ul_changed=0
+The MS object cannot fully confirm an unexpected TLLI: 0x00004232, partly confirmed
+Modifying MS object, TLLI: 0x00002342 -> 0x00004232, already confirmed partly
Searching for first unallocated TFI: TRX=0 first TS=4
Found TFI=0.
********** TBF starts here **********