Commit
dfcb514076f17b58727cae8fe3e0e156769370f8
by Pau Espin Pedrol
iu_rnc: Split iu_rnc_register API into 2 steps
Split lookup+allocation from RAI updating. This will be needed once we start creating iu_rnc objects upon SCCP rx RANAP RESET messages, which hold Global RNC-ID but no RAI information.
Commit
b9c9271a1f7a54a22034dec80e90e29970b02aad
by Pau Espin Pedrol
ranap: Improve error handling in Rx RESET
* Verify the CN Indicator is set to PS to avoid reacting on content from unexpected peers (eg. IuCS). If none is set, be permissive on rx and assume PS.
* If GlobalRNC-ID IE is missing, reject the RESET with an Error Indication towards the peer to notify about the rejection. Same if we couldn't decode properly it.
* Introduce Tx helpers for generic SCCP UNITDATA.req and RANAP Error Indication helpers to simplify code and avoid duplication.
Commit
7673bbd7ad45bdced262e79796d1870bacb59427
by Pau Espin Pedrol
ranap: Create iu_rnc upon rx RESET
RANAP RESET, the first message an SGSN usually receives from an RNC, contain the GlobalRNC-ID we can already use to register the iu_rnc object. This allows keeping track of peers since first message, before first InitialUE message is received. Once we start tracking peer RNC state within osmo-sgsn (as we already do in other osmo-* programs), this will be needed.
Commit
a24ebc7051a693ee0a35775e9ec69713f6985034
by Pau Espin Pedrol
iu_rnc: Introduce helper API iu_rnc_discard_all_ue_ctx()
This is a preparation commit to introduce iu_rnc_fsm in follow-up patch. The helper API will be used whenever the entire RNC is considered reset.
* Code inside handle_notice_ind() is moved to its own function iu_rnc_discard_all_ue_ctx(). * Dependent helper ue_ctx_link_invalidated_free() API is properly prefixed/renamed to ue_conn_ctx_link_invalidated_free(), where methods for ue_conn_ctx object are placed. * ue_conn_ctx_find() is properly prefixed/renamed to sgsn_scu_iups_ue_conn_ctx_find() and made available to functions in other files.
Commit
d6c29beaf334e957b2fd4c146cae88150cac8b53
by Pau Espin Pedrol
Introduce iu_rnc FSM
This FSM is similar to the already existing ran_peer_fsm in osmo-msc, which already had better logic around SCCP and RANAP state handling. Similarly, osmo-sgsn's struct ranap_iu_rnc maps to osmo-msc's struct ran_peer.
With this FSM we can currently track the RANAP link state towards a given RNC peer: * Reject (RANAP Error Indication) all UE-related messages until a RANAP RESET from RNC is received first. * Tear down all subsriber connections whenever the RANAP peer sends us a RESET message. * Tear down all subscriber connections whenever the SCCP link towards RNC becomes unavailable. * Send a RESET towards RNC peer once the SCCP link towrdards it becomes available again.
This commit only implements so far the Rx path of the FSM, ie. when receiving events/messages from a peer over SCCP and pushing them locally up the stack (RANAP). The Tx side will be implemented in a follow-up commit, which will allow discarding messages if the lower layers towards a given RNC are known to be down.
Commit
1fd205f0b838392625303671b240aaaf7c9c4dac
by Pau Espin Pedrol
ranap: Take into account RNC availability during paging
Avoid transmitting a RANAP paging message to an RNC if we already know it's not currently available over SCCP. Take into account that information when deciding/printing whether the paging could be sent or not.
Take the chance to clean up the iu paging function helpers inherited from osmo-iuh iu_client.c to better fit the data domain in osmo-sgsn (iu_rnc).