* Avoid activating later on if inactive when becoming blocked. * Move to inactive state (and notify peer with ASPIA) if active when becoming blocked. * Attempt re-activation if needed when becoming non-blocked.
Create missing LayerManager fsm in dynamic srv xua asps
Dynamic xUA ASPs in transport_role=server where missing initialization +start of its LayerManager, meaning they had no xua_default_lm_fsm instance attached. Previous the xua_default_lm_fsm didn't do anything internally, but since recently ir properly transitions through states in SG role too, so we want to handle blocking/unblocking, etc.
xua_lm: Add S_INACTIVE state and improve state transitions
The S_INACTIVE state will be needed once we support administrative state block in role ASP/(active)IPSP.
It is also useful now since sometimes we just want to leave an asp in that state without any timer running (eg. asps in override which are not active until the active one goes inactive).
Adding the S_INACTIVE state also allows transitioning states in role SG, since we now have somewhere to go instead of leaving it alwas as S_IDLE.
The S_INACTIVE state also allows staying in that state until the ASP ACT ACK is received, moment at which the ASP is considered ACTIVE according to specs.
Right now it's difficult to grasp what's implemented of the SAP since it was scattered around several places. Put all the SAP forwarding logic into its own file so it's easy to follow and extend (eg. adding new helper functions, etc.)
Previous transition to S_IDLE was wrong, since there's no way to recover from that state unless the SCTP connection is closed. Instead, try harder waiting for some new notifications to try re-activating the ASP and see if the AS becomes active, or end up timing out and reconnecting to re-attempt complete set of steps.
xua_rkm: send_reg_req: Avoid adding Routing Context with value 0
We use routing context 0 internally as "no routing context". Since the Routing Context in the Routing KEy IE in RKM REG REQ is optional, if local rctx is 0 (because we expect to get one allocated by the STP and receive it through RKM REG RESP), avoid sending it with the value 0.
m3ua: m3ua_gen_error_msg(): include Routing Context IE in cause Invalid Routing Context
As per RFC4666 3.8.1: """ The "Invalid Routing Context" error is sent if a message is received from a peer with an invalid (unconfigured) Routing Context value. For this error, the invalid Routing Context(s) MUST be included in the Error message." """
Hence add the originating Routing Context IE so the error message can be further identified. For the same reason, also add the Diagnostic Information for the specific cases in the switch statement, and make them more robust about possible null pointer dereference.
asp: Configure block and shutdown adm state independently
The block/no block and shutdown/no shutdown commands tweak independent states; adapt the code to what's presented to the user. This simplifies handling of both states, since the user may want eg. have it blocked and shutdown, and then "no shutdown" it but make sure it stays blocked so no race condition happens.
xua_asp_fsm: XUA_ASP_E_ASPTM_ASPAC: Validate RCTX AS is associated to ASP
Previously we only validated that a local AS was configured for the provided routing context, but we didn't validate that the AS was actually associated to the requesting ASP.
Instead of looking up on all AS configured in an instance, look up on the subset associated to the ASP we are looking up for. Since we are also not looking a 2nd pass to then validate if ASP and returned AS is related, in worst case this would split lookup complexity by half.
Instead of looking up on all AS configured in an instance, look up on the subset associated to the ASP we are looking up for. Since we are also not looking a 2nd pass to then validate if ASP and returned AS is related, in worst case this would split lookup complexity by half.
Implement timer T10 used for periodic ASP Audit procedure as described in: * ITU Q.704 13.5.2 * rfc4666 4.5.3 * ETSI TS 102 142 V1.1.1
This procedure is used in order to recover the signalling route availability information that may not have been received because of some signalling network failure.