aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-06 02:57:51 +0200
committerHarald Welte <laforge@gnumonks.org>2018-04-12 19:40:00 +0000
commit158095960b7f036480b50a9e0508d63579322db7 (patch)
tree7ef502e2c4680bccb0a127092539423d441e15f1 /src/libmsc/gsm_04_08.c
parent048eb306842fabf9fb577f3d35c46b482fb0b867 (diff)
refactor VLR FSM result handling
Instead of keeping separate enums for FSM results and translating between those and the actual 04.08 reject causes that will ultimately reach the MS, just pass enum gsm48_reject_value cause codes around everywhere. Collapse some VLR *_timeout() and *_cancel() api to just *_cancel() with a gsm48 cause arg. (Hopefully) improve a few reject causes, but otherwise just aim for more transparent decisions on which cause value is used, for future fixes of returned causes. Depends: I6661f139e68a498fb1bef10c266c2f064b72774a (libosmocore) Change-Id: I27bf8d68737ff1f8dc6d11fb1eac3d391aab0cb1
Diffstat (limited to 'src/libmsc/gsm_04_08.c')
-rw-r--r--src/libmsc/gsm_04_08.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index b51fd16b5..2b8e4c1df 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -644,7 +644,7 @@ int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn)
}
static int msc_vlr_tx_cm_serv_acc(void *msc_conn_ref);
-static int msc_vlr_tx_cm_serv_rej(void *msc_conn_ref, enum vlr_proc_arq_result result);
+static int msc_vlr_tx_cm_serv_rej(void *msc_conn_ref, enum gsm48_reject_value result);
static int cm_serv_reuse_conn(struct gsm_subscriber_connection *conn, const uint8_t *mi_lv)
{
@@ -675,7 +675,7 @@ static int cm_serv_reuse_conn(struct gsm_subscriber_connection *conn, const uint
LOGP(DMM, LOGL_ERROR, "%s: CM Service Request with mismatching mobile identity: %s %s\n",
vlr_subscr_name(conn->vsub), gsm48_mi_type_name(mi_type), mi_string);
- msc_vlr_tx_cm_serv_rej(conn, VLR_PR_ARQ_RES_ILLEGAL_SUBSCR);
+ msc_vlr_tx_cm_serv_rej(conn, GSM48_REJECT_ILLEGAL_MS);
return -EINVAL;
accept_reuse:
@@ -774,7 +774,7 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms
if (msc_subscr_conn_is_establishing_auth_ciph(conn)) {
LOGP(DMM, LOGL_ERROR,
"Cannot accept CM Service Request, conn already busy establishing authenticity\n");
- msc_vlr_tx_cm_serv_rej(conn, VLR_PR_ARQ_RES_UNKNOWN_ERROR);
+ msc_vlr_tx_cm_serv_rej(conn, GSM48_REJECT_CONGESTION);
return -EINVAL;
/* or should we accept and note down the service request anyway? */
}
@@ -3576,7 +3576,7 @@ static int msc_vlr_tx_lu_acc(void *msc_conn_ref, uint32_t send_tmsi)
}
/* VLR asks us to transmit a Location Update Reject */
-static int msc_vlr_tx_lu_rej(void *msc_conn_ref, uint8_t cause)
+static int msc_vlr_tx_lu_rej(void *msc_conn_ref, enum gsm48_reject_value cause)
{
struct gsm_subscriber_connection *conn = msc_conn_ref;
return gsm0408_loc_upd_rej(conn, cause);
@@ -3605,36 +3605,11 @@ static int msc_vlr_tx_mm_info(void *msc_conn_ref)
}
/* VLR asks us to transmit a CM Service Reject */
-static int msc_vlr_tx_cm_serv_rej(void *msc_conn_ref, enum vlr_proc_arq_result result)
+static int msc_vlr_tx_cm_serv_rej(void *msc_conn_ref, enum gsm48_reject_value cause)
{
- uint8_t cause;
struct gsm_subscriber_connection *conn = msc_conn_ref;
int rc;
- switch (result) {
- default:
- case VLR_PR_ARQ_RES_NONE:
- case VLR_PR_ARQ_RES_SYSTEM_FAILURE:
- case VLR_PR_ARQ_RES_UNKNOWN_ERROR:
- cause = GSM48_REJECT_NETWORK_FAILURE;
- break;
- case VLR_PR_ARQ_RES_ILLEGAL_SUBSCR:
- cause = GSM48_REJECT_LOC_NOT_ALLOWED;
- break;
- case VLR_PR_ARQ_RES_UNIDENT_SUBSCR:
- cause = GSM48_REJECT_INVALID_MANDANTORY_INF;
- break;
- case VLR_PR_ARQ_RES_ROAMING_NOTALLOWED:
- cause = GSM48_REJECT_ROAMING_NOT_ALLOWED;
- break;
- case VLR_PR_ARQ_RES_ILLEGAL_EQUIP:
- cause = GSM48_REJECT_ILLEGAL_MS;
- break;
- case VLR_PR_ARQ_RES_TIMEOUT:
- cause = GSM48_REJECT_CONGESTION;
- break;
- };
-
rc = msc_gsm48_tx_mm_serv_rej(conn, cause);
if (conn->received_cm_service_request) {