diff options
Diffstat (limited to 'src/gsm')
-rw-r--r-- | src/gsm/gsm0808.c | 4 | ||||
-rw-r--r-- | src/gsm/gsm0808_utils.c | 19 | ||||
-rw-r--r-- | src/gsm/libosmogsm.map | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 3c77c77a..514d7f22 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1387,6 +1387,10 @@ static const struct tlv_definition bss_att_tlvdef = { [GSM0808_IE_CN_TO_MS_TRANSP_INFO] = { TLV_TYPE_TLV }, [GSM0808_IE_SELECTED_PLMN_ID] = { TLV_TYPE_FIXED, 3 }, [GSM0808_IE_LAST_USED_EUTRAN_PLMN_ID] = { TLV_TYPE_FIXED, 3 }, + + /* Osmocom extensions */ + [GSM0808_IE_OSMO_OSMUX_SUPPORT] = { TLV_TYPE_T }, + [GSM0808_IE_OSMO_OSMUX_CID] = { TLV_TYPE_TV }, }, }; diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index e8259300..26f7944d 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -172,6 +172,25 @@ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, return (int)(elem - old_elem); } +/*! Decode TS 08.08 (Osmocom Extension) Osmux CID + * TV with len(V) == 1, and V is the CID to be used. + * \param[out] cid Caller-provided variable where CID is stored + * \param[in] elem pointer to IE value + * \param[in] len length of \a elem in bytes + * \returns number of bytes parsed */ +int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len) +{ + OSMO_ASSERT(cid); + if (!elem) + return -EINVAL; + if (len != 1) + return -EINVAL; + + *cid = *elem; + + return 1; +} + #endif /* HAVE_SYS_SOCKET_H */ /* Helper function for gsm0808_enc_speech_codec() diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 840bac9c..0f4a0db1 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -198,6 +198,7 @@ gsm0808_prepend_dtap_header; gsm0808_enc_cause; gsm0808_enc_aoip_trasp_addr; gsm0808_dec_aoip_trasp_addr; +gsm0808_dec_osmux_cid; gsm0808_enc_speech_codec; gsm0808_dec_speech_codec; gsm0808_enc_speech_codec_list; |