fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/39118?usp=email )
Change subject: [WIP] s1gw_metrics: complete E-RAB MODIFICATION CNF/IND ......................................................................
[WIP] s1gw_metrics: complete E-RAB MODIFICATION CNF/IND
Change-Id: Icc16a57d40b68bd17c5d207b643927d58176e088 --- M include/s1gw_metrics.hrl M src/s1ap_proxy.erl M src/s1gw_metrics.erl 3 files changed, 54 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/18/39118/1
diff --git a/include/s1gw_metrics.hrl b/include/s1gw_metrics.hrl index 1b402d4..5b3c484 100644 --- a/include/s1gw_metrics.hrl +++ b/include/s1gw_metrics.hrl @@ -24,6 +24,7 @@ -define(S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_RELEASE_RSP, [ctr, s1ap, proxy, in_pkt, erab_release_rsp]). -define(S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_RELEASE_IND, [ctr, s1ap, proxy, in_pkt, erab_release_ind]). -define(S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_MOD_IND, [ctr, s1ap, proxy, in_pkt, erab_mod_ind]). +-define(S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_MOD_CNF, [ctr, s1ap, proxy, in_pkt, erab_mod_cnf]). -define(S1GW_CTR_S1AP_PROXY_IN_PKT_INIT_CTX_REQ, [ctr, s1ap, proxy, in_pkt, init_ctx_req]). -define(S1GW_CTR_S1AP_PROXY_IN_PKT_INIT_CTX_RSP, [ctr, s1ap, proxy, in_pkt, init_ctx_rsp]). -define(S1GW_CTR_S1AP_PROXY_OUT_PKT_FWD_ALL, [ctr, s1ap, proxy, out_pkt, forward, all]). diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index 83225b1..c6f5c54 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -371,6 +371,26 @@ PDU = {Outcome, Msg#'InitiatingMessage'{value = C1}}, {{forward, PDU}, S2};
+%% 9.1.3.9 E-RAB MODIFICATION CONFIRM +handle_pdu({Outcome = successfulOutcome, + #'SuccessfulOutcome'{procedureCode = ?'id-E-RABModificationIndication', + value = C0} = Msg}, S0) -> + ?LOG_DEBUG("Processing E-RAB MODIFICATION CONFIRM"), + s1gw_metrics:ctr_inc(?S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_MOD_CNF), + IEs0 = C0#'E-RABModificationConfirm'.protocolIEs, + %% E-RAB Modify List + %% TODO: handle {error, Reason} + {{ok, IEs1}, S1} = handle_ies(?'id-E-RABModifyListBearerModConf', IEs0, S0), + %% E-RAB Failed to Modify List + %% TODO: handle {error, Reason} + {{ok, IEs2}, S2} = handle_ies(?'id-E-RABFailedToModifyListBearerModConf', IEs1, S1), + %% E-RAB To Be Released List + %% TODO: handle {error, Reason} + {{ok, IEs3}, S3} = handle_ies(?'id-E-RABToBeReleasedListBearerModConf', IEs2, S2), + C1 = C0#'E-RABModificationConfirm'{protocolIEs = IEs3}, + PDU = {Outcome, Msg#'SuccessfulOutcome'{value = C1}}, + {{forward, PDU}, S3}; + %% 9.1.4.1 INITIAL CONTEXT SETUP REQUEST handle_pdu({Outcome = initiatingMessage, #'InitiatingMessage'{procedureCode = ?'id-InitialContextSetup', @@ -612,7 +632,7 @@ {{error, erab_not_registered}, S} end;
-%% E-RAB MODIFICATION INDICATION related IEs +%% 9.1.3.8 E-RAB MODIFICATION INDICATION related IEs handle_ie([?'id-E-RABToBeModifiedListBearerModInd'], C, S) -> %% This IE contains a list of BearerModInd, so patch inner IEs handle_ies(?'id-E-RABToBeModifiedItemBearerModInd', C, S); @@ -633,6 +653,37 @@ %% TODO: find and poke an E-RAB FSM associated with this E-RAB {{ok, C}, S};
+%% 9.1.3.9 E-RAB MODIFICATION CONFIRM related IEs +handle_ie([?'id-E-RABModifyListBearerModConf'], C, S) -> + %% This IE contains a list of BearerModConf, so patch inner IEs + handle_ies(?'id-E-RABModifyItemBearerModConf', C, S); + +handle_ie([?'id-E-RABModifyItemBearerModConf', + ?'id-E-RABModifyListBearerModConf'], + #'E-RABModifyItemBearerModConf'{} = C, S) -> + %% TODO: find and poke an E-RAB FSM associated with this E-RAB + {{ok, C}, S}; + +handle_ie([?'id-E-RABFailedToModifyListBearerModConf'], C, S) -> + %% This IE contains a list of E-RABItem, so patch inner IEs + handle_ies(?'id-E-RABItem', C, S); + +handle_ie([?'id-E-RABItem', + ?'id-E-RABFailedToModifyListBearerModConf'], + #'E-RABItem'{} = C, S) -> + %% TODO: find and poke an E-RAB FSM associated with this E-RAB + {{ok, C}, S}; + +handle_ie([?'id-E-RABToBeReleasedListBearerModConf'], C, S) -> + %% This IE contains a list of E-RABItem, so patch inner IEs + handle_ies(?'id-E-RABItem', C, S); + +handle_ie([?'id-E-RABItem', + ?'id-E-RABToBeReleasedListBearerModConf'], + #'E-RABItem'{} = C, S) -> + %% TODO: find and poke an E-RAB FSM associated with this E-RAB + {{ok, C}, S}; + %% INITIAL CONTEXT SETUP REQUEST related IEs handle_ie([?'id-E-RABToBeSetupListCtxtSUReq'], C, S) -> %% This IE contains a list of CtxtSUReq, so patch inner IEs diff --git a/src/s1gw_metrics.erl b/src/s1gw_metrics.erl index 79b1ffd..a716578 100644 --- a/src/s1gw_metrics.erl +++ b/src/s1gw_metrics.erl @@ -75,6 +75,7 @@ ?S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_RELEASE_RSP, %% E-RAB RELEASE.rsp PDUs ?S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_RELEASE_IND, %% E-RAB RELEASE.ind PDUs ?S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_MOD_IND, %% E-RAB MODIFY.ind PDUs + ?S1GW_CTR_S1AP_PROXY_IN_PKT_ERAB_MOD_CNF, %% E-RAB MODIFY.cnf PDUs ?S1GW_CTR_S1AP_PROXY_IN_PKT_INIT_CTX_REQ, %% INITIAL CONTEXT SETUP.req PDUs ?S1GW_CTR_S1AP_PROXY_IN_PKT_INIT_CTX_RSP, %% INITIAL CONTEXT SETUP.rsp PDUs %% s1ap_proxy: OUTgoing PDU counters