[PATCH] openbsc[master]: osmo-bsc-sccplite: Implement incoming RESET procedure

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Nov 11 19:26:29 UTC 2017


Review at  https://gerrit.osmocom.org/4783

osmo-bsc-sccplite: Implement incoming RESET procedure

In osmo-bsc-sccplite we so far didn't implement the inbound RESET
procedure.  We instead ignored any RESET message from the MSC. This
commit adds support for RESET: We will destrpy any SCCP connections
and acknowledge the RESET to the MSC.

As osmo-msc is requiring the BSC to handle an inbound RESET procedure,
this commit allows osmo-msc to properly initialize the A interface
towards osmo-bsc-sccplite via a translating/routing osmo-stp.  While
we don't anticipate any new deployments of osmo-bsc-sccplite, making
it interoperate with osmo-msc enables us to do more testing of
osmo-bsc-sccplite.

Change-Id: Iceb8278deb36d6103662a704f489ba0d685e04d3
---
M openbsc/include/openbsc/bsc_msc_data.h
M openbsc/src/osmo-bsc/osmo_bsc_bssap.c
M openbsc/src/osmo-bsc/osmo_bsc_sccp.c
3 files changed, 35 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/4783/1

diff --git a/openbsc/include/openbsc/bsc_msc_data.h b/openbsc/include/openbsc/bsc_msc_data.h
index 38e87cf..9a92955 100644
--- a/openbsc/include/openbsc/bsc_msc_data.h
+++ b/openbsc/include/openbsc/bsc_msc_data.h
@@ -138,5 +138,6 @@
 struct bsc_msc_data *osmo_msc_data_find(struct gsm_network *, int);
 struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *, int);
 
+void bsc_notify_and_close_conns(struct bsc_msc_connection *msc_con);
 
 #endif
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
index 9c549c3..349c98f 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
@@ -94,6 +95,35 @@
 {
 	LOGP(DMSC, LOGL_NOTICE, "Reset ACK from MSC\n");
 	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 */
@@ -404,6 +434,9 @@
 	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;
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
index e242390..8388f88 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
@@ -287,7 +287,7 @@
 	bsc_send_ussd_release_complete(conn);
 }
 
-static void bsc_notify_and_close_conns(struct bsc_msc_connection *msc_con)
+void bsc_notify_and_close_conns(struct bsc_msc_connection *msc_con)
 {
 	struct osmo_bsc_sccp_con *con, *tmp;
 

-- 
To view, visit https://gerrit.osmocom.org/4783
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceb8278deb36d6103662a704f489ba0d685e04d3
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list