[S] Change in ...osmo-s1gw[master]: s1ap_proxy: print unique E-RAB ID in error messages
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38239?usp=email ) Change subject: s1ap_proxy: print unique E-RAB ID in error messages ...................................................................... s1ap_proxy: print unique E-RAB ID in error messages Include the {MME,ENB}-UE-S1AP-ID when printing error messages. Printing E-RAB-ID may be misleading. Change-Id: I7327e25ea407b3a21706e8b5e4487135675d91d5 --- M src/s1ap_proxy.erl 1 file changed, 14 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/39/38239/1 diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index 1df1518..46a7c79 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -53,6 +53,7 @@ -type mme_ue_id() :: 0..16#ffffffff. -type enb_ue_id() :: 0..16#ffffff. -type erab_id() :: 0..16#ff. +-type erab_uid() :: {mme_ue_id(), enb_ue_id(), erab_id()}. -record(proxy_state, {erabs :: dict:dict(), mme_ue_id :: undefined | mme_ue_id(), @@ -101,6 +102,12 @@ %% private API %% ------------------------------------------------------------------ +-spec erab_uid(erab_id(), proxy_state()) -> erab_uid(). +erab_uid(ERABId, #proxy_state{mme_ue_id = MmeUeId, + enb_ue_id = EnbUeId}) -> + {MmeUeId, EnbUeId, ERABId}. + + %% Encode an S1AP PDU -spec encode_pdu(tuple()) -> {ok, binary()} | {error, {asn1, tuple()}}. @@ -273,7 +280,7 @@ {ok, Pid} -> ok = erab_fsm:erab_release_req(Pid); error -> - ?LOG_ERROR("E-RAB-ID ~p is not registered", [ERABId]) + ?LOG_ERROR("E-RAB ~p is not registered", [erab_uid(ERABId, S)]) end, {Content, S}; @@ -291,7 +298,7 @@ {ok, Pid} -> ok = erab_fsm:erab_release_rsp(Pid); error -> - ?LOG_ERROR("E-RAB-ID ~p is not registered", [ERABId]) + ?LOG_ERROR("E-RAB ~p is not registered", [erab_uid(ERABId, S)]) end, {Content, S}; @@ -352,7 +359,7 @@ C0#'E-RABSetupItemCtxtSURes'{'transportLayerAddress' = TLA_Out, 'gTP-TEID' = << TEID_Out:32/big >>}; error -> - ?LOG_ERROR("E-RAB-ID ~p is not registered", [ERABId]), + ?LOG_ERROR("E-RAB ~p is not registered", [erab_uid(ERABId, S)]), C0 %% XXX: proxy as-is or drop? end, {C1, S}; @@ -391,19 +398,15 @@ -spec erab_fsm_start_reg(erab_id(), proxy_state()) -> {pid(), proxy_state()}. -erab_fsm_start_reg(RABId, #proxy_state{erabs = ERABs, - mme_ue_id = MmeUeId, - enb_ue_id = EnbUeId} = S) -> - UID = {MmeUeId, EnbUeId, RABId}, +erab_fsm_start_reg(RABId, #proxy_state{erabs = ERABs} = S) -> + UID = erab_uid(RABId, S), {ok, Pid} = erab_fsm:start_link(UID), {Pid, S#proxy_state{erabs = dict:store(UID, Pid, ERABs)}}. -spec erab_fsm_find(erab_id(), proxy_state()) -> {ok, pid()} | error. -erab_fsm_find(RABId, #proxy_state{erabs = ERABs, - mme_ue_id = MmeUeId, - enb_ue_id = EnbUeId}) -> - UID = {MmeUeId, EnbUeId, RABId}, +erab_fsm_find(RABId, #proxy_state{erabs = ERABs} = S) -> + UID = erab_uid(RABId, S), dict:find(UID, ERABs). %% vim:set ts=4 sw=4 et: -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38239?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I7327e25ea407b3a21706e8b5e4487135675d91d5 Gerrit-Change-Number: 38239 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
participants (1)
-
fixeria