Change in ...osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

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

Change subject: sgsn: Integrate RANAP
..

sgsn: Integrate RANAP

Integrate RANAP support to SGSN_Tests.ttcn.

Related: OS#2857
Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
---
M sgsn/SGSN_Tests.ttcn
M sgsn/gen_links.sh
M sgsn/regen_makefile.sh
3 files changed, 106 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index e349719..a7cc57f 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -19,6 +19,7 @@
 import from BSSGP_Types all;
 import from BSSGP_Emulation all;
 import from Osmocom_Gb_Types all;
+import from SCCPasp_Types all;

 import from MobileL3_CommonIE_Types all;
 import from MobileL3_GMM_SM_Types all;
@@ -30,6 +31,12 @@
 import from GSUP_Types all;
 import from IPA_Emulation all;

+import from RAN_Adapter all;
+import from RAN_Emulation all;
+import from RANAP_Templates all;
+import from RANAP_PDU_Descriptions all;
+import from RANAP_IEs all;
+
 import from GTP_Emulation all;
 import from GTP_Templates all;
 import from GTP_CodecPort all;
@@ -87,6 +94,20 @@
handle_sns := false
}
};
+
+   RAN_Configurations mp_ranap_cfg := {
+   {
+   transport := RANAP_TRANSPORT_IuCS,
+   sccp_service_type := "mtp3_itu",
+   sctp_addr := { 23908, "127.0.0.1", 2905, "127.0.0.1" },
+   own_pc := 195,
+   own_ssn := 142,
+   peer_pc := 188, /* 0.23.4 */
+   peer_ssn := 142,
+   sio := '83'O,
+   rctx := 2
+   }
+   }
 };

 type record GbInstance {
@@ -100,8 +121,12 @@
 type record length(NUM_GB) of NSConfiguration NSConfigurations;
 type record length(NUM_GB) of BssgpCellId BssgpCellIds;

+const integer NUM_RNC := 1;
+type record of RAN_Configuration RAN_Configurations;
+
 type component test_CT {
var GbInstances g_gb;
+   var RAN_Adapter g_ranap[NUM_RNC];

var GSUP_Emulation_CT vc_GSUP;
var IPA_Emulation_CT vc_GSUP_IPA;
@@ -116,7 +141,7 @@
var boolean g_use_echo := false;
 };
 
-type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr, 
GTP_ConnHdlr {
+type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr, 
GTP_ConnHdlr, RAN_ConnHdlr {
var BSSGP_ConnHdlrPars g_pars;
timer g_Tguard;
var LLC_Entities llc;
@@ -145,7 +170,10 @@
BssgpCellIds bssgp_cell_id,
AuthVector vec optional,
SGSN_ConnHdlrNetworkPars net,
-   float t_guard
+   float t_guard,
+   /* only in IuPS / RANAP case */
+   SCCP_PAR_Address sccp_addr_local,
+   SCCP_PAR_Address sccp_addr_peer
 };

 private function f_cellid_to_RAI(in BssgpCellId cell_id) return 
RoutingAreaIdentificationV {
@@ -240,6 +268,8 @@

 /* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */
 function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT {
+   var integer i;
+
if (g_initialized == true) {
return;
}
@@ -288,11 +318,44 @@
f_init_gb(g_gb[0], "SGSN_Test-Gb0", 0);
f_init_gb(g_gb[1], "SGSN_Test-Gb1", 1);
f_init_gb(g_gb[2], "SGSN_Test-Gb2", 2);
+
+   for (i := 0; i < NUM_RNC; i := i+1) {
+   f_ran_adapter_init(g_ranap[i], mp_ranap_cfg[i], "SGSN_Test_" & 
int2str(i), RNC_RanOps);
+   f_ran_adapter_start(g_ranap[i]);
+   }
f_init_gsup("SGSN_Test");
f_init_gtp("SGSN_Test");
f_vty_enable_echo_interval(g_use_echo);
 }

+private function RncUnitdataCallback(RANAP_PDU ranap)
+runs on RAN_Emulation_CT return template RANAP_PDU {
+   var template RANAP_PDU resp := omit;
+
+   log ("RANAP_RncUnitDataCallback");
+   /* answer all RESET with RESET ACK */
+   if (match(ranap, tr_RANAP_Reset)) {
+   log("RANAP_RncUnitdataCallback: Responding to RESET with 
RESET-ACK");
+   var CN_DomainIndicator dom;
+   dom := 
ranap.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator;
+   resp := ts_RANAP_ResetAck(dom);
+   }
+   return resp;
+}
+
+const RanOps RNC_RanOps := {
+   ranap_create_cb := refers(RAN_Emulation.RanapExpectedCreateCallback),
+   ranap_unitdata_cb := refers(RncUnitdataCallback),
+   ps_domain := true,
+   decode_dtap := true,
+   role_ms := true,
+   protocol := RAN_PROTOCOL_RANAP,
+   transport := RANAP_TRANSPORT_IuCS,
+   use_osmux := false,
+   sccp_addr_local := omit,
+   sccp_addr_peer := omit
+};
+
 type function void_fn(charstring id) runs on BSSGP_ConnHdlr;

 /* helper function 

Change in ...osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

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

Change subject: sgsn: Integrate RANAP
..


Patch Set 7: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/13754
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: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
Gerrit-Change-Number: 13754
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 13 Aug 2019 10:51:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

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

Change subject: sgsn: Integrate RANAP
..


Patch Set 7: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/13754/7/sgsn/SGSN_Tests.ttcn
File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/13754/7/sgsn/SGSN_Tests.ttcn@323
PS7, Line 323:  f_ran_adapter_init(g_ranap[i], mp_ranap_cfg[i], 
"SGSN_Test_" & int2str(i), RNC_RanOps);
Probably better name it "RAN_SGSN_Test_" ...



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/13754
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: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
Gerrit-Change-Number: 13754
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 12 Aug 2019 13:29:25 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

2019-08-12 Thread lynxis lazus
lynxis lazus has uploaded a new patch set (#7) to the change originally created 
by laforge. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/13754 )

Change subject: sgsn: Integrate RANAP
..

sgsn: Integrate RANAP

Integrate RANAP support to SGSN_Tests.ttcn.

Related: OS#2857
Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
---
M sgsn/SGSN_Tests.ttcn
M sgsn/gen_links.sh
M sgsn/regen_makefile.sh
3 files changed, 106 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/54/13754/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/13754
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: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
Gerrit-Change-Number: 13754
Gerrit-PatchSet: 7
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

2019-05-06 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13754 )

Change subject: sgsn: Integrate RANAP
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13754
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: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
Gerrit-Change-Number: 13754
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 06 May 2019 08:19:05 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

2019-05-02 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13754

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

Change subject: sgsn: Integrate RANAP
..

sgsn: Integrate RANAP

Integrate RANAP support to SGSN_Tests.ttcn.

Related: OS#2857
Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
---
M sgsn/SGSN_Tests.ttcn
M sgsn/gen_links.sh
M sgsn/regen_makefile.sh
3 files changed, 104 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/54/13754/4
--
To view, visit https://gerrit.osmocom.org/13754
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: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
Gerrit-Change-Number: 13754
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

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

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

https://gerrit.osmocom.org/13754

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

Change subject: sgsn: Integrate RANAP
..

sgsn: Integrate RANAP

Integrate RANAP support to SGSN_Tests.ttcn.

Related: OS#2857
Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
---
M library/ranap/RANAP_CodecPort.ttcn
M sgsn/SGSN_Tests.ttcn
M sgsn/gen_links.sh
M sgsn/regen_makefile.sh
4 files changed, 91 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/54/13754/2
--
To view, visit https://gerrit.osmocom.org/13754
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: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
Gerrit-Change-Number: 13754
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP

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


Change subject: sgsn: Integrate RANAP
..

sgsn: Integrate RANAP

Integrate RANAP support to SGSN_Tests.ttcn.

Related: OS#2857
Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22
---
M library/ranap/RANAP_CodecPort.ttcn
M sgsn/SGSN_Tests.ttcn
M sgsn/gen_links.sh
M sgsn/regen_makefile.sh
4 files changed, 91 insertions(+), 2 deletions(-)



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

diff --git a/library/ranap/RANAP_CodecPort.ttcn 
b/library/ranap/RANAP_CodecPort.ttcn
index d9cd40e..07e1b00 100644
--- a/library/ranap/RANAP_CodecPort.ttcn
+++ b/library/ranap/RANAP_CodecPort.ttcn
@@ -17,6 +17,7 @@
 import from SCCPasp_Types all;
 import from SCCP_Types all;

+import from RANAP_PDU_Descriptions all;
 import from RANAP_Types all;

 type record RANAP_N_CONNECT_req
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 74cdece..0dff040 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -19,6 +19,12 @@
 import from GSUP_Types all;
 import from IPA_Emulation all;

+import from RAN_Adapter all;
+import from RAN_Emulation all;
+import from RANAP_Templates all;
+import from RANAP_PDU_Descriptions all;
+import from RANAP_IEs all;
+
 import from GTP_Emulation all;
 import from GTP_Templates all;
 import from GTP_CodecPort all;
@@ -76,6 +82,19 @@
handle_sns := false
}
};
+
+   RAN_Configurations mp_ranap_cfg := {
+   {
+   sccp_service_type := "mtp3_itu",
+   sctp_addr := { 23908, "127.0.0.1", 2905, "127.0.0.1" },
+   own_pc := 195,
+   own_ssn := 142,
+   peer_pc := 185,
+   peer_ssn := 142,
+   sio := '83'O,
+   rctx := 2
+   }
+   }
 };

 type record GbInstance {
@@ -88,8 +107,12 @@
 type record length(3) of NSConfiguration NSConfigurations;
 type record length(3) of BssgpCellId BssgpCellIds;

+const integer NUM_RNC := 1;
+type record of RAN_Configuration RAN_Configurations;
+
 type component test_CT {
var GbInstances g_gb;
+   var RAN_Adapter g_ranap[NUM_RNC];

var GSUP_Emulation_CT vc_GSUP;
var IPA_Emulation_CT vc_GSUP_IPA;
@@ -228,6 +251,8 @@

 /* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */
 function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT {
+   var integer i;
+
if (g_initialized == true) {
return;
}
@@ -276,11 +301,42 @@
f_init_gb(g_gb[0], "SGSN_Test-Gb0", 0);
f_init_gb(g_gb[1], "SGSN_Test-Gb1", 1);
f_init_gb(g_gb[2], "SGSN_Test-Gb2", 2);
+
+   for (i := 0; i < NUM_RNC; i := i+1) {
+   f_ran_adapter_init(g_ranap[i], mp_ranap_cfg[i], "SGSN_Test_" & 
int2str(i), RNC_RanOps);
+   f_ran_adapter_start(g_ranap[i]);
+   }
f_init_gsup("SGSN_Test");
f_init_gtp("SGSN_Test");
f_vty_enable_echo_interval(g_use_echo);
 }

+private function RncUnitdataCallback(RANAP_PDU ranap)
+runs on RAN_Emulation_CT return template RANAP_PDU {
+   var template RANAP_PDU resp := omit;
+
+   log ("RANAP_RncUnitDataCallback");
+   /* answer all RESET with RESET ACK */
+   if (match(ranap, tr_RANAP_Reset)) {
+   log("RANAP_RncUnitdataCallback: Responding to RESET with 
RESET-ACK");
+   var CN_DomainIndicator dom;
+   dom := 
ranap.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator;
+   resp := ts_RANAP_ResetAck(dom);
+   }
+   return resp;
+}
+
+const RanOps RNC_RanOps := {
+   ranap_create_cb := refers(RAN_Emulation.RanapExpectedCreateCallback),
+   ranap_unitdata_cb := refers(RncUnitdataCallback),
+   ps_domain := true,
+   decode_dtap := true,
+   role_ms := true,
+   protocol := RAN_PROTOCOL_RANAP,
+   sccp_addr_local := omit,
+   sccp_addr_peer := omit
+};
+
 type function void_fn(charstring id) runs on BSSGP_ConnHdlr;

 /* helper function to create, connect and start a BSSGP_ConnHdlr component */
diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh
index fe09726..3552bc2 100755
--- a/sgsn/gen_links.sh
+++ b/sgsn/gen_links.sh
@@ -53,6 +53,35 @@
 FILES="GTPC_EncDec.cc  GTPC_Types.ttcn  GTPU_EncDec.cc  GTPU_Types.ttcn"
 gen_links $DIR $FILES

+# required by M3UA_Emulation
+DIR=$BASEDIR/titan.ProtocolModules.M3UA/src
+FILES="M3UA_Types.ttcn"
+gen_links $DIR $FILES
+
+# required by M3UA_Emulation
+DIR=$BASEDIR/titan.TestPorts.SCTPasp/src
+FILES="SCTPasp_PT.cc  SCTPasp_PT.hh  SCTPasp_PortType.ttcn  SCTPasp_Types.ttcn"
+gen_links $DIR $FILES
+
+# required by M3UA Emulation
+DIR=$BASEDIR/titan.TestPorts.MTP3asp/src
+FILES="MTP3asp_PortType.ttcn  MTP3asp_Types.ttcn"
+gen_links $DIR $FILES
+
+# required by SCCP Emulation