From 17e0f8c5a0c526cb63bddf413dd9020539067b51 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 3 Dec 2021 15:11:34 +0100 Subject: [PATCH] break GTP_Templates dependency on Osmo_Gb_Types, BSSGP_Types, NS_Types The resulting set of dependencies needed just to have one simple CellId struct is huge. That was fine for sgsn testsuite since anyway those were being used, but it's not acceptable for other testsuites (hnodeb) which only really require the GTP side. After this change, GTP_Templates only requires GSM_Types, which ends up in a much smaller subset of dependencies being pulled in. Change-Id: Icd8234908af445b798517fe110cd0648969179a4 --- library/GTP_Templates.ttcn | 40 ++++++++++++++++++++++++-------------- sgsn/SGSN_Tests.ttcn | 15 ++++++++++---- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 1bd56e129..9c8d1b64e 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -17,7 +17,17 @@ module GTP_Templates { import from GTPU_Types all; import from GTP_CodecPort all; import from IPCP_Types all; - import from Osmocom_Gb_Types all; // BssgpCellId + import from GSM_Types all; // RoutingAreaIdentification, CellIdentity + + type record GTP_CellId { + RoutingAreaIdentification ra_id, + CellIdentity cell_id + } with { encode "RAW" }; + + template (value) GTP_CellId ts_GTP_CellId(template (value) RoutingAreaIdentification rai, CellIdentity cell_id) := { + ra_id := rai, + cell_id := cell_id + }; /* Table 38 of 3GPP TS 29.060 */ type enumerated GTP_Cause { @@ -673,7 +683,7 @@ module GTP_Templates { }, rIMProtocolVersionNumber := int2oct(ver, 1) } - function tr_GTPC_Cell_Identifier_V(template BssgpCellId cid) return template Cell_Identifier_V_GTPC { + function tr_GTPC_Cell_Identifier_V(template GTP_CellId cid) return template Cell_Identifier_V_GTPC { var template Cell_Identifier_V_GTPC ret := { mccDigit1 := ?, mccDigit2 := ?, @@ -713,7 +723,7 @@ module GTP_Templates { } return ret; } - template (value) Cell_Identifier_V_GTPC ts_GTPC_Cell_Identifier_V(BssgpCellId cid) := { + template (value) Cell_Identifier_V_GTPC ts_GTPC_Cell_Identifier_V(GTP_CellId cid) := { mccDigit1 := cid.ra_id.lai.mcc_mnc[0], mccDigit2 := cid.ra_id.lai.mcc_mnc[1], mccDigit3 := cid.ra_id.lai.mcc_mnc[2], @@ -724,10 +734,10 @@ module GTP_Templates { rac := int2oct(cid.ra_id.rac, 1), cI_value := int2oct(cid.cell_id, 2) } - template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(BssgpCellId cid) := { + template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(GTP_CellId cid) := { cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) } - function tr_GTPC_ENB_Identifier(template BssgpCellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier { + function tr_GTPC_ENB_Identifier(template GTP_CellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier { var template ENB_Identifier ret := { mccDigit1 := ?, mccDigit2 := ?, @@ -764,7 +774,7 @@ module GTP_Templates { return ret; } - template (value) ENB_Identifier ts_GTPC_ENB_Identifier(BssgpCellId cid, integer tac, octetstring gnbid) := { + template (value) ENB_Identifier ts_GTPC_ENB_Identifier(GTP_CellId cid, integer tac, octetstring gnbid) := { mccDigit1 := cid.ra_id.lai.mcc_mnc[0], mccDigit2 := cid.ra_id.lai.mcc_mnc[1], mccDigit3 := cid.ra_id.lai.mcc_mnc[2], @@ -774,7 +784,7 @@ module GTP_Templates { tAC := int2oct(tac, 2), globalENB_ID := gnbid } - template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(BssgpCellId cid, integer tac, octetstring gnbid) := { + template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(GTP_CellId cid, integer tac, octetstring gnbid) := { eNB_Identifier := ts_GTPC_ENB_Identifier(cid, tac, gnbid) } template RIM_Routing_Information_GTPC @@ -801,7 +811,7 @@ module GTP_Templates { } /* 3GPP TS 48.018 11.3.63.1.1 */ template RAN_Information_Request_Application_Container_NACC_GTPC - tr_GTPC_RAN_Information_Request_Application_Container_NACC(template BssgpCellId cid) := { + tr_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := { iEI := '4D'O, ext := '1'B, lengthIndicator := { @@ -810,7 +820,7 @@ module GTP_Templates { reporting_Cell_Identifier := tr_GTPC_Cell_Identifier_V(cid) } template (value) RAN_Information_Request_Application_Container_NACC_GTPC - ts_GTPC_RAN_Information_Request_Application_Container_NACC(BssgpCellId cid) := { + ts_GTPC_RAN_Information_Request_Application_Container_NACC(GTP_CellId cid) := { iEI := '4D'O, ext := '1'B, lengthIndicator := { @@ -820,16 +830,16 @@ module GTP_Templates { } /* 3GPP TS 48.018 11.3.63.1 */ template RAN_Information_Request_Application_Container_GTPC - tru_GTPC_RAN_Information_Request_Application_Container_NACC(template BssgpCellId cid) := { + tru_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := { nacc := tr_GTPC_RAN_Information_Request_Application_Container_NACC(cid) } template (value) RAN_Information_Request_Application_Container_GTPC - tsu_GTPC_RAN_Information_Request_Application_Container_NACC(BssgpCellId cid) := { + tsu_GTPC_RAN_Information_Request_Application_Container_NACC(GTP_CellId cid) := { nacc := ts_GTPC_RAN_Information_Request_Application_Container_NACC(cid) } /* 3GPP TS 48.018 11.3.63.2.1 */ template RAN_Information_Application_Container_NACC_GTPC - tr_GTPC_RAN_Information_Application_Container_NACC(template BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + tr_GTPC_RAN_Information_Application_Container_NACC(template GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { iEI := '4E'O, ext := '1'B, lengthIndicator := { @@ -841,7 +851,7 @@ module GTP_Templates { sI_PSI := si_psi } template (value) RAN_Information_Application_Container_NACC_GTPC - ts_GTPC_RAN_Information_Application_Container_NACC(BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + ts_GTPC_RAN_Information_Application_Container_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { iEI := '4E'O, ext := '1'B, lengthIndicator := { @@ -892,11 +902,11 @@ module GTP_Templates { /* RAN_Information */ template ApplContainer_or_ApplErrContainer_NACC_GTPC - tru_GTPC_ApplContainer_NACC(BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + tru_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { application_Container := tr_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) } template (value) ApplContainer_or_ApplErrContainer_NACC_GTPC - tsu_GTPC_ApplContainer_NACC(BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + tsu_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { application_Container := ts_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) } template ApplContainer_or_ApplErrContainer_GTPC diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 246196246..3386f7122 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -250,6 +250,12 @@ private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdent return ret; }; +private function f_BssgpCellId_to_GTP_CellId(in BssgpCellId cell_id) return GTP_CellId +{ + template (value) GTP_CellId ret := ts_GTP_CellId(cell_id.ra_id, cell_id.cell_id); + return valueof(ret); +} + private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT { gb.vc_NS := NS_CT.create(id & "-NS" & int2str(offset)); gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP" & int2str(offset)); @@ -3373,20 +3379,21 @@ testcase TC_rim_eutran_to_geran() runs on test_CT { remName := mp_sgsn_gtp_ip, remPort := GTP1C_PORT } + var GTP_CellId gtp_ci := f_BssgpCellId_to_GTP_CellId(g_gb[1].cfg.bvc[0].cell_id); var template (value) RIM_Routing_Address_GTPC gtpc_dst_addr, gtpc_src_addr; var template (value) RAN_Information_Request_RIM_Container_GTPC gtpc_rim_req_cont; var template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC gtpc_bssgp_cont; var template (value) Gtp1cUnitdata gtpc_pdu; - gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(g_gb[1].cfg.bvc[0].cell_id); - gtpc_src_addr := t_GTPC_RIM_Routing_Address_enbid(g_gb[1].cfg.bvc[0].cell_id, tac := 3, gnbid := '12345678123456'O); + gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(gtp_ci); + gtpc_src_addr := t_GTPC_RIM_Routing_Address_enbid(gtp_ci, tac := 3, gnbid := '12345678123456'O); gtpc_rim_req_cont := ts_GTPC_RAN_Information_Request_RIM_Container(ts_GTPC_RIM_Application_Identity(RIM_APP_ID_NACC), ts_GTPC_RIM_Sequence_Number(1), ts_GTPC_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), ts_GTPC_RIM_Protocol_Version_Number(1), - tsu_GTPC_RAN_Information_Request_Application_Container_NACC(g_gb[1].cfg.bvc[0].cell_id), + tsu_GTPC_RAN_Information_Request_Application_Container_NACC(gtp_ci), omit); gtpc_bssgp_cont := ts_GTPC_RAN_Information_Request(ts_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr), ts_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr), @@ -3439,7 +3446,7 @@ testcase TC_rim_eutran_to_geran() runs on test_CT { ts_GTPC_RIM_Sequence_Number(2), ts_GTPC_RIM_PDU_Indications(false, RIM_PDU_TYPE_SING_REP), ts_GTPC_RIM_Protocol_Version_Number(1), - tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(tru_GTPC_ApplContainer_NACC(g_gb[1].cfg.bvc[0].cell_id, false, 3, si_default)), + tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(tru_GTPC_ApplContainer_NACC(gtp_ci, false, 3, si_default)), omit); gtpc_bssgp_cont_ack := tr_GTPC_RAN_Information(tr_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr), tr_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr),