diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-02-06 22:26:46 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-02-17 14:29:21 +0100 |
commit | c682666feacf8a1013dac16fbe42156098d03de9 (patch) | |
tree | 9d4251c15d0b7601b98f264743d7cff788db198c /library/IPA_Emulation.ttcnpp | |
parent | 0aa0abc36da2e26fb77c897bafc28415842e7b5c (diff) |
IPA_Emulation: Integrate OML decoding/encoding; add OML port
Change-Id: Id0dabe7eca4f81d22a60b346ac598be81533f53c
Diffstat (limited to 'library/IPA_Emulation.ttcnpp')
-rw-r--r-- | library/IPA_Emulation.ttcnpp | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp index 413d2909..f5563276 100644 --- a/library/IPA_Emulation.ttcnpp +++ b/library/IPA_Emulation.ttcnpp @@ -31,6 +31,10 @@ import from MTP3asp_PortType all; import from RSL_Types all; #endif +#ifdef IPA_EMULATION_OML +import from AbisOML_Types all; +#endif + #ifdef IPA_EMULATION_MGCP import from MGCP_Types all; #endif @@ -112,6 +116,7 @@ template IpaStreamId t_IpaSidRSL := ( IPAC_PROTO_RSL_TRX0, IPAC_PROTO_RSL_TRX1, IPAC_PROTO_RSL_TRX2, IPAC_PROTO_RSL_TRX3 ); #endif + /* Client port for general IPA messages, not further decoded */ type port IPA_SP_PT message { inout ASP_IPA_Unitdata, ASP_IPA_Event; @@ -131,6 +136,13 @@ type port IPA_RSL_PT message { } with { extension "internal" } #endif +#ifdef IPA_EMULATION_OML +/* Client port for A-bis OML inside IPA */ +type port IPA_OML_PT message { + inout OML_PDU, octetstring, ASP_IPA_Event; +} with { extension "internal" } +#endif + /* Client port for CTRL inside IPA */ type port IPA_CTRL_PT message { inout CtrlMessage, ASP_IPA_Event; @@ -167,6 +179,10 @@ type component IPA_Emulation_CT { /* up-facing port for RSL */ port IPA_RSL_PT IPA_RSL_PORT; #endif +#ifdef IPA_EMULATION_OML + /* up-facing port for OML */ + port IPA_OML_PT IPA_OML_PORT; +#endif /* up-facing port for CTRL */ port IPA_CTRL_PT IPA_CTRL_PORT; #ifdef IPA_EMULATION_GSUP @@ -276,6 +292,11 @@ private function f_send_IPA_EVT(template ASP_IPA_Event evt) runs on IPA_Emulatio IPA_RSL_PORT.send(evt); } #endif +#ifdef IPA_EMULATION_OML + if (IPA_OML_PORT.checkstate("Connected")) { + IPA_OML_PORT.send(evt); + } +#endif if (IPA_CTRL_PORT.checkstate("Connected")) { IPA_CTRL_PORT.send(evt); } @@ -437,6 +458,14 @@ private function f_from_rsl(IPL4asp_Types.ConnectionId connId, ASP_RSL_Unitdata } #endif +#ifdef IPA_EMULATION_OML +private function f_from_oml(IPL4asp_Types.ConnectionId connId, OML_PDU oml_tx) return IPA_Send { + var octetstring payload := enc_OML_PDU(oml_tx); + var IPA_Send ret := valueof(t_IPA_Send(connId, IPAC_PROTO_OML, payload)); + return ret; +} +#endif + /* main function to use for a client-side IPA implementation */ function main_client(charstring remote_host, IPL4asp_Types.PortNumber remote_port, charstring local_host, IPL4asp_Types.PortNumber local_port, @@ -527,6 +556,9 @@ private function ScanEvents() runs on IPA_Emulation_CT { #ifdef IPA_EMULATION_RSL var ASP_RSL_Unitdata rsl; #endif +#ifdef IPA_EMULATION_OML + var OML_PDU oml; +#endif #ifdef IPA_EMULATION_RSPRO var RsproPDU rspro; #endif @@ -577,6 +609,12 @@ private function ScanEvents() runs on IPA_Emulation_CT { IPA_RSL_PORT.send(rsl); } #endif +#ifdef IPA_EMULATION_OML + case (IPAC_PROTO_OML) { + oml := dec_OML_PDU(ipa_rx.msg) + IPA_OML_PORT.send(oml); + } +#endif case (IPAC_PROTO_OSMO) { select (ipa_rx.streamIdExt) { #ifdef IPA_EMULATION_MGCP @@ -691,7 +729,15 @@ private function ScanEvents() runs on IPA_Emulation_CT { IPA_PORT.send(f_from_rsl(g_ipa_conn_id, rsl)); } #endif - +#ifdef IPA_EMULATION_OML + /* Received OML -> down into IPA */ + [] IPA_OML_PORT.receive(OML_PDU:?) -> value oml { + IPA_PORT.send(f_from_oml(g_ipa_conn_id, oml)); + } + [] IPA_OML_PORT.receive(octetstring:?) -> value payload { + IPA_PORT.send(t_IPA_Send(g_ipa_conn_id, IPAC_PROTO_OML, payload)); + } +#endif /* Received MISC (OML/CTRL) -> down into IPA */ [] IPA_SP_PORT.receive(ASP_IPA_Unitdata: ?) -> value ipa_ud { IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud)); |