Change in osmo-bsc[master]: LCLS: use libosmocore function to add status

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
Tue Jan 29 12:58:30 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12486 )

Change subject: LCLS: use libosmocore function to add status
......................................................................

LCLS: use libosmocore function to add status

* use gsm0808_create_ass_compl2() to add BSS Status IE to Assignment
  Complete message
* drop local helpers

Depends-on: (libosmocore) I547c6b8707123aa8c1ef636db88908df112d90a4
Change-Id: I6916928391667cd9c345becf00e7c8561846c295
Related: OS#2487
---
M include/osmocom/bsc/osmo_bsc_lcls.h
M src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/osmo_bsc_lcls.c
3 files changed, 4 insertions(+), 41 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve



diff --git a/include/osmocom/bsc/osmo_bsc_lcls.h b/include/osmocom/bsc/osmo_bsc_lcls.h
index c8b0ebd..d98fe98 100644
--- a/include/osmocom/bsc/osmo_bsc_lcls.h
+++ b/include/osmocom/bsc/osmo_bsc_lcls.h
@@ -37,5 +37,3 @@
 void lcls_apply_config(struct gsm_subscriber_connection *conn);
 
 extern struct osmo_fsm lcls_fsm;
-
-void bssmap_add_lcls_status_if_needed(struct gsm_subscriber_connection *conn, struct msgb *msg);
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index a24f7f9..2ad3959 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -175,10 +175,10 @@
 		}
 	}
 
-	resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause,
-					chosen_channel,
-					lchan->encr.alg_id, perm_spch,
-					addr_local_p, sc_ptr, NULL);
+	resp = gsm0808_create_ass_compl2(lchan->abis_ip.ass_compl.rr_cause,
+					 chosen_channel,
+					 lchan->encr.alg_id, perm_spch,
+					 addr_local_p, sc_ptr, NULL, lcls_get_status(conn));
 
 	if (!resp) {
 		assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE,
@@ -186,9 +186,6 @@
 		return;
 	}
 
-	/* Add LCLS BSS-Status IE in case there is any LCLS status for this connection */
-	bssmap_add_lcls_status_if_needed(conn, resp);
-
 	rc = gscon_sigtran_send(conn, resp);
 	if (rc) {
 		assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE,
diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c
index e4459da..f7b84e1 100644
--- a/src/osmo-bsc/osmo_bsc_lcls.c
+++ b/src/osmo-bsc/osmo_bsc_lcls.c
@@ -864,35 +864,3 @@
 	.log_subsys = DLCLS,
 	.event_names = lcls_event_names,
 };
-
-/* Add the LCLS BSS Status IE to a BSSMAP message. We assume this is
- * called on a msgb that was returned by gsm0808_create_ass_compl() */
-static void bssmap_add_lcls_status(struct msgb *msg, enum gsm0808_lcls_status status)
-{
-	OSMO_ASSERT(msg->l3h[0] == BSSAP_MSG_BSS_MANAGEMENT);
-	OSMO_ASSERT(msg->l3h[2] == BSS_MAP_MSG_ASSIGMENT_COMPLETE ||
-		    msg->l3h[2] == BSS_MAP_MSG_HANDOVER_RQST_ACKNOWLEDGE ||
-		    msg->l3h[2] == BSS_MAP_MSG_HANDOVER_COMPLETE ||
-		    msg->l3h[2] == BSS_MAP_MSG_HANDOVER_PERFORMED);
-	OSMO_ASSERT(msgb_tailroom(msg) >= 2);
-
-	/* append IE to end of message */
-	msgb_tv_put(msg, GSM0808_IE_LCLS_BSS_STATUS, status);
-	/* increment the "length" byte in the BSSAP header */
-	msg->l3h[1] += 2;
-}
-
-/* Add (append) the LCLS BSS Status IE to a BSSMAP message, if there is any LCLS
- * active on the given \a conn */
-void bssmap_add_lcls_status_if_needed(struct gsm_subscriber_connection *conn, struct msgb *msg)
-{
-	enum gsm0808_lcls_status status = lcls_get_status(conn);
-	if (status != GSM0808_LCLS_STS_NA) {
-		LOGPFSM(conn->fi, "Adding LCLS BSS-Status (%s) to %s\n",
-			gsm0808_lcls_status_name(status),
-			gsm0808_bssmap_name(msg->l3h[2]));
-		bssmap_add_lcls_status(msg, status);
-	}
-}
-
-

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6916928391667cd9c345becf00e7c8561846c295
Gerrit-Change-Number: 12486
Gerrit-PatchSet: 6
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190129/ad760ff5/attachment.htm>


More information about the gerrit-log mailing list