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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm0808: Add encoding functions for LCLS BSSMAP messages<br><br>Change-Id: Ib83143e467df068b7d462a8e51d94b9d961ce18f<br>---<br>M include/osmocom/gsm/gsm0808.h<br>M src/gsm/gsm0808.c<br>M src/gsm/libosmogsm.map<br>3 files changed, 68 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h</span><br><span>index 5c03400..8402957 100644</span><br><span>--- a/include/osmocom/gsm/gsm0808.h</span><br><span>+++ b/include/osmocom/gsm/gsm0808.h</span><br><span>@@ -80,6 +80,11 @@</span><br><span>                                 const struct gsm0808_cell_id_list *cil,</span><br><span>                              const uint8_t *chan_needed)</span><br><span>                                  OSMO_DEPRECATED("use gsm0808_create_paging2 instead");</span><br><span style="color: hsl(120, 100%, 40%);">+struct msgb *gsm0808_create_lcls_conn_ctrl(enum gsm0808_lcls_config *config,</span><br><span style="color: hsl(120, 100%, 40%);">+                                        enum gsm0808_lcls_control *control);</span><br><span style="color: hsl(120, 100%, 40%);">+struct msgb *gsm0808_create_lcls_conn_ctrl_ack(enum gsm0808_lcls_status status);</span><br><span style="color: hsl(120, 100%, 40%);">+struct msgb *gsm0808_create_lcls_notification(enum gsm0808_lcls_status status, bool break_req);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> </span><br><span> /*! 3GPP TS 48.008 ยง3.2.2.5.8 Old BSS to New BSS information */</span><br><span> struct gsm0808_old_bss_to_new_bss_info {</span><br><span>diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c</span><br><span>index 5af53ee..347e985 100644</span><br><span>--- a/src/gsm/gsm0808.c</span><br><span>+++ b/src/gsm/gsm0808.c</span><br><span>@@ -282,6 +282,66 @@</span><br><span>     return msg;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Create BSSMAP LCLS CONNECT CONTROL message (TS 48.008 3.2.1.91).</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] config LCLS Configuration</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] control LCLS Connection Status Control</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \returns callee-allocated msgb with BSSMAP LCLS NOTIFICATION */</span><br><span style="color: hsl(120, 100%, 40%);">+struct msgb *gsm0808_create_lcls_conn_ctrl(enum gsm0808_lcls_config *config,</span><br><span style="color: hsl(120, 100%, 40%);">+                                           enum gsm0808_lcls_control *control)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         "bssmap: LCLS CONN CTRL");</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!msg)</span><br><span style="color: hsl(120, 100%, 40%);">+             return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        msgb_v_put(msg, BSS_MAP_MSG_LCLS_CONNECT_CTRL);</span><br><span style="color: hsl(120, 100%, 40%);">+       if (config)</span><br><span style="color: hsl(120, 100%, 40%);">+           msgb_tv_put(msg, GSM0808_IE_LCLS_CONFIG, *config);</span><br><span style="color: hsl(120, 100%, 40%);">+    if (control)</span><br><span style="color: hsl(120, 100%, 40%);">+          msgb_tv_put(msg, GSM0808_IE_LCLS_CONFIG, *control);</span><br><span style="color: hsl(120, 100%, 40%);">+   msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return msg;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Create BSSMAP LCLS CONNECT CONTROL ACK message (TS 48.008 3.2.1.92).</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] status LCLS BSS Status</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \returns callee-allocated msgb with BSSMAP LCLS NOTIFICATION */</span><br><span style="color: hsl(120, 100%, 40%);">+struct msgb *gsm0808_create_lcls_conn_ctrl_ack(enum gsm0808_lcls_status status)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         "bssmap: LCLS CONN CTRL ACK");</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!msg)</span><br><span style="color: hsl(120, 100%, 40%);">+             return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        msgb_v_put(msg, BSS_MAP_MSG_LCLS_CONNECT_CTRL_ACK);</span><br><span style="color: hsl(120, 100%, 40%);">+   msgb_tv_put(msg, GSM0808_IE_LCLS_BSS_STATUS, status);</span><br><span style="color: hsl(120, 100%, 40%);">+ msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return msg;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Create BSSMAP LCLS NOTIFICATION message (TS 48.008 3.2.1.93).</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] status LCLS BSS Status</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] break_req Include the LCLS BREAK REQ IE (true) or not (false)</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \returns callee-allocated msgb with BSSMAP LCLS NOTIFICATION */</span><br><span style="color: hsl(120, 100%, 40%);">+struct msgb *gsm0808_create_lcls_notification(enum gsm0808_lcls_status status, bool break_req)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,</span><br><span style="color: hsl(120, 100%, 40%);">+                                         "bssmap: LCLS NOTIFICATION");</span><br><span style="color: hsl(120, 100%, 40%);">+        if (!msg)</span><br><span style="color: hsl(120, 100%, 40%);">+             return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        msgb_v_put(msg, BSS_MAP_MSG_LCLS_NOTIFICATION);</span><br><span style="color: hsl(120, 100%, 40%);">+       msgb_tv_put(msg, GSM0808_IE_LCLS_BSS_STATUS, status);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (break_req)</span><br><span style="color: hsl(120, 100%, 40%);">+                msgb_v_put(msg, GSM0808_IE_LCLS_BREAK_REQ);</span><br><span style="color: hsl(120, 100%, 40%);">+   msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return msg;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! Create BSSMAP Classmark Update message</span><br><span>  *  \param[in] cm2 Classmark 2</span><br><span>  *  \param[in] cm2_len length (in octets) of \a cm2</span><br><span>diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map</span><br><span>index 3b9fbfd..c05b4ee 100644</span><br><span>--- a/src/gsm/libosmogsm.map</span><br><span>+++ b/src/gsm/libosmogsm.map</span><br><span>@@ -158,6 +158,9 @@</span><br><span> gsm0808_create_layer3;</span><br><span> gsm0808_create_layer3_aoip;</span><br><span> gsm0808_create_layer3_2;</span><br><span style="color: hsl(120, 100%, 40%);">+gsm0808_create_lcls_conn_ctrl;</span><br><span style="color: hsl(120, 100%, 40%);">+gsm0808_create_lcls_conn_ctrl_ack;</span><br><span style="color: hsl(120, 100%, 40%);">+gsm0808_create_lcls_notification;</span><br><span> gsm0808_create_reset;</span><br><span> gsm0808_create_reset_ack;</span><br><span> gsm0808_create_sapi_reject;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9378">change 9378</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/9378"/><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: Ib83143e467df068b7d462a8e51d94b9d961ce18f </div>
<div style="display:none"> Gerrit-Change-Number: 9378 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>