<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/16004">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">xua: ipa_asp_fsm: Allow moving ASP to inactive state<br><br>If AS is configured with Traffic Mode Override, then if a new ASP<br>becomes active, all previous ASPs are considered to be inactive and new<br>data is sent to the newly activated ASP.<br><br>Remark: It's still unclear which methodology/implementation will follow<br>when the last activated ASP becomes inactive/shutdown. Then probably<br>another one should be activated at that time, but that logic is not<br>there implemented as far as I know.<br><br>Change-Id: I4ff246b2f899aaa3cf63bbdb3f3d317dc89b3d15<br>---<br>M src/xua_asp_fsm.c<br>1 file changed, 26 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c</span><br><span>index 3f3d69a..0a84f28 100644</span><br><span>--- a/src/xua_asp_fsm.c</span><br><span>+++ b/src/xua_asp_fsm.c</span><br><span>@@ -749,6 +749,7 @@</span><br><span> </span><br><span> enum ipa_asp_state {</span><br><span>   IPA_ASP_S_DOWN = XUA_ASP_S_DOWN,</span><br><span style="color: hsl(120, 100%, 40%);">+      IPA_ASP_S_INACTIVE = XUA_ASP_S_INACTIVE,</span><br><span>     IPA_ASP_S_ACTIVE = XUA_ASP_S_ACTIVE,</span><br><span>         IPA_ASP_S_WAIT_ID_RESP,         /* Waiting for ID_RESP from peer */</span><br><span>  IPA_ASP_S_WAIT_ID_GET,          /* Waiting for ID_GET from peer */</span><br><span>@@ -977,6 +978,16 @@</span><br><span>    }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static void ipa_asp_fsm_inactive(struct osmo_fsm_inst *fi, uint32_t event, void *data)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ switch (event) {</span><br><span style="color: hsl(120, 100%, 40%);">+      case XUA_ASP_E_M_ASP_DOWN_REQ:</span><br><span style="color: hsl(120, 100%, 40%);">+                ipa_asp_fsm_del_route(fi->priv);</span><br><span style="color: hsl(120, 100%, 40%);">+           osmo_fsm_inst_state_chg(fi, IPA_ASP_S_DOWN, 0, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+            break;</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 void ipa_asp_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)</span><br><span> {</span><br><span>    struct ipa_asp_fsm_priv *iafp = fi->priv;</span><br><span>@@ -1010,6 +1021,11 @@</span><br><span>        dispatch_to_all_as(fi, XUA_ASPAS_ASP_ACTIVE_IND);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static void ipa_asp_fsm_inactive_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        dispatch_to_all_as(fi, XUA_ASPAS_ASP_INACTIVE_IND);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static void ipa_pong_timer_cb(void *_fi)</span><br><span> {</span><br><span>    struct osmo_fsm_inst *fi = _fi;</span><br><span>@@ -1074,11 +1090,20 @@</span><br><span>    [IPA_ASP_S_ACTIVE] = {</span><br><span>               .in_event_mask = S(XUA_ASP_E_M_ASP_DOWN_REQ) |</span><br><span>                                S(XUA_ASP_E_M_ASP_INACTIVE_REQ),</span><br><span style="color: hsl(0, 100%, 40%);">-               .out_state_mask = S(IPA_ASP_S_DOWN),</span><br><span style="color: hsl(120, 100%, 40%);">+          .out_state_mask = S(IPA_ASP_S_DOWN) |</span><br><span style="color: hsl(120, 100%, 40%);">+                           S(IPA_ASP_S_INACTIVE),</span><br><span>             .name = "ASP_ACTIVE",</span><br><span>              .action = ipa_asp_fsm_active,</span><br><span>                .onenter = ipa_asp_fsm_active_onenter,</span><br><span>       },</span><br><span style="color: hsl(120, 100%, 40%);">+    [IPA_ASP_S_INACTIVE] = {</span><br><span style="color: hsl(120, 100%, 40%);">+              .in_event_mask = S(XUA_ASP_E_M_ASP_DOWN_REQ),</span><br><span style="color: hsl(120, 100%, 40%);">+         .out_state_mask = S(IPA_ASP_S_DOWN) |</span><br><span style="color: hsl(120, 100%, 40%);">+                           S(IPA_ASP_S_ACTIVE),</span><br><span style="color: hsl(120, 100%, 40%);">+                .name = "ASP_INACTIVE",</span><br><span style="color: hsl(120, 100%, 40%);">+             .action = ipa_asp_fsm_inactive,</span><br><span style="color: hsl(120, 100%, 40%);">+               .onenter = ipa_asp_fsm_inactive_onenter,</span><br><span style="color: hsl(120, 100%, 40%);">+      },</span><br><span> };</span><br><span> </span><br><span> static void ipa_asp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/16004">change 16004</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/+/16004"/><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: I4ff246b2f899aaa3cf63bbdb3f3d317dc89b3d15 </div>
<div style="display:none"> Gerrit-Change-Number: 16004 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>