GSM/GPRS 04.08: Don't print numeric mobile identity types
I guess none of our users knows what a mi_type=0x02 is, but most would know what an IMSI or a TMSI is. So let's use the newly introduced gsm48_mi_type_name() function to fix this.
This commit is contained in:
parent
6b39feedc7
commit
b9845f937e
|
@ -402,7 +402,8 @@ static int gsm48_tx_gmm_id_req(struct sgsn_mm_ctx *mm, uint8_t id_type)
|
||||||
struct msgb *msg = gsm48_msgb_alloc();
|
struct msgb *msg = gsm48_msgb_alloc();
|
||||||
struct gsm48_hdr *gh;
|
struct gsm48_hdr *gh;
|
||||||
|
|
||||||
LOGMMCTXP(LOGL_DEBUG, mm, "<- GPRS IDENTITY REQUEST: mi_type=%02x\n", id_type);
|
LOGMMCTXP(LOGL_DEBUG, mm, "<- GPRS IDENTITY REQUEST: mi_type=%s\n",
|
||||||
|
gsm48_mi_type_name(id_type));
|
||||||
|
|
||||||
mmctx2msgid(msg, mm);
|
mmctx2msgid(msg, mm);
|
||||||
|
|
||||||
|
@ -774,14 +775,14 @@ static int gsm48_rx_gmm_id_resp(struct sgsn_mm_ctx *ctx, struct msgb *msg)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGMMCTXP(LOGL_DEBUG, ctx, "-> GMM IDENTITY RESPONSE: mi_type=0x%02x MI(%s)\n",
|
LOGMMCTXP(LOGL_DEBUG, ctx, "-> GMM IDENTITY RESPONSE: MI(%s)=%s\n",
|
||||||
mi_type, mi_string);
|
gsm48_mi_type_name(mi_type), mi_string);
|
||||||
|
|
||||||
if (ctx->t3370_id_type == GSM_MI_TYPE_NONE) {
|
if (ctx->t3370_id_type == GSM_MI_TYPE_NONE) {
|
||||||
LOGMMCTXP(LOGL_NOTICE, ctx,
|
LOGMMCTXP(LOGL_NOTICE, ctx,
|
||||||
"Got unexpected IDENTITY RESPONSE: mi_type=0x%02x MI(%s), "
|
"Got unexpected IDENTITY RESPONSE: MI(%s)=%s, "
|
||||||
"ignoring message\n",
|
"ignoring message\n",
|
||||||
mi_type, mi_string);
|
gsm48_mi_type_name(mi_type), mi_string);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -924,7 +925,7 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGMMCTXP(LOGL_NOTICE, ctx, "Rejecting ATTACH REQUEST with "
|
LOGMMCTXP(LOGL_NOTICE, ctx, "Rejecting ATTACH REQUEST with "
|
||||||
"MI type %u\n", mi_type);
|
"MI type %s\n", gsm48_mi_type_name(mi_type));
|
||||||
reject_cause = GMM_CAUSE_MS_ID_NOT_DERIVED;
|
reject_cause = GMM_CAUSE_MS_ID_NOT_DERIVED;
|
||||||
goto rejected;
|
goto rejected;
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,8 +516,8 @@ static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *ms
|
||||||
char mi_string[GSM48_MI_SIZE];
|
char mi_string[GSM48_MI_SIZE];
|
||||||
|
|
||||||
gsm48_mi_to_string(mi_string, sizeof(mi_string), &gh->data[1], gh->data[0]);
|
gsm48_mi_to_string(mi_string, sizeof(mi_string), &gh->data[1], gh->data[0]);
|
||||||
DEBUGP(DMM, "IDENTITY RESPONSE: mi_type=0x%02x MI(%s)\n",
|
DEBUGP(DMM, "IDENTITY RESPONSE: MI(%s)=%s\n",
|
||||||
mi_type, mi_string);
|
gsm48_mi_type_name(mi_type), mi_string);
|
||||||
|
|
||||||
osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, gh->data);
|
osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, gh->data);
|
||||||
|
|
||||||
|
@ -574,19 +574,12 @@ static void schedule_reject(struct gsm_subscriber_connection *conn)
|
||||||
osmo_timer_schedule(&conn->loc_operation->updating_timer, 5, 0);
|
osmo_timer_schedule(&conn->loc_operation->updating_timer, 5, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *lupd_name(uint8_t type)
|
static const struct value_string lupd_names[] = {
|
||||||
{
|
{ GSM48_LUPD_NORMAL, "NORMAL" },
|
||||||
switch (type) {
|
{ GSM48_LUPD_PERIODIC, "PERIODIC" },
|
||||||
case GSM48_LUPD_NORMAL:
|
{ GSM48_LUPD_IMSI_ATT, "IMSI ATTACH" },
|
||||||
return "NORMAL";
|
{ 0, NULL }
|
||||||
case GSM48_LUPD_PERIODIC:
|
};
|
||||||
return "PERIODIC";
|
|
||||||
case GSM48_LUPD_IMSI_ATT:
|
|
||||||
return "IMSI ATTACH";
|
|
||||||
default:
|
|
||||||
return "UNKNOWN";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Chapter 9.2.15: Receive Location Updating Request */
|
/* Chapter 9.2.15: Receive Location Updating Request */
|
||||||
static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
|
||||||
|
@ -604,8 +597,8 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
|
||||||
|
|
||||||
gsm48_mi_to_string(mi_string, sizeof(mi_string), lu->mi, lu->mi_len);
|
gsm48_mi_to_string(mi_string, sizeof(mi_string), lu->mi, lu->mi_len);
|
||||||
|
|
||||||
DEBUGPC(DMM, "mi_type=0x%02x MI(%s) type=%s ", mi_type, mi_string,
|
DEBUGPC(DMM, "MI(%s)=%s type=%s ", gsm48_mi_type_name(mi_type),
|
||||||
lupd_name(lu->type));
|
mi_string, get_value_string(lupd_names, lu->type));
|
||||||
|
|
||||||
osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, &lu->mi_len);
|
osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, &lu->mi_len);
|
||||||
|
|
||||||
|
@ -976,13 +969,15 @@ static int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct m
|
||||||
mi_type = mi[0] & GSM_MI_TYPE_MASK;
|
mi_type = mi[0] & GSM_MI_TYPE_MASK;
|
||||||
|
|
||||||
if (mi_type == GSM_MI_TYPE_IMSI) {
|
if (mi_type == GSM_MI_TYPE_IMSI) {
|
||||||
DEBUGPC(DMM, "serv_type=0x%02x mi_type=0x%02x M(%s)\n",
|
DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n",
|
||||||
req->cm_service_type, mi_type, mi_string);
|
req->cm_service_type, gsm48_mi_type_name(mi_type),
|
||||||
|
mi_string);
|
||||||
subscr = subscr_get_by_imsi(bts->network->subscr_group,
|
subscr = subscr_get_by_imsi(bts->network->subscr_group,
|
||||||
mi_string);
|
mi_string);
|
||||||
} else if (mi_type == GSM_MI_TYPE_TMSI) {
|
} else if (mi_type == GSM_MI_TYPE_TMSI) {
|
||||||
DEBUGPC(DMM, "serv_type=0x%02x mi_type=0x%02x M(%s)\n",
|
DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n",
|
||||||
req->cm_service_type, mi_type, mi_string);
|
req->cm_service_type, gsm48_mi_type_name(mi_type),
|
||||||
|
mi_string);
|
||||||
subscr = subscr_get_by_tmsi(bts->network->subscr_group,
|
subscr = subscr_get_by_tmsi(bts->network->subscr_group,
|
||||||
tmsi_from_string(mi_string));
|
tmsi_from_string(mi_string));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1033,8 +1028,8 @@ static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, s
|
||||||
struct gsm_subscriber *subscr = NULL;
|
struct gsm_subscriber *subscr = NULL;
|
||||||
|
|
||||||
gsm48_mi_to_string(mi_string, sizeof(mi_string), idi->mi, idi->mi_len);
|
gsm48_mi_to_string(mi_string, sizeof(mi_string), idi->mi, idi->mi_len);
|
||||||
DEBUGP(DMM, "IMSI DETACH INDICATION: mi_type=0x%02x MI(%s)",
|
DEBUGP(DMM, "IMSI DETACH INDICATION: MI(%s)=%s",
|
||||||
mi_type, mi_string);
|
gsm48_mi_type_name(mi_type), mi_string);
|
||||||
|
|
||||||
osmo_counter_inc(bts->network->stats.loc_upd_type.detach);
|
osmo_counter_inc(bts->network->stats.loc_upd_type.detach);
|
||||||
|
|
||||||
|
@ -1187,8 +1182,8 @@ static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct m
|
||||||
resp = (struct gsm48_pag_resp *) &gh->data[0];
|
resp = (struct gsm48_pag_resp *) &gh->data[0];
|
||||||
gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh),
|
gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh),
|
||||||
mi_string, &mi_type);
|
mi_string, &mi_type);
|
||||||
DEBUGP(DRR, "PAGING RESPONSE: mi_type=0x%02x MI(%s)\n",
|
DEBUGP(DRR, "PAGING RESPONSE: MI(%s)=%s\n",
|
||||||
mi_type, mi_string);
|
gsm48_mi_type_name(mi_type), mi_string);
|
||||||
|
|
||||||
switch (mi_type) {
|
switch (mi_type) {
|
||||||
case GSM_MI_TYPE_TMSI:
|
case GSM_MI_TYPE_TMSI:
|
||||||
|
|
|
@ -73,8 +73,8 @@ static struct gsm_subscriber *extract_sub(struct gsm_subscriber_connection *conn
|
||||||
|
|
||||||
gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh),
|
gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh),
|
||||||
mi_string, &mi_type);
|
mi_string, &mi_type);
|
||||||
DEBUGP(DRR, "PAGING RESPONSE: mi_type=0x%02x MI(%s)\n",
|
DEBUGP(DRR, "PAGING RESPONSE: MI(%s)=%s\n",
|
||||||
mi_type, mi_string);
|
gsm48_mi_type_name(mi_type), mi_string);
|
||||||
|
|
||||||
switch (mi_type) {
|
switch (mi_type) {
|
||||||
case GSM_MI_TYPE_TMSI:
|
case GSM_MI_TYPE_TMSI:
|
||||||
|
|
Loading…
Reference in New Issue