Change in osmo-msc[master]: a_iface: Announce Osmux support on RESET (ACK) send

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon May 13 18:03:08 UTC 2019


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/14040


Change subject: a_iface: Announce Osmux support on RESET (ACK) send
......................................................................

a_iface: Announce Osmux support on RESET (ACK) send

Related: OS#2551
Depends: libosmocore.git I28f83e2e32b9533c99e65ccc1562900ac2aec74e
Change-Id: Id607f60749e923755cb38179bc283a7957670653
---
M src/libmsc/ran_msg_a.c
1 file changed, 24 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/40/14040/1

diff --git a/src/libmsc/ran_msg_a.c b/src/libmsc/ran_msg_a.c
index ba0990d..43923df 100644
--- a/src/libmsc/ran_msg_a.c
+++ b/src/libmsc/ran_msg_a.c
@@ -34,6 +34,7 @@
 #include <osmocom/msc/debug.h>
 #include <osmocom/msc/ran_msg_a.h>
 #include <osmocom/msc/sccp_ran.h>
+#include <osmocom/msc/gsm_data.h>
 
 #define LOG_RAN_A_DEC(RAN_DEC, level, fmt, args...) \
 	LOG_RAN_DEC(RAN_DEC, DBSSAP, level, "BSSMAP: " fmt, ## args)
@@ -1246,16 +1247,37 @@
 	}
 }
 
+/* Patch regular BSSMAP RESET to add extra T to announce Osmux support (osmocom extension) */
+static void _gsm0808_extend_announce_osmux(struct msgb *msg)
+{
+	OSMO_ASSERT(msg->l3h[1] == msgb_l3len(msg) - 2); /*TL not in len */
+	msgb_put_u8(msg, GSM0808_IE_OSMO_OSMUX_SUPPORT);
+	msg->l3h[1] = msgb_l3len(msg) - 2;
+}
+
 struct msgb *bssmap_make_reset_msg(const struct sccp_ran_inst *sri, enum reset_msg_type type)
 {
+	struct gsm_network *net = sri->user_data;
+	struct msgb *msg;
+
 	switch (type) {
 	case SCCP_RAN_MSG_RESET:
-		return gsm0808_create_reset();
+		msg = gsm0808_create_reset();
+		break;
 	case SCCP_RAN_MSG_RESET_ACK:
-		return gsm0808_create_reset_ack();
+		msg = gsm0808_create_reset_ack();
+		break;
 	default:
 		return NULL;
 	}
+
+	if (!msg)
+		return NULL;
+
+	if (net->use_osmux != OSMUX_USAGE_OFF)
+		_gsm0808_extend_announce_osmux(msg);
+
+	return msg;
 }
 
 struct msgb *bssmap_make_paging_msg(const struct sccp_ran_inst *sri, const struct gsm0808_cell_id *page_cell_id,

-- 
To view, visit https://gerrit.osmocom.org/14040
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id607f60749e923755cb38179bc283a7957670653
Gerrit-Change-Number: 14040
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190513/e04373c6/attachment.html>


More information about the gerrit-log mailing list