aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_bssap.c')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_bssap.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
index 9c549c3b7..349c98f3c 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
@@ -29,6 +29,7 @@
#include <osmocom/gsm/protocol/gsm_08_08.h>
#include <osmocom/gsm/gsm0808.h>
+#include <osmocom/sccp/sccp.h>
/*
* helpers for the assignment command
@@ -96,6 +97,35 @@ static int bssmap_handle_reset_ack(struct bsc_msc_data *msc,
return 0;
}
+static int bssmap_send_reset_ack(struct bsc_msc_data *msc)
+{
+ struct msgb *resp;
+ int rc;
+
+ LOGP(DMSC, LOGL_NOTICE, "Tx RESET-ACK to MSC\n");
+
+ resp = gsm0808_create_reset_ack();
+ OSMO_ASSERT(resp);
+
+ rc = sccp_write(resp, &sccp_ssn_bssap, &sccp_ssn_bssap, 0, msc->msc_con);
+ msgb_free(resp);
+ return rc;
+}
+
+static int bssmap_handle_reset(struct bsc_msc_data *msc,
+ struct msgb *msg, unsigned int length)
+{
+ LOGP(DMSC, LOGL_NOTICE, "Rx RESET from MSC\n");
+
+ /* Instruct the BSC to close all open SCCP connections and to close all
+ * active radio channels on the BTS side as well */
+ bsc_notify_and_close_conns(msc->msc_con);
+
+ /* Inform the MSC that we have received the reset request and
+ * that we acted accordingly */
+ return bssmap_send_reset_ack(msc);
+}
+
/* GSM 08.08 ยง 3.2.1.19 */
static int bssmap_handle_paging(struct bsc_msc_data *msc,
struct msgb *msg, unsigned int payload_length)
@@ -404,6 +434,9 @@ static int bssmap_rcvmsg_udt(struct bsc_msc_data *msc,
case BSS_MAP_MSG_RESET_ACKNOWLEDGE:
ret = bssmap_handle_reset_ack(msc, msg, length);
break;
+ case BSS_MAP_MSG_RESET:
+ ret = bssmap_handle_reset(msc, msg, length);
+ break;
case BSS_MAP_MSG_PAGING:
ret = bssmap_handle_paging(msc, msg, length);
break;