<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/19013">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">add osmo_ss7_asp_get_as()<br><br>For 'cs7' auto configuration, we want to pick up an ASP that is not yet<br>associated with any AS. For that we need to find out whether a given ASP is set<br>up with an AS yet.<br><br>Related: OS#4635<br>Change-Id: Ia028625c5e8fab4f2683d05f78a9a1c0092a2cac<br>---<br>M include/osmocom/sigtran/osmo_ss7.h<br>M src/osmo_ss7.c<br>2 files changed, 16 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/13/19013/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h</span><br><span>index 06cc43c..b7c59c3 100644</span><br><span>--- a/include/osmocom/sigtran/osmo_ss7.h</span><br><span>+++ b/include/osmocom/sigtran/osmo_ss7.h</span><br><span>@@ -454,6 +454,7 @@</span><br><span> int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp);</span><br><span> int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level);</span><br><span> bool osmo_ss7_asp_active(const struct osmo_ss7_asp *asp);</span><br><span style="color: hsl(120, 100%, 40%);">+struct osmo_ss7_as *osmo_ss7_asp_get_as(struct osmo_ss7_asp *asp);</span><br><span> </span><br><span> /*! Weak function to handle payload for unknown/unsupported PPID or IPA StreamID.</span><br><span>  *  This function can be overridden by application code to implement whatever handling</span><br><span>diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c</span><br><span>index ad6f171..8e1fece 100644</span><br><span>--- a/src/osmo_ss7.c</span><br><span>+++ b/src/osmo_ss7.c</span><br><span>@@ -1469,6 +1469,21 @@</span><br><span>        return asp->fi->state == XUA_ASP_S_ACTIVE;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Get the AS that the given ASP is added on, if any.</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param[in] asp  ASP to get the AS for.</span><br><span style="color: hsl(120, 100%, 40%);">+ * \return AS instance, or NULL if the ASP is not added on any AS.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+struct osmo_ss7_as *osmo_ss7_asp_get_as(struct osmo_ss7_asp *asp)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+    struct osmo_ss7_as *as;</span><br><span style="color: hsl(120, 100%, 40%);">+       OSMO_ASSERT(ss7_initialized);</span><br><span style="color: hsl(120, 100%, 40%);">+ llist_for_each_entry(as, &asp->inst->as_list, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+               if (osmo_ss7_as_has_asp(as, asp))</span><br><span style="color: hsl(120, 100%, 40%);">+                     return as;</span><br><span style="color: hsl(120, 100%, 40%);">+    }</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%);">+</span><br><span> /***********************************************************************</span><br><span>  * libosmo-netif integration for SCTP stream server/client</span><br><span>  ***********************************************************************/</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/19013">change 19013</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/libosmo-sccp/+/19013"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia028625c5e8fab4f2683d05f78a9a1c0092a2cac </div>
<div style="display:none"> Gerrit-Change-Number: 19013 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>