<p>daniel has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/22873">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bssgp_bvc_fsm: Add MTU support<br><br>Add functions to get/set the current MTU<br>Default to max MTU size<br><br>Change-Id: I9bb82ead27366b7370c9ff968e03ca2113ec11f0<br>Related: OS#4889<br>---<br>M include/osmocom/gprs/bssgp_bvc_fsm.h<br>M src/gb/bssgp_bvc_fsm.c<br>M src/gb/libosmogb.map<br>3 files changed, 27 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/22873/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gprs/bssgp_bvc_fsm.h b/include/osmocom/gprs/bssgp_bvc_fsm.h</span><br><span>index e69c205..d5096b9 100644</span><br><span>--- a/include/osmocom/gprs/bssgp_bvc_fsm.h</span><br><span>+++ b/include/osmocom/gprs/bssgp_bvc_fsm.h</span><br><span>@@ -64,3 +64,6 @@</span><br><span> uint32_t bssgp_bvc_get_features_advertised(struct osmo_fsm_inst *fi);</span><br><span> uint32_t bssgp_bvc_get_features_received(struct osmo_fsm_inst *fi);</span><br><span> uint32_t bssgp_bvc_get_features_negotiated(struct osmo_fsm_inst *fi);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+void bssgp_bvc_fsm_set_mtu(struct osmo_fsm_inst *fi, uint16_t mtu);</span><br><span style="color: hsl(120, 100%, 40%);">+uint16_t bssgp_bvc_fsm_get_mtu(const struct osmo_fsm_inst *fi);</span><br><span>\ No newline at end of file</span><br><span>diff --git a/src/gb/bssgp_bvc_fsm.c b/src/gb/bssgp_bvc_fsm.c</span><br><span>index 6b8bd14..a1edf58 100644</span><br><span>--- a/src/gb/bssgp_bvc_fsm.c</span><br><span>+++ b/src/gb/bssgp_bvc_fsm.c</span><br><span>@@ -116,6 +116,8 @@</span><br><span> </span><br><span>       /* NSEI of the underlying NS Entity */</span><br><span>       uint16_t nsei;</span><br><span style="color: hsl(120, 100%, 40%);">+        /* MTU of the underlying NS Entity */</span><br><span style="color: hsl(120, 100%, 40%);">+ uint16_t mtu;</span><br><span> </span><br><span>    /* BVCI of this BVC */</span><br><span>       uint16_t bvci;</span><br><span>@@ -666,6 +668,7 @@</span><br><span>         bfp->role_sgsn = role_sgsn;</span><br><span>       bfp->nsei = nsei;</span><br><span>         bfp->bvci = bvci;</span><br><span style="color: hsl(120, 100%, 40%);">+  bfp->mtu = UINT16_MAX;</span><br><span> </span><br><span>        return fi;</span><br><span> }</span><br><span>@@ -817,6 +820,25 @@</span><br><span>       return bfp->features.negotiated;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Set the maximum size of a BSSGP PDU */</span><br><span style="color: hsl(120, 100%, 40%);">+void bssgp_bvc_fsm_set_mtu(struct osmo_fsm_inst *fi, uint16_t mtu)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       struct bvc_fsm_priv *bfp = fi->priv;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     OSMO_ASSERT(fi->fsm == &bssgp_bvc_fsm);</span><br><span style="color: hsl(120, 100%, 40%);">+        bfp->mtu = mtu;</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%);">+/*! Return the maximum size of a BSSGP PDU */</span><br><span style="color: hsl(120, 100%, 40%);">+uint16_t bssgp_bvc_fsm_get_mtu(const struct osmo_fsm_inst *fi)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     const struct bvc_fsm_priv *bfp = fi->priv;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       OSMO_ASSERT(fi->fsm == &bssgp_bvc_fsm);</span><br><span style="color: hsl(120, 100%, 40%);">+        return bfp->mtu;</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> static __attribute__((constructor)) void on_dso_load_bvc_fsm(void)</span><br><span> {</span><br><span>        OSMO_ASSERT(osmo_fsm_register(&bssgp_bvc_fsm) == 0);</span><br><span>diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map</span><br><span>index a3171d0..fe7c4ec 100644</span><br><span>--- a/src/gb/libosmogb.map</span><br><span>+++ b/src/gb/libosmogb.map</span><br><span>@@ -96,6 +96,8 @@</span><br><span> bssgp_bvc_get_features_advertised;</span><br><span> bssgp_bvc_get_features_received;</span><br><span> bssgp_bvc_get_features_negotiated;</span><br><span style="color: hsl(120, 100%, 40%);">+bssgp_bvc_fsm_set_mtu;</span><br><span style="color: hsl(120, 100%, 40%);">+bssgp_bvc_fsm_get_mtu;</span><br><span> </span><br><span> osmo_fr_network_alloc;</span><br><span> osmo_fr_link_alloc;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/22873">change 22873</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/c/libosmocore/+/22873"/><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-Change-Id: I9bb82ead27366b7370c9ff968e03ca2113ec11f0 </div>
<div style="display:none"> Gerrit-Change-Number: 22873 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>