aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-01-08 14:44:24 +0100
committerHarald Welte <laforge@gnumonks.org>2019-01-19 21:03:56 +0000
commit414c8f565b68199fe1d7dd5d179252127a58ecaf (patch)
treea43aafa1a263ac56d6e4f60870a045028856d537 /src
parentd6ef6f1b9163be659693bb546276ab2f655f9cb9 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsm0808.c38
-rw-r--r--src/gsm/libosmogsm.map1
2 files changed, 32 insertions, 7 deletions
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 59b16575..fce8e0a8 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -519,7 +519,7 @@ struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
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 @@ struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
* \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 @@ struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel,
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 @@ struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel,
* \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 f9e9b8bf..c440a79d 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -153,6 +153,7 @@ gsm0808_create_ass;
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;