Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/12876


Change subject: IPA_Emulation: Integrate OML decoding/encoding; add OML port
......................................................................

IPA_Emulation: Integrate OML decoding/encoding; add OML port

Change-Id: Id0dabe7eca4f81d22a60b346ac598be81533f53c
---
M library/IPA_Emulation.ttcnpp
1 file changed, 47 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/76/12876/1

diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 413d290..f556327 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -31,6 +31,10 @@
 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 @@
                                      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 @@
 } 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 @@
        /* 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 @@
                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 @@
 }
 #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 @@
 #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 @@
                                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 @@
                        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));

--
To view, visit https://gerrit.osmocom.org/12876
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0dabe7eca4f81d22a60b346ac598be81533f53c
Gerrit-Change-Number: 12876
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <[email protected]>

Reply via email to