summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-16 22:31:15 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-05-27 22:04:17 +0200
commitb662b36da0bd3bd6ccad65e1614df1466a30d20d (patch)
tree7b48a77f7fc8a2893178a0cd7b4abd128918836f
parent70aba3ffe2e6dbff4b8bf17c0f1273d8b4387109 (diff)
add gsm0808_create_handover_request_ack()
Related: OS#2283 (inter-BSC Handover, BSC side, MT) Change-Id: I692292a06c7d66004404560dc4ed933ca9107f9b
-rw-r--r--include/osmocom/gsm/gsm0808.h4
-rw-r--r--src/gsm/gsm0808.c25
-rw-r--r--src/gsm/libosmogsm.map1
3 files changed, 30 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h
index 4f239e66..5c03400c 100644
--- a/include/osmocom/gsm/gsm0808.h
+++ b/include/osmocom/gsm/gsm0808.h
@@ -117,6 +117,10 @@ struct gsm0808_handover_required {
};
struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_required *params);
+struct msgb *gsm0808_create_handover_request_ack(const uint8_t *l3_info, uint8_t l3_info_len,
+ uint8_t chosen_channel, uint8_t chosen_encr_alg,
+ uint8_t chosen_speech_version);
+
struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id);
void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id);
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 80f5e6ce..5af53ee6 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -679,6 +679,31 @@ struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_requ
return msg;
}
+/*! Create BSSMAP HANDOVER REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 3.2.1.10. */
+struct msgb *gsm0808_create_handover_request_ack(const uint8_t *l3_info, uint8_t l3_info_len,
+ uint8_t chosen_channel, uint8_t chosen_encr_alg,
+ uint8_t chosen_speech_version)
+{
+ struct msgb *msg;
+
+ msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "BSSMAP-HANDOVER-ACCEPT-ACK");
+ if (!msg)
+ return NULL;
+
+ /* Message Type, 3.2.2.1 */
+ msgb_v_put(msg, BSS_MAP_MSG_HANDOVER_RQST_ACKNOWLEDGE);
+
+ /* Layer 3 Information, 3.2.2.24 */
+ msgb_tlv_put(msg, GSM0808_IE_LAYER_3_INFORMATION, l3_info_len, l3_info);
+
+ msgb_tv_put(msg, GSM0808_IE_CHOSEN_CHANNEL, chosen_channel);
+ msgb_tv_put(msg, GSM0808_IE_CHOSEN_ENCR_ALG, chosen_encr_alg);
+ if (chosen_speech_version != 0)
+ msgb_tv_put(msg, GSM0808_IE_SPEECH_VERSION, chosen_speech_version);
+
+ return msg;
+}
+
/*! Prepend a DTAP header to given Message Buffer
* \param[in] msgb Message Buffer
* \param[in] link_id Link Identifier */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 58a5bfe5..3b9fbfdd 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -162,6 +162,7 @@ gsm0808_create_reset;
gsm0808_create_reset_ack;
gsm0808_create_sapi_reject;
gsm0808_create_handover_required;
+gsm0808_create_handover_request_ack;
gsm0808_prepend_dtap_header;
gsm0808_enc_aoip_trasp_addr;
gsm0808_dec_aoip_trasp_addr;