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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">xua: On new ASPAC, set and notify other ASPs as inactive<br><br>RFC4666 sec 4.3.4.3.  ASP Active Procedures:<br>"""<br> In the case of an Override mode AS, receipt of an ASP Active message<br>   at an SGP causes the (re)direction of all traffic for the AS to the<br>   ASP that sent the ASP Active message.  Any previously active ASP in<br>   the AS is now considered to be in the state ASP-INACTIVE and SHOULD<br>   no longer receive traffic from the SGP within the AS.  The SGP or<br>   IPSP then MUST send a Notify message ("Alternate ASP_Active") to the<br>   previously active ASP in the AS and SHOULD stop traffic to/from that<br>   ASP.  The ASP receiving this Notify MUST consider itself now in the<br>   ASP-INACTIVE state, if it is not already aware of this via inter-ASP<br>   communication with the Overriding ASP.<br>"""<br><br>Change-Id: I474f5cc1f6cbab72d010d1f8ac7ed2285e4c1c45<br>---<br>M src/xua_as_fsm.c<br>1 file changed, 35 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c</span><br><span>index 5d0b327..c25902e 100644</span><br><span>--- a/src/xua_as_fsm.c</span><br><span>+++ b/src/xua_as_fsm.c</span><br><span>@@ -211,6 +211,37 @@</span><br><span>         return false;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Tell other previously-active ASPs that a new ASP has been activated and mark</span><br><span style="color: hsl(120, 100%, 40%);">+   them as inactive. Used in override mode when an ASP becomes active. */</span><br><span style="color: hsl(120, 100%, 40%);">+static void notify_any_other_active_asp_as_inactive(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp_cmp)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      unsigned int i;</span><br><span style="color: hsl(120, 100%, 40%);">+       struct msgb *msg;</span><br><span style="color: hsl(120, 100%, 40%);">+     struct osmo_xlm_prim_notify npar = {</span><br><span style="color: hsl(120, 100%, 40%);">+          .status_type = M3UA_NOTIFY_T_OTHER,</span><br><span style="color: hsl(120, 100%, 40%);">+           .status_info = M3UA_NOTIFY_I_OT_ALT_ASP_ACT,</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%);">+  if (asp_cmp->asp_id_present)</span><br><span style="color: hsl(120, 100%, 40%);">+               npar.asp_id = asp_cmp->asp_id;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+                struct osmo_ss7_asp *asp = as->cfg.asps[i];</span><br><span style="color: hsl(120, 100%, 40%);">+                if (!asp || !osmo_ss7_asp_active(asp))</span><br><span style="color: hsl(120, 100%, 40%);">+                        continue;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           if (asp_cmp == asp)</span><br><span style="color: hsl(120, 100%, 40%);">+                   continue;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           msg = encode_notify(&npar);</span><br><span style="color: hsl(120, 100%, 40%);">+               osmo_ss7_asp_send(asp, msg);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                osmo_fsm_inst_state_chg(asp->fi, XUA_ASP_S_INACTIVE, 0, 0);</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;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static void t_r_callback(void *_fi)</span><br><span> {</span><br><span>     struct osmo_fsm_inst *fi = _fi;</span><br><span>@@ -321,7 +352,10 @@</span><br><span>               }</span><br><span>            break;</span><br><span>       case XUA_ASPAS_ASP_ACTIVE_IND:</span><br><span style="color: hsl(0, 100%, 40%);">-          /* ignore */</span><br><span style="color: hsl(120, 100%, 40%);">+          asp = data;</span><br><span style="color: hsl(120, 100%, 40%);">+           /* RFC466 sec 4.3.4.3 ASP Active Procedures*/</span><br><span style="color: hsl(120, 100%, 40%);">+         if (xafp->as->cfg.mode == OSMO_SS7_AS_TMOD_OVERRIDE)</span><br><span style="color: hsl(120, 100%, 40%);">+                    notify_any_other_active_asp_as_inactive(xafp->as, asp);</span><br><span>           break;</span><br><span>       case XUA_AS_E_TRANSFER_REQ:</span><br><span>          /* message for transmission */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/15993">change 15993</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/+/15993"/><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: I474f5cc1f6cbab72d010d1f8ac7ed2285e4c1c45 </div>
<div style="display:none"> Gerrit-Change-Number: 15993 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </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>