diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-08-18 11:55:03 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-08-18 11:55:03 +0200 |
commit | 2b349b5d33050f6484c375e545ecb9f05a6be961 (patch) | |
tree | b7969962b60bc2b0dd27f2c56e3dd8501ddb792b /src/gprs_ms.cpp | |
parent | ebebad1c92e8bcbe28780b4d5ee2ac32091089ff (diff) |
ms: Move MS information merging to GprsMS
Currently the merging of the meta information (MS class, IMSI) takes
place in gprs_rlcmac_tbf::merge_and_clear_ms(). This makes it
difficult to merge the internal state and does not directly relate to
TBFs anyway.
This commit moves this into a new method GprsMs::merge_old_ms.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_ms.cpp')
-rw-r--r-- | src/gprs_ms.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index b0481f31..a5a6cfda 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -311,6 +311,20 @@ void GprsMs::reset() m_imsi[0] = '\0'; } +void GprsMs::merge_old_ms(GprsMs *old_ms) +{ + if (old_ms == this) + return; + + if (strlen(imsi()) == 0 && strlen(old_ms->imsi()) != 0) + set_imsi(old_ms->imsi()); + + if (!ms_class() && old_ms->ms_class()) + set_ms_class(old_ms->ms_class()); + + old_ms->reset(); +} + void GprsMs::set_tlli(uint32_t tlli) { if (tlli == m_tlli || tlli == m_new_ul_tlli) |