aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-04-16 15:47:59 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-05-13 17:54:44 +0200
commit18506c850c3bbcbfa814e07dc02a17fdb5f7bb9a (patch)
treedc184100572bce10bf914f030f35f18387d8db7c
parent38176d297d63af994dcd2d96bdc0b93895db98dd (diff)
gsm0808: Introduce Osmocom extensions to announce Osmux support
IE GSM0808_IE_OSMO_OSMUX_SUPPORT (T, 1 byte) is sent in AoIP appended to BSSMAP RESET in order to announce the peer that its MGW supports handling Osmux streams upon call set up. IE GSM0808_IE_OSMO_OSMUX_CID (TV, T 1 byte & V 1 byte) is sent in AoIP during call set up: * MSC->BSC Assignment Request * BSC->MSC Assignemnt Complete The 1 byte value contains the local Osmux CID, aka the recvCID aka CID where the peer sending the Assign Req/Compl will look for Osmux frames on that call. Hence, the peer receiving this CID value must use it to send Osmux frames for that call. As a result, a given call leg BSC<->MSC can have one different Osmux CID per direction. For example: * MS => MGW_BSC ==CID 0==> MGW_MSC * MS <= MGW_BSC <=CID 1=== MGW_MSC This allows for setups with 256 call legs per BSC on scenarios where NAT is not a problem, where MSC can have a pool of 256 CID per MGW_BSC (or remote peer). Related: OS#2551 Change-Id: I28f83e2e32b9533c99e65ccc1562900ac2aec74e
-rw-r--r--include/osmocom/gsm/gsm0808_utils.h1
-rw-r--r--include/osmocom/gsm/protocol/gsm_08_08.h4
-rw-r--r--src/gsm/gsm0808.c4
-rw-r--r--src/gsm/gsm0808_utils.c19
-rw-r--r--src/gsm/libosmogsm.map1
5 files changed, 29 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h
index 3a7beb70..9cfaea68 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -100,6 +100,7 @@ uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg,
const struct sockaddr_storage *ss);
int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,
const uint8_t *elem, uint8_t len);
+int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len);
uint8_t gsm0808_enc_lcls(struct msgb *msg, const struct osmo_lcls *lcls);
int gsm0808_dec_lcls(struct osmo_lcls *lcls, const struct tlv_parsed *tp);
diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h
index aa01ee5c..9806e083 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -303,6 +303,10 @@ enum GSM0808_IE_CODING {
GSM0808_IE_SELECTED_OPERATOR = 0x98,
GSM0808_IE_PS_REGISTERED_OPERATOR = 0x99,
GSM0808_IE_CS_REGISTERED_OPERATOR = 0x9a,
+
+ /* Osmocom extensions: */
+ GSM0808_IE_OSMO_OSMUX_SUPPORT = 0xf0,
+ GSM0808_IE_OSMO_OSMUX_CID = 0xf1,
};
/* 3GPP TS 48.008 3.2.3 Signalling Field Element Coding */
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;