summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-05-05 18:25:12 +0200
committerHarald Welte <laforge@gnumonks.org>2016-05-05 18:25:12 +0200
commit5f2524fe3d7242530f2088635df03df297862da0 (patch)
tree56ecb54bc4c1cf31cbd524627621089d729efa5a
parent5d547a4358edbd18744d1996d6ecb40328f09061 (diff)
sgsn/GSUP: Support MAP-style nested LU/ISD
The existing GSUP code expected the subscriber data to be piggy-backed onto the location update response, rather than a separate (and nested) insert subscriber data request/response phase. With this patch we should now support both the nested as well as the piggy-backed version.
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index f5a5937a0..71f5ff188 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -340,6 +340,9 @@ static void gprs_subscr_gsup_insert_data(struct gsm_subscriber *subscr,
static int gprs_subscr_handle_gsup_upd_loc_res(struct gsm_subscriber *subscr,
struct osmo_gsup_message *gsup_msg)
{
+ /* contrary to MAP, we allow piggy-backing subscriber data onto
+ * the UPDATE LOCATION RESULT, and don't mandate the use of a
+ * separate nested INSERT SUBSCRIBER DATA transaction */
gprs_subscr_gsup_insert_data(subscr, gsup_msg);
subscr->authorized = 1;
@@ -351,6 +354,22 @@ static int gprs_subscr_handle_gsup_upd_loc_res(struct gsm_subscriber *subscr,
return 0;
}
+static int gprs_subscr_handle_gsup_isd_req(struct gsm_subscriber *subscr,
+ struct osmo_gsup_message *gsup_msg)
+{
+ struct osmo_gsup_message gsup_reply = {0};
+
+ gprs_subscr_gsup_insert_data(subscr, gsup_msg);
+
+ subscr->authorized = 1;
+ subscr->sgsn_data->error_cause = SGSN_ERROR_CAUSE_NONE;
+ subscr->flags |= GPRS_SUBSCRIBER_ENABLE_PURGE;
+ gprs_subscr_update(subscr);
+
+ gsup_reply.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT;
+ return gprs_subscr_tx_gsup_message(subscr, &gsup_reply);
+}
+
static int check_cause(int cause)
{
switch (cause) {
@@ -654,6 +673,9 @@ int gprs_subscr_rx_gsup_message(struct msgb *msg)
break;
case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST:
+ rc = gprs_subscr_handle_gsup_isd_req(subscr, &gsup_msg);
+ break;
+
case OSMO_GSUP_MSGT_DELETE_DATA_REQUEST:
LOGGSUBSCRP(LOGL_ERROR, subscr,
"Rx GSUP message type %d not yet implemented\n",