<p>Pau Espin Pedrol <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/14017">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm0808: Introduce Osmocom extensions to announce Osmux support<br><br>IE GSM0808_IE_OSMO_OSMUX_SUPPORT (T, 1 byte) is sent in AoIP appended to<br>BSSMAP RESET in order to announce the peer that its MGW supports handling<br>Osmux streams upon call set up.<br><br>IE GSM0808_IE_OSMO_OSMUX_CID (TV, T 1 byte & V 1 byte) is sent in AoIP<br>during call set up:<br>* MSC->BSC Assignment Request<br>* BSC->MSC Assignemnt Complete<br><br>The 1 byte value contains the local Osmux CID, aka the recvCID aka CID where the<br>peer sending the Assign Req/Compl will look for Osmux frames on that<br>call. Hence, the peer receiving this CID value must use it to send Osmux<br>frames for that call.<br><br>As a result, a given call leg BSC<->MSC can have one different Osmux CID<br>per direction. For example:<br>* MS => MGW_BSC ==CID 0==> MGW_MSC<br>* MS <= MGW_BSC <=CID 1=== MGW_MSC<br><br>This allows for setups with 256 call legs per BSC on scenarios where NAT<br>is not a problem, where MSC can have a pool of 256 CID per MGW_BSC (or<br>remote peer).<br><br>Related: OS#2551<br>Change-Id: I28f83e2e32b9533c99e65ccc1562900ac2aec74e<br>---<br>M include/osmocom/gsm/gsm0808_utils.h<br>M include/osmocom/gsm/protocol/gsm_08_08.h<br>M src/gsm/gsm0808.c<br>M src/gsm/gsm0808_utils.c<br>M src/gsm/libosmogsm.map<br>5 files changed, 29 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h</span><br><span>index 3a7beb7..9cfaea6 100644</span><br><span>--- a/include/osmocom/gsm/gsm0808_utils.h</span><br><span>+++ b/include/osmocom/gsm/gsm0808_utils.h</span><br><span>@@ -100,6 +100,7 @@</span><br><span>                                  const struct sockaddr_storage *ss);</span><br><span> int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,</span><br><span>                              const uint8_t *elem, uint8_t len);</span><br><span style="color: hsl(120, 100%, 40%);">+int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len);</span><br><span> </span><br><span> uint8_t gsm0808_enc_lcls(struct msgb *msg, const struct osmo_lcls *lcls);</span><br><span> int gsm0808_dec_lcls(struct osmo_lcls *lcls, const struct tlv_parsed *tp);</span><br><span>diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h</span><br><span>index aa01ee5..9806e08 100644</span><br><span>--- a/include/osmocom/gsm/protocol/gsm_08_08.h</span><br><span>+++ b/include/osmocom/gsm/protocol/gsm_08_08.h</span><br><span>@@ -303,6 +303,10 @@</span><br><span>    GSM0808_IE_SELECTED_OPERATOR            = 0x98,</span><br><span>      GSM0808_IE_PS_REGISTERED_OPERATOR       = 0x99,</span><br><span>      GSM0808_IE_CS_REGISTERED_OPERATOR       = 0x9a,</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Osmocom extensions: */</span><br><span style="color: hsl(120, 100%, 40%);">+     GSM0808_IE_OSMO_OSMUX_SUPPORT           = 0xf0,</span><br><span style="color: hsl(120, 100%, 40%);">+       GSM0808_IE_OSMO_OSMUX_CID               = 0xf1,</span><br><span> };</span><br><span> </span><br><span> /* 3GPP TS 48.008 3.2.3 Signalling Field Element Coding */</span><br><span>diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c</span><br><span>index 3c77c77..514d7f2 100644</span><br><span>--- a/src/gsm/gsm0808.c</span><br><span>+++ b/src/gsm/gsm0808.c</span><br><span>@@ -1387,6 +1387,10 @@</span><br><span>            [GSM0808_IE_CN_TO_MS_TRANSP_INFO]       = { TLV_TYPE_TLV },</span><br><span>          [GSM0808_IE_SELECTED_PLMN_ID]           = { TLV_TYPE_FIXED, 3 },</span><br><span>             [GSM0808_IE_LAST_USED_EUTRAN_PLMN_ID]   = { TLV_TYPE_FIXED, 3 },</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+            /* Osmocom extensions */</span><br><span style="color: hsl(120, 100%, 40%);">+              [GSM0808_IE_OSMO_OSMUX_SUPPORT]         = { TLV_TYPE_T },</span><br><span style="color: hsl(120, 100%, 40%);">+             [GSM0808_IE_OSMO_OSMUX_CID]             = { TLV_TYPE_TV },</span><br><span>   },</span><br><span> };</span><br><span> </span><br><span>diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c</span><br><span>index e825930..26f7944 100644</span><br><span>--- a/src/gsm/gsm0808_utils.c</span><br><span>+++ b/src/gsm/gsm0808_utils.c</span><br><span>@@ -172,6 +172,25 @@</span><br><span>         return (int)(elem - old_elem);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Decode TS 08.08 (Osmocom Extension) Osmux CID</span><br><span style="color: hsl(120, 100%, 40%);">+ *  TV with len(V) == 1, and V is the CID to be used.</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[out] cid Caller-provided variable where CID is stored</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] elem pointer to IE value</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] len length of \a elem in bytes</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \returns number of bytes parsed */</span><br><span style="color: hsl(120, 100%, 40%);">+int gsm0808_dec_osmux_cid(uint8_t *cid, const uint8_t *elem, uint8_t len)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     OSMO_ASSERT(cid);</span><br><span style="color: hsl(120, 100%, 40%);">+     if (!elem)</span><br><span style="color: hsl(120, 100%, 40%);">+            return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       if (len != 1)</span><br><span style="color: hsl(120, 100%, 40%);">+         return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     *cid = *elem;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       return 1;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #endif /* HAVE_SYS_SOCKET_H */</span><br><span> </span><br><span> /* Helper function for gsm0808_enc_speech_codec()</span><br><span>diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map</span><br><span>index 840bac9..0f4a0db 100644</span><br><span>--- a/src/gsm/libosmogsm.map</span><br><span>+++ b/src/gsm/libosmogsm.map</span><br><span>@@ -198,6 +198,7 @@</span><br><span> gsm0808_enc_cause;</span><br><span> gsm0808_enc_aoip_trasp_addr;</span><br><span> gsm0808_dec_aoip_trasp_addr;</span><br><span style="color: hsl(120, 100%, 40%);">+gsm0808_dec_osmux_cid;</span><br><span> gsm0808_enc_speech_codec;</span><br><span> gsm0808_dec_speech_codec;</span><br><span> gsm0808_enc_speech_codec_list;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/14017">change 14017</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/14017"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I28f83e2e32b9533c99e65ccc1562900ac2aec74e </div>
<div style="display:none"> Gerrit-Change-Number: 14017 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>