mirror of https://gerrit.osmocom.org/libosmocore
gsm0808: add gsm0808_create_sapi_reject_cause()
This is basically a successor of gsm0808_create_sapi_reject(), but instead of hard-coding GSM0808_CAUSE_BSS_NOT_EQUIPPED, it allows the caller to specify a cause value to be used. The old function is now deprecated and should not be used. Change-Id: Iefe5484d0fa02d5722b628b1dc237d51d3fb1a9b Related: OS#4728
This commit is contained in:
parent
16b076cd15
commit
fa6cd88ee5
|
@ -7,3 +7,4 @@
|
|||
# If any interfaces have been added since the last public release: c:r:a + 1.
|
||||
# If any interfaces have been removed or changed since the last public release: c:r:0.
|
||||
#library what description / commit summary line
|
||||
libosmogsm new API gsm0808_create_sapi_reject_cause() with cause argument
|
||||
|
|
|
@ -60,7 +60,9 @@ struct msgb *gsm0808_create_cipher_reject_ext(enum gsm0808_cause_class class, ui
|
|||
struct msgb *gsm0808_create_classmark_request();
|
||||
struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len,
|
||||
const uint8_t *cm3, uint8_t cm3_len);
|
||||
struct msgb *gsm0808_create_sapi_reject(uint8_t link_id);
|
||||
struct msgb *gsm0808_create_sapi_reject_cause(uint8_t link_id, uint16_t cause);
|
||||
struct msgb *gsm0808_create_sapi_reject(uint8_t link_id)
|
||||
OSMO_DEPRECATED("Use gsm0808_create_sapi_reject_cause() instead");
|
||||
struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
|
||||
const uint16_t *cic,
|
||||
const struct sockaddr_storage *ss,
|
||||
|
|
|
@ -444,8 +444,9 @@ struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len
|
|||
|
||||
/*! Create BSSMAP SAPI N Reject message
|
||||
* \param[in] link_id Link Identifier
|
||||
* \param[in] cause BSSAP Cause value (see 3GPP TS 48.008, section 3.2.2.5)
|
||||
* \returns callee-allocated msgb with BSSMAP SAPI N Reject message */
|
||||
struct msgb *gsm0808_create_sapi_reject(uint8_t link_id)
|
||||
struct msgb *gsm0808_create_sapi_reject_cause(uint8_t link_id, uint16_t cause)
|
||||
{
|
||||
struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
|
||||
"bssmap: sapi 'n' reject");
|
||||
|
@ -454,13 +455,23 @@ struct msgb *gsm0808_create_sapi_reject(uint8_t link_id)
|
|||
|
||||
msgb_v_put(msg, BSS_MAP_MSG_SAPI_N_REJECT);
|
||||
msgb_tv_put(msg, GSM0808_IE_DLCI, link_id);
|
||||
gsm0808_enc_cause(msg, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
|
||||
gsm0808_enc_cause(msg, cause);
|
||||
|
||||
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
/*! Create BSSMAP SAPI N Reject message (with hard-coded cause "BSS not equipped").
|
||||
* DEPRECATED: use gsm0808_create_sapi_reject_cause() instead.
|
||||
* \param[in] link_id Link Identifier
|
||||
* \param[in] cause BSSAP Cause value (see 3GPP TS 48.008, section 3.2.2.5)
|
||||
* \returns callee-allocated msgb with BSSMAP SAPI N Reject message */
|
||||
struct msgb *gsm0808_create_sapi_reject(uint8_t link_id)
|
||||
{
|
||||
return gsm0808_create_sapi_reject_cause(link_id, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
|
||||
}
|
||||
|
||||
/*! Create BSSMAP Assignment Request message, 3GPP TS 48.008 §3.2.1.1.
|
||||
* This is identical to gsm0808_create_ass(), but adds KC and LCLS IEs.
|
||||
* \param[in] ct Channel Type
|
||||
|
|
|
@ -190,6 +190,7 @@ gsm0808_create_lcls_conn_ctrl_ack;
|
|||
gsm0808_create_lcls_notification;
|
||||
gsm0808_create_reset;
|
||||
gsm0808_create_reset_ack;
|
||||
gsm0808_create_sapi_reject_cause;
|
||||
gsm0808_create_sapi_reject;
|
||||
gsm0808_create_handover_required;
|
||||
gsm0808_create_handover_required_reject;
|
||||
|
|
|
@ -374,7 +374,7 @@ static void test_create_sapi_reject()
|
|||
struct msgb *msg;
|
||||
|
||||
printf("Testing creating SAPI Reject\n");
|
||||
msg = gsm0808_create_sapi_reject(3);
|
||||
msg = gsm0808_create_sapi_reject_cause(3, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
|
||||
VERIFY(msg, res, ARRAY_SIZE(res));
|
||||
msgb_free(msg);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue