Change in ...osmo-ttcn3-hacks[master]: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

2019-06-13 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406 )

Change subject: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN 
IPA conn
..

lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

This is the case for SCCPlite between BSC and MSC (or BSC-NAT). MGCP and
CTRL can be multiplexed over the same underlaying IPA conn.

Related: OS#2012
Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
---
M library/RAN_Adapter.ttcnpp
M library/RAN_Emulation.ttcnpp
2 files changed, 48 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp
index 862921e..40cf0fa 100644
--- a/library/RAN_Adapter.ttcnpp
+++ b/library/RAN_Adapter.ttcnpp
@@ -167,6 +167,11 @@
log("Connecting MGCP RAN Emulation to IPA MGCP PORT");
connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP);
 #endif
+#ifdef IPA_EMULATION_CTRL
+   /* connect IPA CTRL port with BSSMAP CTRL port */
+   log("Connecting CTRL RAN Emulation to IPA CTRL PORT");
+   connect(ba.vc_IPA:IPA_CTRL_PORT, ba.vc_RAN:CTRL);
+#endif
}
log("Starting RAN_Emulation");
ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), ""));
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp
index ba018b4..cd0c867 100644
--- a/library/RAN_Emulation.ttcnpp
+++ b/library/RAN_Emulation.ttcnpp
@@ -36,6 +36,7 @@
 import from SCCPasp_Types all;
 import from IPA_Emulation all;
 import from MobileL3_Types all;
+import from Misc_Helpers all;

 #ifdef RAN_EMULATION_BSSAP
 import from BSSAP_Types all;
@@ -48,6 +49,11 @@
 import from MGCP_Templates all;
 #endif

+#ifdef RAN_EMULATION_CTRL
+import from Osmocom_CTRL_Types all;
+import from Osmocom_CTRL_Adapter all;
+#endif
+
 #ifdef RAN_EMULATION_RANAP
 import from RANAP_CodecPort all;
 import from RANAP_PDU_Descriptions all;
@@ -177,6 +183,11 @@
/* MGCP port */
port IPA_MGCP_PT MGCP;
 #endif
+#ifdef RAN_EMULATION_CTRL
+   /* CTRL port */
+   port IPA_CTRL_PT CTRL;
+   port IPA_CTRL_PT CTRL_CLIENT;
+#endif

/* use 16 as this is also the number of SCCP connections that 
SCCP_Emulation can handle */
var ConnectionData ConnectionTable[16];
@@ -1041,6 +1052,37 @@
 #endif
 }

+private altstep as_main_ctrl() runs on RAN_Emulation_CT {
+#ifdef RAN_EMULATION_CTRL
+   var CtrlMessage ctrl;
+   var RAN_ConnHdlr vc_conn;
+   var ASP_IPA_Event evt;
+
+   /* Handling of CTRL in IPA SCCPLite case.  This predates 3GPP 
AoIP
+* and uses a CTRL session in parallel to BSSAP. */
+
+   /* CTRL_CLIENT -> CTRL */
+   [] CTRL_CLIENT.receive(CtrlMessage:?) -> value ctrl sender 
vc_conn {
+   CTRL.send(ctrl);
+   }
+
+   /*  CTRL -> CTRL_CLIENT */
+   [] CTRL.receive(CtrlMessage:?) -> value ctrl {
+   CTRL_CLIENT.send(ctrl);
+   }
+
+   [] CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) -> 
value evt {
+   CTRL_CLIENT.send(evt);
+   }
+   [] CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_DOWN}) {
+   Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
"Lost IPA connection!");
+   }
+   [] CTRL.receive(ASP_IPA_Event:{up_down := 
ASP_IPA_EVENT_ID_ACK}) {}
+#else
+   [false] CLIENT.receive {}
+#endif
+}
+
 /* send a raw (encoded) L3 message over given SCCP connection */
 private function f_xmit_raw_l3(integer sccp_conn_id, OCT1 dlci, octetstring 
l3_enc) runs on RAN_Emulation_CT
 {
@@ -1123,6 +1165,7 @@
}

[] as_main_mgcp();
+   [] as_main_ctrl();

[] PROC.getcall(RAN_register:{?,?}) -> param(l3_info, vc_hdlr) {
f_create_expect(l3_info, vc_hdlr);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
Gerrit-Change-Number: 14406
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in ...osmo-ttcn3-hacks[master]: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

2019-06-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406 )

Change subject: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN 
IPA conn
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
Gerrit-Change-Number: 14406
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Tue, 11 Jun 2019 14:21:35 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

2019-06-11 Thread pespin
Hello laforge, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406

to look at the new patch set (#3).

Change subject: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN 
IPA conn
..

lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

This is the case for SCCPlite between BSC and MSC (or BSC-NAT). MGCP and
CTRL can be multiplexed over the same underlaying IPA conn.

Related: OS#2012
Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
---
M library/RAN_Adapter.ttcnpp
M library/RAN_Emulation.ttcnpp
2 files changed, 48 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/06/14406/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
Gerrit-Change-Number: 14406
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in ...osmo-ttcn3-hacks[master]: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

2019-06-08 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406 )

Change subject: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN 
IPA conn
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
Gerrit-Change-Number: 14406
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 08 Jun 2019 09:53:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

2019-06-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406


Change subject: lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN 
IPA conn
..

lib/RAN: Introduce CTRL_CLIENT port to access CTRL muxed in RAN IPA conn

This is the case for SCCPlite between BSC and MSC (or BSC-NAT). MGCP and
CTRL can be multiplexed over the same underlaying IPA conn.

Related: OS#2012
Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
---
M library/RAN_Adapter.ttcnpp
M library/RAN_Emulation.ttcnpp
2 files changed, 38 insertions(+), 0 deletions(-)



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

diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp
index 862921e..40cf0fa 100644
--- a/library/RAN_Adapter.ttcnpp
+++ b/library/RAN_Adapter.ttcnpp
@@ -167,6 +167,11 @@
log("Connecting MGCP RAN Emulation to IPA MGCP PORT");
connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP);
 #endif
+#ifdef IPA_EMULATION_CTRL
+   /* connect IPA CTRL port with BSSMAP CTRL port */
+   log("Connecting CTRL RAN Emulation to IPA CTRL PORT");
+   connect(ba.vc_IPA:IPA_CTRL_PORT, ba.vc_RAN:CTRL);
+#endif
}
log("Starting RAN_Emulation");
ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), ""));
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp
index ba018b4..c580368 100644
--- a/library/RAN_Emulation.ttcnpp
+++ b/library/RAN_Emulation.ttcnpp
@@ -48,6 +48,11 @@
 import from MGCP_Templates all;
 #endif

+#ifdef RAN_EMULATION_CTRL
+import from Osmocom_CTRL_Types all;
+import from Osmocom_CTRL_Adapter all;
+#endif
+
 #ifdef RAN_EMULATION_RANAP
 import from RANAP_CodecPort all;
 import from RANAP_PDU_Descriptions all;
@@ -177,6 +182,11 @@
/* MGCP port */
port IPA_MGCP_PT MGCP;
 #endif
+#ifdef RAN_EMULATION_CTRL
+   /* CTRL port */
+   port IPA_CTRL_PT CTRL;
+   port IPA_CTRL_PT CTRL_CLIENT;
+#endif

/* use 16 as this is also the number of SCCP connections that 
SCCP_Emulation can handle */
var ConnectionData ConnectionTable[16];
@@ -1041,6 +1051,28 @@
 #endif
 }

+private altstep as_main_ctrl() runs on RAN_Emulation_CT {
+#ifdef RAN_EMULATION_CTRL
+   var CtrlMessage ctrl;
+   var RAN_ConnHdlr vc_conn;
+
+   /* Handling of CTRL in IPA SCCPLite case.  This predates 3GPP 
AoIP
+* and uses a CTRL session in parallel to BSSAP. */
+
+   /* CTRL_CLIENT -> CTRL */
+   [] CTRL_CLIENT.receive(CtrlMessage:?) -> value ctrl sender 
vc_conn {
+   CTRL.send(ctrl);
+   }
+
+   /*  CTRL -> CTRL_CLIENT */
+   [] CTRL.receive(CtrlMessage:?) -> value ctrl {
+   CTRL_CLIENT.send(ctrl);
+   }
+#else
+   [false] CLIENT.receive {}
+#endif
+}
+
 /* send a raw (encoded) L3 message over given SCCP connection */
 private function f_xmit_raw_l3(integer sccp_conn_id, OCT1 dlci, octetstring 
l3_enc) runs on RAN_Emulation_CT
 {
@@ -1123,6 +1155,7 @@
}

[] as_main_mgcp();
+   [] as_main_ctrl();

[] PROC.getcall(RAN_register:{?,?}) -> param(l3_info, vc_hdlr) {
f_create_expect(l3_info, vc_hdlr);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id90c1609f0439b00379166fb9e4028d181fc023e
Gerrit-Change-Number: 14406
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange