diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-10-10 12:28:27 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-10-10 20:42:44 +0000 |
commit | 7460a728fca547d763674ca15a9464f8fedbd533 (patch) | |
tree | 04a56b4b3a3b18dc5dab0bd97b4b11f503287b6c | |
parent | 18314435e929f0ed66d30586da2609500bc84560 (diff) |
IPA_Types/Emulation: Add RSPRO support
RSPRO is the protocol used by osmo-remsim. It is embedded into an IPA
multiplex, and hence the TTCN-3 IPA code needs some extension to cover
support for it.
Change-Id: I536d6843b3e65b3ee35fbbcd6353e0fb0ce21c8e
-rw-r--r-- | library/IPA_Emulation.ttcnpp | 48 | ||||
-rw-r--r-- | library/IPA_Types.ttcn | 3 |
2 files changed, 49 insertions, 2 deletions
diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp index 7a26a6b..413d290 100644 --- a/library/IPA_Emulation.ttcnpp +++ b/library/IPA_Emulation.ttcnpp @@ -8,7 +8,7 @@ module IPA_Emulation { * GSUP. IT hence transcodes messages so the user can work with abstract data types rather * than binary messages. It handles multiple packets inside one TCP segment. * - * (C) 2017 by Harald Welte <laforge@gnumonks.org> + * (C) 2017-2018 by Harald Welte <laforge@gnumonks.org> * All rights reserved. * * Released under the terms of GNU General Public License, Version 2 or @@ -39,6 +39,12 @@ import from MGCP_Types all; import from GSUP_Types all; #endif +#ifdef IPA_EMULATION_RSPRO +import from RSPRO all; +import from RSPRO_Types all; +#endif + + import from Osmocom_CTRL_Types all; modulepar { @@ -137,6 +143,14 @@ type port IPA_GSUP_PT message { } with { extension "internal" } #endif +#ifdef IPA_EMULATION_RSPRO +type port IPA_RSPRO_PT message { + inout RsproPDU, ASP_IPA_Event; +} with { extension "internal" } +#endif + + + type component IPA_Emulation_CT { /* down-facing port to IPA codec port */ @@ -159,6 +173,10 @@ type component IPA_Emulation_CT { /* up-facing port for GSUP */ port IPA_GSUP_PT IPA_GSUP_PORT; #endif +#ifdef IPA_EMULATION_RSPRO + /* up-facing port for RSPRO */ + port IPA_RSPRO_PT IPA_RSPRO_PORT; +#endif /* up-facing port for other streams */ port IPA_SP_PT IPA_SP_PORT; @@ -266,6 +284,11 @@ private function f_send_IPA_EVT(template ASP_IPA_Event evt) runs on IPA_Emulatio IPA_GSUP_PORT.send(evt); } #endif +#ifdef IPA_EMULATION_RSPRO + if (IPA_RSPRO_PORT.checkstate("Connected")) { + IPA_RSPRO_PORT.send(evt); + } +#endif /* FIXME: to other ports */ } @@ -455,6 +478,13 @@ private function f_gsup_to_user(octetstring msg) runs on IPA_Emulation_CT { } #endif +#ifdef IPA_EMULATION_RSPRO +private function f_rspro_to_user(octetstring msg) runs on IPA_Emulation_CT { + var RsproPDU rspro := dec_RsproPDU(msg); + IPA_RSPRO_PORT.send(rspro); +} +#endif + #ifdef IPA_EMULATION_MGCP private function f_mgcp_to_user(octetstring msg) runs on IPA_Emulation_CT { var charstring msg_ch := oct2char(msg); @@ -497,6 +527,9 @@ private function ScanEvents() runs on IPA_Emulation_CT { #ifdef IPA_EMULATION_RSL var ASP_RSL_Unitdata rsl; #endif +#ifdef IPA_EMULATION_RSPRO + var RsproPDU rspro; +#endif /* Set function for dissecting the binary */ var f_IPL4_getMsgLen vl_f := refers(f_IPL4_fixedMsgLen); @@ -559,6 +592,11 @@ private function ScanEvents() runs on IPA_Emulation_CT { f_gsup_to_user(ipa_rx.msg); } #endif +#ifdef IPA_EMULATION_RSPRO + case (IPAC_PROTO_EXT_RSPRO) { + f_rspro_to_user(ipa_rx.msg); + } +#endif case else { IPA_SP_PORT.send(f_to_asp(ipa_rx)); } @@ -639,6 +677,14 @@ private function ScanEvents() runs on IPA_Emulation_CT { } #endif +#ifdef IPA_EMULATION_RSPRO + [] IPA_RSPRO_PORT.receive(RsproPDU:?) -> value rspro { + payload := enc_RsproPDU(rspro); + ipa_ud := valueof(t_ASP_IPA_UD(IPAC_PROTO_OSMO, payload, IPAC_PROTO_EXT_RSPRO)); + IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud)); + } +#endif + #ifdef IPA_EMULATION_RSL /* Received RSL -> down into IPA */ [] IPA_RSL_PORT.receive(ASP_RSL_Unitdata:?) -> value rsl { diff --git a/library/IPA_Types.ttcn b/library/IPA_Types.ttcn index 3230329..1325b14 100644 --- a/library/IPA_Types.ttcn +++ b/library/IPA_Types.ttcn @@ -32,7 +32,8 @@ type enumerated IpaExtStreamId { IPAC_PROTO_EXT_SMSC ('03'H), IPAC_PROTO_EXT_ORC ('04'H), IPAC_PROTO_EXT_GSUP ('05'H), - IPAC_PROTO_EXT_OAP ('06'H) + IPAC_PROTO_EXT_OAP ('06'H), + IPAC_PROTO_EXT_RSPRO ('07'H) } with { variant "FIELDLENGTH(8)" } external function enc_PDU_IPA(in PDU_IPA pdu) return octetstring |