Change in libosmocore[master]: LCLS: add status parameter to Assignment Completed message

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 Jan 19 21:03:57 UTC 2019


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

Change subject: LCLS: add status parameter to Assignment Completed message
......................................................................

LCLS: add status parameter to Assignment Completed message

* add gsm0808_create_ass_compl2() with additional gsm0808_lcls_status
  parameter and make gsm0808_create_ass_compl() into trivial wrapper
  around it
* update tests accordingly

Change-Id: I547c6b8707123aa8c1ef636db88908df112d90a4
Related: OS#2487
---
M include/osmocom/gsm/gsm0808.h
M src/gsm/gsm0808.c
M src/gsm/libosmogsm.map
M tests/gsm0808/gsm0808_test.c
4 files changed, 43 insertions(+), 11 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h
index 782f3ec..6d14e13 100644
--- a/include/osmocom/gsm/gsm0808.h
+++ b/include/osmocom/gsm/gsm0808.h
@@ -76,6 +76,12 @@
 				      const struct gsm0808_speech_codec *sc,
 				      const struct gsm0808_speech_codec_list
 				      *scl);
+struct msgb *gsm0808_create_ass_compl2(uint8_t rr_cause, uint8_t chosen_channel,
+				       uint8_t encr_alg_id, uint8_t speech_mode,
+				       const struct sockaddr_storage *ss,
+				       const struct gsm0808_speech_codec *sc,
+				       const struct gsm0808_speech_codec_list *scl,
+				       enum gsm0808_lcls_status lcls_bss_status);
 struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause,
 						 uint8_t chosen_channel,
 						 uint8_t encr_alg_id,
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 59b1657..fce8e0a 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -519,7 +519,7 @@
 	return gsm0808_create_ass2(ct, cic, ss, scl, ci, NULL, NULL);
 }
 
-/*! Create BSSMAP Assignment Completed message
+/*! Create BSSMAP Assignment Completed message as per 3GPP TS 48.008 §3.2.1.2
  *  \param[in] rr_cause GSM 04.08 RR Cause value
  *  \param[in] chosen_channel Chosen Channel
  *  \param[in] encr_alg_id Encryption Algorithm ID
@@ -527,13 +527,14 @@
  *  \param[in] ss Socket Address of BSS-side RTP socket
  *  \param[in] sc Speech Codec (current)
  *  \param[in] scl Speech Codec List (permitted)
+ *  \param[in] lcls_bss_status §3.2.2.119 LCLS-BSS-Status, optional
  *  \returns callee-allocated msgb with BSSMAP Assignment Complete message */
-struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel,
+struct msgb *gsm0808_create_ass_compl2(uint8_t rr_cause, uint8_t chosen_channel,
 				      uint8_t encr_alg_id, uint8_t speech_mode,
 				      const struct sockaddr_storage *ss,
 				      const struct gsm0808_speech_codec *sc,
-				      const struct gsm0808_speech_codec_list
-				      *scl)
+				       const struct gsm0808_speech_codec_list *scl,
+				       enum gsm0808_lcls_status lcls_bss_status)
 {
 	struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
 						"bssmap: ass compl");
@@ -570,7 +571,11 @@
 	if (scl)
 		gsm0808_enc_speech_codec_list(msg, scl);
 
-	/* write LSA identifier 3.2.2.15 */
+	/* FIXME: write LSA identifier 3.2.2.15 - see 3GPP TS 43.073 */
+
+	/* LCLS-BSS-Status 3.2.2.119 */
+	if (lcls_bss_status != GSM0808_LCLS_STS_NA)
+		msgb_tv_put(msg, GSM0808_IE_LCLS_BSS_STATUS, lcls_bss_status);
 
 	msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
 
@@ -582,14 +587,33 @@
  *  \param[in] chosen_channel Chosen Channel
  *  \param[in] encr_alg_id Encryption Algorithm ID
  *  \param[in] speech_mode Speech Mode
+ *  \param[in] ss Socket Address of BSS-side RTP socket
+ *  \param[in] sc Speech Codec (current)
+ *  \param[in] scl Speech Codec List (permitted)
+ *  \returns callee-allocated msgb with BSSMAP Assignment Complete message */
+struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel,
+				      uint8_t encr_alg_id, uint8_t speech_mode,
+				      const struct sockaddr_storage *ss,
+				      const struct gsm0808_speech_codec *sc,
+				      const struct gsm0808_speech_codec_list *scl)
+{
+	return gsm0808_create_ass_compl2(rr_cause, chosen_channel, encr_alg_id, speech_mode,
+					 ss, sc, scl, GSM0808_LCLS_STS_NA);
+}
+
+/*! Create BSSMAP Assignment Completed message
+ *  \param[in] rr_cause GSM 04.08 RR Cause value
+ *  \param[in] chosen_channel Chosen Channel
+ *  \param[in] encr_alg_id Encryption Algorithm ID
+ *  \param[in] speech_mode Speech Mode
  *  \returns callee-allocated msgb with BSSMAP Assignment Complete message */
 struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause,
 						 uint8_t chosen_channel,
 						 uint8_t encr_alg_id,
 						 uint8_t speech_mode)
 {
-	return gsm0808_create_ass_compl(rr_cause, chosen_channel, encr_alg_id,
-					speech_mode, NULL, NULL, NULL);
+	return gsm0808_create_ass_compl2(rr_cause, chosen_channel, encr_alg_id,
+					 speech_mode, NULL, NULL, NULL, GSM0808_LCLS_STS_NA);
 }
 
 /*! Create BSSMAP Assignment Failure message
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index f9e9b8b..c440a79 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -153,6 +153,7 @@
 gsm0808_create_ass2;
 gsm0808_create_assignment_completed;
 gsm0808_create_ass_compl;
+gsm0808_create_ass_compl2;
 gsm0808_create_assignment_failure;
 gsm0808_create_ass_fail;
 gsm0808_create_cipher;
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 546a487..e5c1fd3 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -510,11 +510,12 @@
 	struct gsm0808_speech_codec sc;
 	struct gsm0808_speech_codec_list sc_list;
 	static const uint8_t res[] =
-	    { 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22,
+	    { 0x00, 0x1f, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22,
 	      GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04,
 	      0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90,
 	      GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xef,
-	      0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 };
+	      0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0,
+	      GSM0808_IE_LCLS_BSS_STATUS, GSM0808_LCLS_STS_LOCALLY_SWITCHED };
 	struct msgb *msg;
 
 	memset(&sin, 0, sizeof(sin));
@@ -533,8 +534,8 @@
 	setup_codec_list(&sc_list);
 
 	printf("Testing creating Assignment Complete (AoIP)\n");
-	msg = gsm0808_create_ass_compl(0x23, 0x42, 0x11, 0x22,
-				       &ss, &sc, &sc_list);
+	msg = gsm0808_create_ass_compl2(0x23, 0x42, 0x11, 0x22,
+					&ss, &sc, &sc_list, GSM0808_LCLS_STS_LOCALLY_SWITCHED);
 	VERIFY(msg, res, ARRAY_SIZE(res));
 	msgb_free(msg);
 }

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I547c6b8707123aa8c1ef636db88908df112d90a4
Gerrit-Change-Number: 12483
Gerrit-PatchSet: 5
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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190119/06342045/attachment.htm>


More information about the gerrit-log mailing list