Change in libosmocore[master]: BSSMAP: tweaks

Harald Welte gerrit-no-reply at
Tue Apr 30 20:45:00 UTC 2019

Harald Welte has submitted this change and it was merged. ( )

Change subject: BSSMAP: tweaks

BSSMAP: tweaks

Change two instances of Speech Version values to enum gsm0808_permitted_speech.
It is often not trivial to find the right values for a uint8_t member, giving
the enum name makes it a lot easier/safer to use.

In gsm0808_create_handover_required(), use msgb_tv_put() so that the enum's
storage size doesn't matter. (Already used for handover_performed)

Fix typo in doc of gsm0808_create_handover_required().

Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112
M include/osmocom/gsm/gsm0808.h
M src/gsm/gsm0808.c
3 files changed, 6 insertions(+), 4 deletions(-)

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

index 7c81e32..db3be49 100644
@@ -19,3 +19,5 @@
 		osmo_quote_str_buf()	  truncated string. This is no longer the case. e.g. a string 'truncated' in a
 					  9-char buffer used to print '"trunca"\0', which now becomes '"truncat\0'.
 libosmocore	osmo_quote_str_buf2()	New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND().
+libosmogsm	gsm0808_handover_required	Storage size changed, speech_version_used now an enum.
+		gsm0808_handover_performed	Storage size changed, speech_version_chosen now an enum.
diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h
index a1345c3..0f2bf1f 100644
--- a/include/osmocom/gsm/gsm0808.h
+++ b/include/osmocom/gsm/gsm0808.h
@@ -133,7 +133,7 @@
 	uint8_t current_channel_type_1;
 	bool speech_version_used_present;
-	uint8_t speech_version_used;
+	enum gsm0808_permitted_speech speech_version_used;
 	bool old_bss_to_new_bss_info_present;
 	struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info;
@@ -196,7 +196,7 @@
 	uint8_t chosen_encr_alg;
 	bool speech_version_chosen_present;
-	uint8_t speech_version_chosen;
+	enum gsm0808_permitted_speech speech_version_chosen;
 	bool speech_codec_chosen_present;
 	struct gsm0808_speech_codec speech_codec_chosen;
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 4873076..3307a5d 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -822,7 +822,7 @@
  * \param[in] params  All information to be encoded.
- * \returns newly allocated msgb with BSSMAP REQUIRED message. */
+ * \returns newly allocated msgb with BSSMAP HANDOVER REQUIRED message. */
 struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_required *params)
 	struct msgb *msg;
@@ -846,7 +846,7 @@
 	/* Speech Version (Used), */
 	if (params->speech_version_used_present)
-		msgb_tv_fixed_put(msg, GSM0808_IE_SPEECH_VERSION, 1, &params->speech_version_used);
+		msgb_tv_put(msg, GSM0808_IE_SPEECH_VERSION, params->speech_version_used);
 	if (params->old_bss_to_new_bss_info_present)
 		put_old_bss_to_new_bss_information(msg, &params->old_bss_to_new_bss_info);

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112
Gerrit-Change-Number: 13577
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list