summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte2010-06-01 21:21:20 +0200
committerHarald Welte2010-06-01 21:21:20 +0200
commit7b4913662aed261f39019c621f52c6e313b76274 (patch)
tree5f2d157625052c88f452ba8ab048cdbd74a361c8 /src
parentadd configure option '--disable-vty' to prevent building libosmovty (diff)
parentadd new new gprs_tmsi2tlli() function (diff)
downloadlibosmocore-7b4913662aed261f39019c621f52c6e313b76274.tar.gz
libosmocore-7b4913662aed261f39019c621f52c6e313b76274.tar.xz
libosmocore-7b4913662aed261f39019c621f52c6e313b76274.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'src')
-rw-r--r--src/gsm_utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gsm_utils.c b/src/gsm_utils.c
index b392fd3..913946e 100644
--- a/src/gsm_utils.c
+++ b/src/gsm_utils.c
@@ -374,3 +374,20 @@ int gprs_tlli_type(uint32_t tlli)
return TLLI_RESERVED;
}
+
+uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type)
+{
+ uint32_t tlli;
+ switch (type) {
+ case TLLI_LOCAL:
+ tlli = p_tmsi | 0xc0000000;
+ break;
+ case TLLI_FOREIGN:
+ tlli = (p_tmsi & 0x3fffffff) | 0x80000000;
+ break;
+ default:
+ tlli = 0;
+ break;
+ }
+ return tlli;
+}