[tmsi] Make the tmsi a 4 octet number
tmsi is four octets long, there is no need to make it a string
and then jump through hoops to convert it to a number. Keep the database
using it as a string to benefit from the NULL handling of the db.
Introduce the reserved tmsi which has all bits set to 1 according
to GSM 03.03 ยง2.4 and start checking for it and make sure the db
code will never allocate such a tmsi.
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index fd0611a..b855213 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -90,7 +90,6 @@
static void page_ms(struct gsm_paging_request *request)
{
u_int8_t mi[128];
- unsigned long int tmsi;
unsigned int mi_len;
unsigned int page_group;
@@ -98,8 +97,7 @@
request->subscr->imsi);
page_group = calculate_group(request->bts, request->subscr);
- tmsi = strtoul(request->subscr->tmsi, NULL, 10);
- mi_len = gsm48_generate_mid_from_tmsi(mi, tmsi);
+ mi_len = gsm48_generate_mid_from_tmsi(mi, request->subscr->tmsi);
rsl_paging_cmd(request->bts, page_group, mi_len, mi,
request->chan_type);
}