pespin submitted this change.

View Change


Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve
gsup_server: Introduce tx_gsup() internal function

Change-Id: I95d37182da89e39993eb7d5aaf63446e5f99ae2a
---
M src/gsup_server.erl
1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/gsup_server.erl b/src/gsup_server.erl
index a110b40..521d4c3 100644
--- a/src/gsup_server.erl
+++ b/src/gsup_server.erl
@@ -131,8 +131,7 @@
};
{error, _} -> Resp = #{message_type => send_auth_info_err, imsi => Imsi, message_class => 5, cause => ?GSUP_CAUSE_NET_FAIL}
end,
- lager:info("GSUP: Tx ~p~n", [Resp]),
- ipa_proto:send(Socket, ?IPAC_PROTO_EXT_GSUP, Resp),
+ tx_gsup(Socket, Resp),
{noreply, State};

handle_cast({lu_response, {Imsi, Result}}, State) ->
@@ -149,8 +148,7 @@
cause => ?GSUP_CAUSE_NET_FAIL
}
end,
- lager:info("GSUP: Tx ~p~n", [Resp]),
- ipa_proto:send(Socket, ?IPAC_PROTO_EXT_GSUP, Resp),
+ tx_gsup(Socket, Resp),
{noreply, State};

handle_cast({tunnel_response, {Imsi, Result}}, State) ->
@@ -181,8 +179,7 @@
cause => ?GSUP_CAUSE_NET_FAIL
}
end,
- lager:info("GSUP: Tx ~p~n", [Resp]),
- ipa_proto:send(Socket, ?IPAC_PROTO_EXT_GSUP, Resp),
+ tx_gsup(Socket, Resp),
{noreply, State};

handle_cast(Info, S) ->
@@ -223,8 +220,7 @@
message_class => 5,
cause => ?GSUP_CAUSE_IMSI_UNKNOWN
},
- lager:info("GSUP: Tx ~p~n", [Resp]),
- ipa_proto:send(Socket, ?IPAC_PROTO_EXT_GSUP, Resp)
+ tx_gsup(Socket, Resp)
end,
{noreply, State};

@@ -242,8 +238,7 @@
message_class => 5,
cause => ?GSUP_CAUSE_IMSI_UNKNOWN
},
- lager:info("GSUP: Tx ~p~n", [Resp]),
- ipa_proto:send(Socket, ?IPAC_PROTO_EXT_GSUP, Resp)
+ tx_gsup(Socket, Resp)
end,
{noreply, State};

@@ -273,6 +268,11 @@
%% Internal Function Definitions
%% ------------------------------------------------------------------

+tx_gsup(Socket, Msg) ->
+ lager:info("GSUP: Tx ~p~n", [Msg]),
+ ipa_proto:send(Socket, ?IPAC_PROTO_EXT_GSUP, Msg).
+
+
new_gsups_ue(Imsi, State) ->
{ok, Pid} = ue_fsm:start_link(Imsi),
UE = #gsups_ue{imsi = Imsi, pid = Pid},

To view, visit change 35674. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: I95d37182da89e39993eb7d5aaf63446e5f99ae2a
Gerrit-Change-Number: 35674
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged