Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support

2019-04-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13653 )

Change subject: RAN_Emulation: Add RANAP support
..

RAN_Emulation: Add RANAP support

So far, RAN_Emulation only handled BSSAP and hence could be used
to emulate BSCs towards the MSC.  Let's extend it with RANAP support
so we can also emulate RNCs towards the MSC.

We try to share as much code and logic as possible betweeb the two.

Related: OS#2856, OS#2857
Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
---
M library/RAN_Adapter.ttcnpp
M library/RAN_Emulation.ttcnpp
2 files changed, 345 insertions(+), 10 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp
index ae7934e..53c8bac 100644
--- a/library/RAN_Adapter.ttcnpp
+++ b/library/RAN_Adapter.ttcnpp
@@ -45,7 +45,8 @@
 type enumerated RAN_Transport {
BSSAP_TRANSPORT_AoIP,   /* 3GPP AoIP: SCCP over M3UA over SCTP */
BSSAP_TRANSPORT_SCCPlite_SERVER, /* SCCPlite: SCCP over IPA over TCP */
-   BSSAP_TRANSPORT_SCCPlite_CLIENT  /* SCCPlite: SCCP over IPA over TCP */
+   BSSAP_TRANSPORT_SCCPlite_CLIENT, /* SCCPlite: SCCP over IPA over TCP */
+   RANAP_TRANSPORT_IuCS/* 3GPP IuCS: SCCP over M3UA over SCTP */
 };

 type record RAN_Configuration {
@@ -90,8 +91,7 @@
ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN");
}
select (cfg.transport) {
-#ifdef RAN_EMULATION_BSSAP
-   case (BSSAP_TRANSPORT_AoIP) {
+   case (BSSAP_TRANSPORT_AoIP, RANAP_TRANSPORT_IuCS) {
ba.vc_M3UA := M3UA_CT.create(id & "-M3UA");
map(ba.vc_M3UA:SCTP_PORT, system:sctp);
/* connect MTP3 service provider (M3UA) to lower side of SCCP */
@@ -133,7 +133,6 @@
disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT);
}
 #endif /* SCCP */
-#endif /* BSSAP */
case else {
setverdict(fail, "Unsuppored RAN_Transport");
mtc.stop;
@@ -145,10 +144,17 @@
T.start;
//T.timeout;
log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting 
emulation");
-#if RAN_EMULATION_BSSAP
/* connect BSSNAP component to upper side of SCCP */
-   connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT);
+   if (cfg.transport == RANAP_TRANSPORT_IuCS) {
+#ifdef RAN_EMULATION_RANAP
+   ops.protocol := RAN_PROTOCOL_RANAP
+   connect(ba.vc_RAN:RANAP, ba.vc_SCCP:SCCP_SP_PORT);
 #endif
+   } else {
+#ifdef RAN_EMULATION_BSSAP
+   connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT);
+#endif
+   }
if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or
cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) {
 #ifdef IPA_EMULATION_MGCP
@@ -156,7 +162,6 @@
connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP);
 #endif
}
-   /* start the BSSMAP emulation */
ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), ""));
}

diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp
index e091133..a74b6de 100644
--- a/library/RAN_Emulation.ttcnpp
+++ b/library/RAN_Emulation.ttcnpp
@@ -48,6 +48,14 @@
 import from MGCP_Templates all;
 #endif

+#ifdef RAN_EMULATION_RANAP
+import from RANAP_CodecPort all;
+import from RANAP_PDU_Descriptions all;
+import from RANAP_Constants all;
+import from RANAP_IEs all;
+import from RANAP_Templates all;
+#endif
+
 /* General "base class" component definition, of which specific implementations
  * derive themselves by means of the "extends" feature */
 type component RAN_ConnHdlr {
@@ -110,6 +118,11 @@
/* Client requests us to create SCCP Connection */
BSSAP_Conn_Req,
 #endif
+#ifdef RAN_EMULATION_RANAP
+   RANAP_PDU,
+   /* Client requests us to create SCCP Connection */
+   RANAP_Conn_Req,
+#endif
 #ifdef RAN_EMULATION_MGCP
/* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */
MgcpCommand, MgcpResponse,
@@ -147,6 +160,9 @@
 #ifdef RAN_EMULATION_BSSAP
port BSSAP_CODEC_PT BSSAP;
 #endif
+#ifdef RAN_EMULATION_RANAP
+   port RANAP_CODEC_PT RANAP;
+#endif
/* BSSAP port to the per-connection clients */
port RAN_Conn_PT CLIENT;
 #ifdef RAN_EMULATION_MGCP
@@ -487,10 +503,137 @@
 }
 #endif

+#ifdef RAN_EMULATION_RANAP
+type record RANAP_Conn_Req {
+   SCCP_PAR_Addressaddr_peer,
+   SCCP_PAR_Addressaddr_own,
+   RANAP_PDU   ranap
+}
+template (value) RANAP_Conn_Req ts_RANAP_Conn_Req(SCCP_PAR_Address peer, 
SCCP_PAR_Address own, RANAP_PDU ranap) := {
+   addr_peer := peer,
+   addr_own := own,
+   ranap 

Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support

2019-04-23 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13653 )

Change subject: RAN_Emulation: Add RANAP support
..


Patch Set 6: Code-Review+2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
Gerrit-Change-Number: 13653
Gerrit-PatchSet: 6
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 23 Apr 2019 15:54:50 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support

2019-04-23 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13653

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

Change subject: RAN_Emulation: Add RANAP support
..

RAN_Emulation: Add RANAP support

So far, RAN_Emulation only handled BSSAP and hence could be used
to emulate BSCs towards the MSC.  Let's extend it with RANAP support
so we can also emulate RNCs towards the MSC.

We try to share as much code and logic as possible betweeb the two.

Related: OS#2856, OS#2857
Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
---
M library/RAN_Adapter.ttcnpp
M library/RAN_Emulation.ttcnpp
2 files changed, 346 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/53/13653/5
--
To view, visit https://gerrit.osmocom.org/13653
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
Gerrit-Change-Number: 13653
Gerrit-PatchSet: 5
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support

2019-04-23 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13653

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

Change subject: RAN_Emulation: Add RANAP support
..

RAN_Emulation: Add RANAP support

So far, RAN_Emulation only handled BSSAP and hence could be used
to emulate BSCs towards the MSC.  Let's extend it with RANAP support
so we can also emulate RNCs towards the MSC.

We try to share as much code and logic as possible betweeb the two.

Related: OS#2856, OS#2857
Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
---
M library/RAN_Adapter.ttcnpp
M library/RAN_Emulation.ttcnpp
2 files changed, 345 insertions(+), 10 deletions(-)


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
Gerrit-Change-Number: 13653
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support

2019-04-22 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13653 )

Change subject: RAN_Emulation: Add RANAP support
..


Set Ready For Review


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
Gerrit-Change-Number: 13653
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 22 Apr 2019 13:07:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support

2019-04-15 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13653


Change subject: RAN_Emulation: Add RANAP support
..

RAN_Emulation: Add RANAP support

So far, RAN_Emulation only handled BSSAP and hence could be used
to emulate BSCs towards the MSC.  Let's extend it with RANAP support
so we can also emulate RNCs towards the MSC.

We try to share as much code and logic as possible betweeb the two.

Related: OS#2856, OS#2857
Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
---
M library/RAN_Adapter.ttcnpp
M library/RAN_Emulation.ttcnpp
M library/ranap/RANAP_Templates.ttcn
3 files changed, 418 insertions(+), 10 deletions(-)



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

diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp
index 43b4988..a97d148 100644
--- a/library/RAN_Adapter.ttcnpp
+++ b/library/RAN_Adapter.ttcnpp
@@ -43,7 +43,8 @@
 type enumerated RAN_Transport {
BSSAP_TRANSPORT_AoIP,   /* 3GPP AoIP: SCCP over M3UA over SCTP */
BSSAP_TRANSPORT_SCCPlite_SERVER, /* SCCPlite: SCCP over IPA over TCP */
-   BSSAP_TRANSPORT_SCCPlite_CLIENT  /* SCCPlite: SCCP over IPA over TCP */
+   BSSAP_TRANSPORT_SCCPlite_CLIENT, /* SCCPlite: SCCP over IPA over TCP */
+   RANAP_TRANSPORT_IuCS/* 3GPP IuCS: SCCP over M3UA over SCTP */
 };

 type record RAN_Configuration {
@@ -88,8 +89,7 @@
ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN");
}
select (cfg.transport) {
-#ifdef RAN_EMULATION_BSSAP
-   case (BSSAP_TRANSPORT_AoIP) {
+   case (BSSAP_TRANSPORT_AoIP, RANAP_TRANSPORT_IuCS) {
ba.vc_M3UA := M3UA_CT.create(id & "-M3UA");
map(ba.vc_M3UA:SCTP_PORT, system:sctp);
/* connect MTP3 service provider (M3UA) to lower side of SCCP */
@@ -129,7 +129,6 @@
ba.vc_WAIT.done;
disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT);
}
-#endif
case else {
setverdict(fail, "Unsuppored RAN_Transport");
mtc.stop;
@@ -141,16 +140,22 @@
T.start;
//T.timeout;
log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting 
emulation");
-#if RAN_EMULATION_BSSAP
/* connect BSSNAP component to upper side of SCCP */
-   connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT);
+   if (cfg.transport == RANAP_TRANSPORT_IuCS) {
+#ifdef RAN_EMULATION_RANAP
+   ops.protocol := RAN_PROTOCOL_RANAP
+   connect(ba.vc_RAN:RANAP, ba.vc_SCCP:SCCP_SP_PORT);
 #endif
+   } else {
+#ifdef RAN_EMULATION_BSSAP
+   connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT);
+#endif
+   }
if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or
cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) {
/* connect IPA MGCP port with BSSMAP MGCP port */
connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP);
}
-   /* start the BSSMAP emulation */
ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), ""));
}

diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp
index 21dbea9..b826982 100644
--- a/library/RAN_Emulation.ttcnpp
+++ b/library/RAN_Emulation.ttcnpp
@@ -48,6 +48,14 @@
 import from MGCP_Templates all;
 #endif

+#ifdef RAN_EMULATION_RANAP
+import from RANAP_CodecPort all;
+import from RANAP_PDU_Descriptions all;
+import from RANAP_Constants all;
+import from RANAP_IEs all;
+import from RANAP_Templates all;
+#endif
+
 /* General "base class" component definition, of which specific implementations
  * derive themselves by means of the "extends" feature */
 type component RAN_ConnHdlr {
@@ -110,6 +118,11 @@
/* Client requests us to create SCCP Connection */
BSSAP_Conn_Req,
 #endif
+#ifdef RAN_EMULATION_RANAP
+   RANAP_PDU,
+   /* Client requests us to create SCCP Connection */
+   RANAP_Conn_Req,
+#endif
 #ifdef RAN_EMULATION_MGCP
/* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */
MgcpCommand, MgcpResponse,
@@ -147,6 +160,9 @@
 #ifdef RAN_EMULATION_BSSAP
port BSSAP_CODEC_PT BSSAP;
 #endif
+#ifdef RAN_EMULATION_RANAP
+   port RANAP_CODEC_PT RANAP;
+#endif
/* BSSAP port to the per-connection clients */
port RAN_Conn_PT CLIENT;
 #ifdef RAN_EMULATION_MGCP
@@ -487,10 +503,137 @@
 }
 #endif

+#ifdef RAN_EMULATION_RANAP
+type record RANAP_Conn_Req {
+   SCCP_PAR_Addressaddr_peer,
+   SCCP_PAR_Addressaddr_own,
+   RANAP_PDU   ranap
+}
+template (value) RANAP_Conn_Req ts_RANAP_Conn_Req(SCCP_PAR_Address peer, 
SCCP_PAR_Address own, RANAP_PDU ranap) := {
+