From df32723446f5280fe65bd0ef4f25790e39ec8087 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 28 Dec 2017 22:51:51 +0100 Subject: GSUP Support and first test against OsmoHLR Change-Id: Idd7a6aca1ab193da39294f49a3adc4c1cd7cecff --- library/IPA_Emulation.ttcn | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'library/IPA_Emulation.ttcn') diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn index ddedb39d..9bad69fe 100644 --- a/library/IPA_Emulation.ttcn +++ b/library/IPA_Emulation.ttcn @@ -17,6 +17,7 @@ import from MTP3asp_PortType all; import from RSL_Types all; import from MGCP_Types all; +import from GSUP_Types all; import from Osmocom_CTRL_Types all; @@ -99,6 +100,12 @@ type port IPA_CTRL_PT message { inout CtrlMessage, ASP_IPA_Event; } with { extension "internal" } +/* Client port for CTRL inside IPA */ +type port IPA_GSUP_PT message { + inout GSUP_PDU, ASP_IPA_Event; +} with { extension "internal" } + + type component IPA_Emulation_CT { /* down-facing port to IPA codec port */ port IPA_CODEC_PT IPA_PORT; @@ -110,6 +117,9 @@ type component IPA_Emulation_CT { port IPA_RSL_PT IPA_RSL_PORT; /* up-facing port for CTRL */ port IPA_CTRL_PT IPA_CTRL_PORT; + /* up-facing port for GSUP */ + port IPA_GSUP_PT IPA_GSUP_PORT; + /* up-facing port for other streams */ port IPA_SP_PT IPA_SP_PORT; @@ -193,6 +203,9 @@ private function f_send_IPA_EVT(template ASP_IPA_Event evt) runs on IPA_Emulatio if (IPA_CTRL_PORT.checkstate("Connected")) { IPA_CTRL_PORT.send(evt); } + if (IPA_GSUP_PORT.checkstate("Connected")) { + IPA_GSUP_PORT.send(evt); + } /* FIXME: to other ports */ } @@ -348,6 +361,10 @@ private function f_ctrl_to_user(octetstring msg) runs on IPA_Emulation_CT { IPA_CTRL_PORT.send(dec_CtrlMessage(msg_ch)); } +private function f_gsup_to_user(octetstring msg) runs on IPA_Emulation_CT { + IPA_GSUP_PORT.send(dec_GSUP_PDU(msg)); +} + private function f_mgcp_to_ud(octetstring payload) runs on IPA_Emulation_CT return ASP_IPA_Unitdata { if (mp_ipa_mgcp_uses_osmo_ext) { return valueof(t_ASP_IPA_UD(IPAC_PROTO_MGCP_OLD, payload)); @@ -365,6 +382,7 @@ private function ScanEvents() runs on IPA_Emulation_CT { var MgcpCommand mgcp_cmd; var MgcpResponse mgcp_rsp; var CtrlMessage ctrl_msg; + var GSUP_PDU gsup_msg; var octetstring payload; var ASP_RSL_Unitdata rsl; @@ -399,6 +417,8 @@ private function ScanEvents() runs on IPA_Emulation_CT { f_mgcp_to_user(ipa_rx.msg); } case (IPAC_PROTO_EXT_CTRL) { f_ctrl_to_user(ipa_rx.msg); + } case (IPAC_PROTO_EXT_GSUP) { + f_gsup_to_user(ipa_rx.msg); } case else { IPA_SP_PORT.send(f_to_asp(ipa_rx)); } @@ -451,6 +471,12 @@ private function ScanEvents() runs on IPA_Emulation_CT { IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud)); } + [] IPA_GSUP_PORT.receive(GSUP_PDU:?) -> value gsup_msg { + payload := enc_GSUP_PDU(gsup_msg); + ipa_ud := valueof(t_ASP_IPA_UD(IPAC_PROTO_OSMO, payload, IPAC_PROTO_EXT_GSUP)); + IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud)); + } + /* Received RSL -> down into IPA */ [] IPA_RSL_PORT.receive(ASP_RSL_Unitdata:?) -> value rsl { IPA_PORT.send(f_from_rsl(g_ipa_conn_id, rsl)); -- cgit v1.2.3