diff options
Diffstat (limited to 'src/gsm_utils.c')
-rw-r--r-- | src/gsm_utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gsm_utils.c b/src/gsm_utils.c index 593dd5c9..b392fd37 100644 --- a/src/gsm_utils.c +++ b/src/gsm_utils.c @@ -359,3 +359,18 @@ uint32_t gsm_gsmtime2fn(struct gsm_time *time) /* TS 05.02 Chapter 4.3.3 TDMA frame number */ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } + +/* TS 03.03 Chapter 2.6 */ +int gprs_tlli_type(uint32_t tlli) +{ + if ((tlli & 0xc0000000) == 0xc0000000) + return TLLI_LOCAL; + else if ((tlli & 0xc0000000) == 0x80000000) + return TLLI_FOREIGN; + else if ((tlli & 0xf8000000) == 0x78000000) + return TLLI_RANDOM; + else if ((tlli & 0xf8000000) == 0x70000000) + return TLLI_AUXILIARY; + + return TLLI_RESERVED; +} |