lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

July 2024

  • 1 participants
  • 1379 discussions
[S] Change in osmo-ttcn3-hacks[master]: sgsn: Rename vc_GTP -> vc_GGSN_GTP
by pespin 26 Jul '24

26 Jul '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37590?usp=email ) Change subject: sgsn: Rename vc_GTP -> vc_GGSN_GTP ...................................................................... sgsn: Rename vc_GTP -> vc_GGSN_GTP GTPv1U will also be used by emulated HNBGWs, hence we want to differentiate them in name. Change-Id: I663e667956935372809c1c42ebe8d4312d6a4d41 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 21 insertions(+), 9 deletions(-) Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 01aab2b..9b9831a 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -183,7 +183,7 @@ port BSSGP_PT RIM[NUM_GB]; port GTPEM_PT GTPC; - var GTP_Emulation_CT vc_GTP; + var GTP_Emulation_CT vc_GGSN_GTP; port TELNETasp_PT SGSNVTY; @@ -267,8 +267,8 @@ } } -private function f_init_gtp(charstring id) runs on test_CT { - id := id & "-GTP"; +private function f_init_ggsn_gtp(charstring id) runs on test_CT { + id := id & "-GGSN_GTP"; var GtpEmulationCfg gtp_cfg := { gtpc_bind_ip := mp_ggsn_ip, @@ -278,8 +278,8 @@ sgsn_role := false }; - vc_GTP := GTP_Emulation_CT.create(id); - vc_GTP.start(GTP_Emulation.main(gtp_cfg)); + vc_GGSN_GTP := GTP_Emulation_CT.create(id); + vc_GGSN_GTP.start(GTP_Emulation.main(gtp_cfg)); } friend function f_init_vty() runs on test_CT { @@ -383,7 +383,7 @@ } } f_init_gsup("SGSN_Test"); - f_init_gtp("SGSN_Test"); + f_init_ggsn_gtp("SGSN_Test"); f_vty_enable_echo_interval(g_use_echo); } @@ -469,8 +469,8 @@ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); - connect(vc_conn:GTP, vc_GTP:CLIENT); - connect(vc_conn:GTP_PROC, vc_GTP:CLIENT_PROC); + connect(vc_conn:GTP, vc_GGSN_GTP:CLIENT); + connect(vc_conn:GTP_PROC, vc_GGSN_GTP:CLIENT_PROC); vc_conn.start(f_handler_init(fn, id, pars)); return vc_conn; @@ -2655,7 +2655,7 @@ var BSSGP_ConnHdlr vc_conn; f_init(); /* connect RIM related port */ - connect(vc_GTP:CLIENT_DEFAULT, self:GTPC); + connect(vc_GGSN_GTP:CLIENT_DEFAULT, self:GTPC); var Gtp1cPeer peer := { connId := 1, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37590?usp=email 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: I663e667956935372809c1c42ebe8d4312d6a4d41 Gerrit-Change-Number: 37590 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: library/GTP_Emulation: Make GTPv1C port optional
by pespin 26 Jul '24

26 Jul '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37589?usp=email ) Change subject: library/GTP_Emulation: Make GTPv1C port optional ...................................................................... library/GTP_Emulation: Make GTPv1C port optional The port is not needed when emulating HNBGW, since the setup of GTPv1U happens through RAB-ASsReq/resp. Change-Id: I3ffb54d0cb8b3a81ed5235feaaac6d989baf6e0d --- M library/GTP_Emulation.ttcn 1 file changed, 20 insertions(+), 6 deletions(-) Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index afe4217..aa620ed 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -30,8 +30,8 @@ const integer GTP1U_PORT := 2152; type record GtpEmulationCfg { - HostName gtpc_bind_ip, - PortNumber gtpc_bind_port, + HostName gtpc_bind_ip optional, + PortNumber gtpc_bind_port optional, HostName gtpu_bind_ip optional, PortNumber gtpu_bind_port optional, boolean sgsn_role @@ -213,10 +213,12 @@ private function f_init(GtpEmulationCfg cfg) runs on GTP_Emulation_CT { var Result res; - map(self:GTPC, system:GTPC); - res := GTPv1C_CodecPort_CtrlFunct.f_IPL4_listen(GTPC, cfg.gtpc_bind_ip, - cfg.gtpc_bind_port, {udp:={}}); - g_gtpc_id := res.connId; + if (isvalue(cfg.gtpc_bind_ip) and isvalue(cfg.gtpc_bind_port)) { + map(self:GTPC, system:GTPC); + res := GTPv1C_CodecPort_CtrlFunct.f_IPL4_listen(GTPC, cfg.gtpc_bind_ip, + cfg.gtpc_bind_port, {udp:={}}); + g_gtpc_id := res.connId; + } if (isvalue(cfg.gtpu_bind_ip) and isvalue(cfg.gtpu_bind_port)) { map(self:GTPU, system:GTPU); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37589?usp=email 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: I3ffb54d0cb8b3a81ed5235feaaac6d989baf6e0d Gerrit-Change-Number: 37589 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: GTP_ConnHdlr: Allow connection to multiple GTP_Emulation
by pespin 26 Jul '24

26 Jul '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37591?usp=email ) Change subject: GTP_ConnHdlr: Allow connection to multiple GTP_Emulation ...................................................................... GTP_ConnHdlr: Allow connection to multiple GTP_Emulation This feature will be used by SGSN_Tests' BSSGP_ConnHdlr, which in 3G scenario needs to connect to GTP at both GGSN and HNBGW/RNC endpoints. Change-Id: I6fc49428967ebcf0f6c8a9f9f20f4a98a81f3273 --- M hnodeb/HNBGW_ConnectionHandler.ttcn M hnodeb/HNB_Tests.ttcn M library/GTP_Emulation.ttcn M mme/MME_Tests.ttcn M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests.ttcn 6 files changed, 93 insertions(+), 75 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/hnodeb/HNBGW_ConnectionHandler.ttcn b/hnodeb/HNBGW_ConnectionHandler.ttcn index e256963..a72b5f2 100644 --- a/hnodeb/HNBGW_ConnectionHandler.ttcn +++ b/hnodeb/HNBGW_ConnectionHandler.ttcn @@ -93,8 +93,8 @@ }; vc_GTP := GTP_Emulation_CT.create(id) alive; - connect(self:GTP, vc_GTP:CLIENT); - connect(self:GTP_PROC, vc_GTP:CLIENT_PROC); + connect(self:GTP[0], vc_GTP:CLIENT); + connect(self:GTP_PROC[0], vc_GTP:CLIENT_PROC); vc_GTP.start(GTP_Emulation.main(gtp_cfg)); } @@ -200,7 +200,7 @@ function f_gtpu_send(uint32_t tei, octetstring payload) runs on HNBGW_ConnHdlr { var Gtp1uPeer peer := valueof(ts_GtpPeerU(g_pars.hnodeb_addr)); - GTP.send(ts_GTP1U_GPDU(peer, 0 /*seq*/, int2oct(tei, 4), payload)); + GTP[0].send(ts_GTP1U_GPDU(peer, 0 /*seq*/, int2oct(tei, 4), payload)); } /* HNBLLIF socket may at any time receive a new INFO.ind */ diff --git a/hnodeb/HNB_Tests.ttcn b/hnodeb/HNB_Tests.ttcn index 29f0bbb..ca36ad7 100644 --- a/hnodeb/HNB_Tests.ttcn +++ b/hnodeb/HNB_Tests.ttcn @@ -437,7 +437,7 @@ /* Forward GTP data in both directions */ LLSK.send(f_llsk_tx(ts_HNBLLIF_GTP_CONN_DATA_REQ(gtp_conn_id, gtp_payload))); - GTP.receive(tr_GTPU_GPDU(ts_GtpPeerU(g_pars.hnodeb_addr), int2oct(remote_tei, 4), gtp_payload)); + GTP[0].receive(tr_GTPU_GPDU(ts_GtpPeerU(g_pars.hnodeb_addr), int2oct(remote_tei, 4), gtp_payload)); f_gtpu_send(local_tei, gtp_payload); LLSK.receive(f_llsk_rx(tr_HNBLLIF_GTP_CONN_DATA_IND(gtp_conn_id, gtp_payload))); diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index aa620ed..c5ac029 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -316,21 +316,24 @@ /*********************************************************************** * Client Component ***********************************************************************/ +/* maximum number of GTP ports a GTP_ConnHdlr component can manage. This allows + * connection one GTP_ConnHdlr to several GTP_Emulation(s). */ +const integer NUM_MAX_GTP := 4; type component GTP_ConnHdlr { - port GTPEM_PT GTP; - port GTPEM_PROC_PT GTP_PROC; + port GTPEM_PT GTP[NUM_MAX_GTP]; + port GTPEM_PROC_PT GTP_PROC[NUM_MAX_GTP]; }; -function f_gtp_register_imsi(hexstring imsi) runs on GTP_ConnHdlr { - GTP_PROC.call(GTPEM_register_imsi:{imsi}) { - [] GTP_PROC.getreply(GTPEM_register_imsi:{imsi}); +function f_gtp_register_imsi(hexstring imsi, integer gtp_idx := 0) runs on GTP_ConnHdlr { + GTP_PROC[gtp_idx].call(GTPEM_register_imsi:{imsi}) { + [] GTP_PROC[gtp_idx].getreply(GTPEM_register_imsi:{imsi}); } } -function f_gtp_register_teid(OCT4 teid) runs on GTP_ConnHdlr { - GTP_PROC.call(GTPEM_register_teid:{teid}) { - [] GTP_PROC.getreply(GTPEM_register_teid:{teid}); +function f_gtp_register_teid(OCT4 teid, integer gtp_idx := 0) runs on GTP_ConnHdlr { + GTP_PROC[gtp_idx].call(GTPEM_register_teid:{teid}) { + [] GTP_PROC[gtp_idx].getreply(GTPEM_register_teid:{teid}); } } diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn index 76c9c7e..7a6b34c 100644 --- a/mme/MME_Tests.ttcn +++ b/mme/MME_Tests.ttcn @@ -426,8 +426,8 @@ connect(vc_conn:DIAMETER_PROC, vc_DIAMETER:DIAMETER_PROC); } if (isbound(vc_GTP)) { - connect(vc_conn:GTP, vc_GTP:CLIENT); - connect(vc_conn:GTP_PROC, vc_GTP:CLIENT_PROC); + connect(vc_conn:GTP[0], vc_GTP:CLIENT); + connect(vc_conn:GTP_PROC[0], vc_GTP:CLIENT_PROC); } if (isbound(vc_GTP2)) { connect(vc_conn:GTP2, vc_GTP2:CLIENT); @@ -937,18 +937,18 @@ SGSNContextReqPDU := ts_SGSNContextReqPDU(rai, new_sgsn_local_teid, f_inet_addr(mp_gn_local_ip), ptmsi := ts_PTMSI(ptmsi), ptmsi_sig := ts_PTMSI_sig(ptmsi_sig)); - GTP.send(ts_GTPC_SGSNContextReq(g_gn_iface_peer, gtpc_seq_nr, SGSNContextReqPDU)); + GTP[0].send(ts_GTPC_SGSNContextReq(g_gn_iface_peer, gtpc_seq_nr, SGSNContextReqPDU)); timer T := 5.0; T.start; alt { - [] GTP.receive(tr_GTPC_SGSNContextResp(g_gn_iface_peer, new_sgsn_local_teid, + [] GTP[0].receive(tr_GTPC_SGSNContextResp(g_gn_iface_peer, new_sgsn_local_teid, tr_SGSNContextRespPDU(GTP_CAUSE_REQUEST_ACCEPTED, g_pars.ue_pars.imsi))) -> value gtpc_pdu { old_mme_local_teid := gtpc_pdu.gtpc.gtpc_pdu.sgsn_ContextResponse.teidControlPlane.teidControlPlane; setverdict(pass); } - [] GTP.receive { + [] GTP[0].receive { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("unexpected GTPC message from MME")); } [] T.timeout { @@ -956,7 +956,7 @@ } } - GTP.send(ts_GTPC_SGSNContextAck(g_gn_iface_peer, old_mme_local_teid, + GTP[0].send(ts_GTPC_SGSNContextAck(g_gn_iface_peer, old_mme_local_teid, oct2int(gtpc_pdu.gtpc.opt_part.sequenceNumber), ts_SGSNContextAckPDU(GTP_CAUSE_REQUEST_ACCEPTED))); @@ -969,7 +969,7 @@ ) runs on ConnHdlr { var Gtp1cUnitdata gtpc_pdu; - [] GTP.receive(tr_GTPC_SGSNContextReq(g_gn_iface_peer, tr_SGSNContextReqPDU(rai := rai, ptmsi := ts_PTMSI(ptmsi), ptmsi_sig := ts_PTMSI_sig(ptmsi_sig), rat_type := int2oct(enum2int(rat_type), 1)))) -> value gtpc_pdu { + [] GTP[0].receive(tr_GTPC_SGSNContextReq(g_gn_iface_peer, tr_SGSNContextReqPDU(rai := rai, ptmsi := ts_PTMSI(ptmsi), ptmsi_sig := ts_PTMSI_sig(ptmsi_sig), rat_type := int2oct(enum2int(rat_type), 1)))) -> value gtpc_pdu { var template (value) PDP_Context_GTPC pdp_ctx; var template (value) GTPC_PDUs SGSNContextRespPDU; var Gtp1cUnitdata gtpc_pdu_ack; @@ -989,16 +989,16 @@ f_inet_addr(mp_gn_local_ip), ts_MM_ContextUMTS(ck, ik), { pdp_ctx }); - GTP.send(ts_GTPC_SGSNContextResp(g_gn_iface_peer, + GTP[0].send(ts_GTPC_SGSNContextResp(g_gn_iface_peer, old_mme_remote_teid, oct2int(gtpc_pdu.gtpc.opt_part.sequenceNumber), SGSNContextRespPDU)); - GTP.receive(tr_GTPC_SGSNContextAck(g_gn_iface_peer, new_sgsn_teid, + GTP[0].receive(tr_GTPC_SGSNContextAck(g_gn_iface_peer, new_sgsn_teid, tr_SGSNContextAckPDU(GTP_CAUSE_REQUEST_ACCEPTED))) -> value gtpc_pdu; setverdict(pass); } - [] GTP.receive { + [] GTP[0].receive { setverdict(fail, "unexpected GTPC message from MME"); } } @@ -1078,13 +1078,13 @@ f_init_handler(pars); f_gtp_register_teid('00000000'O); - GTP.send(ts_GTPC_PING(g_gn_iface_peer, 1)); + GTP[0].send(ts_GTPC_PING(g_gn_iface_peer, 1)); T.start; alt { - [] GTP.receive(tr_GTPC_PONG(?)) { + [] GTP[0].receive(tr_GTPC_PONG(?)) { setverdict(pass); } - [] GTP.receive { + [] GTP[0].receive { setverdict(fail, "unexpected GTPC message from MME"); } [] T.timeout { @@ -1301,10 +1301,10 @@ S1AP.send(f_make_ts_S1AP_eNBDirectInfTrans(geran_gtp_ci)); T.start; alt { - [] GTP.receive(f_make_tr_GTPC_MsgType(geran_gtp_ci)) -> value req_gtpc_pdu { + [] GTP[0].receive(f_make_tr_GTPC_MsgType(geran_gtp_ci)) -> value req_gtpc_pdu { setverdict(pass); } - [] GTP.receive { + [] GTP[0].receive { setverdict(fail, "unexpected GTPC message from MME"); } [] T.timeout { @@ -1316,7 +1316,7 @@ * (SGSN -> MME -> eNB) */ f_create_s1ap_expect_proc(id_MMEDirectInformationTransfer, self); resp_gtpc_pdu := valueof(f_make_ts_GTPC_RANInfoRelay(req_gtpc_pdu, geran_gtp_ci, geran_si)); - GTP.send(resp_gtpc_pdu); + GTP[0].send(resp_gtpc_pdu); T.start; alt { [] S1AP.receive(f_make_tr_S1AP_MMEDirectInfTrans(resp_gtpc_pdu)) { diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index eb1416d..5847ac0 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -49,6 +49,9 @@ const integer NUM_GB := 3; type record length(NUM_GB) of BssgpCellId BssgpCellIds; +/* Emulated GGSN is at GTP_ConnHdlr.GTP[0] */ +const integer GTP_GGSN_IDX := 0; + type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr, GTP_ConnHdlr, RAN_ConnHdlr { var BSSGP_ConnHdlrPars g_pars; timer g_Tguard; @@ -647,10 +650,10 @@ f_send_l3(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, apars.apn, apars.pco), ran_index); - GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud { f_process_gtp_ctx_act_req(apars, g_ud.gtpc); var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - GTP.send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, + GTP[GTP_GGSN_IDX].send(ts_GTPC_CreatePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, apars.gtp_resp_cause, apars.ggsn_tei_c, apars.ggsn_tei_u, apars.nsapi, @@ -686,10 +689,10 @@ var Gtp1cUnitdata g_ud; f_send_l3(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit), ran_index); - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); BSSGP[ran_index].clear; - GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); } alt { [] BSSGP[ran_index].receive(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid)) { @@ -707,10 +710,10 @@ BSSGP[ran_index].clear; if (error_ind) { var Gtp1uPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_c)); - GTP.send(ts_GTPU_ErrorIndication(peer, 0 /* seq */, apars.ggsn_tei_u, apars.ggsn_ip_u)); + GTP[GTP_GGSN_IDX].send(ts_GTPU_ErrorIndication(peer, 0 /* seq */, apars.ggsn_tei_u, apars.ggsn_ip_u)); } else { var Gtp1cPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); - GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); } timer T := 5.0; @@ -720,7 +723,7 @@ [] BSSGP[ran_index].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) { f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), ran_index); } - [not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { + [not error_ind] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { repeat; } [] T.timeout { @@ -818,7 +821,7 @@ function f_gtpu_send(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { var Gtp1uPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); - GTP.send(ts_GTP1U_GPDU(peer, 0 /*seq*/, apars.sgsn_tei_u, payload)); + GTP[GTP_GGSN_IDX].send(ts_GTP1U_GPDU(peer, 0 /*seq*/, apars.sgsn_tei_u, payload)); } altstep as_xid(PdpActPars apars, integer ran_index := 0) runs on BSSGP_ConnHdlr { @@ -893,7 +896,7 @@ BSSGP[ran_index].send(ts_LLC_UI(enc_PDU_SN(sndcp), apars.sapi, '0'B, n_u)); /* Expect PDU via GTP from SGSN on simulated GGSN */ alt { - [] GTP.receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload)); + [] GTP[GTP_GGSN_IDX].receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload)); } } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 9b9831a..8274d43 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -469,8 +469,8 @@ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); - connect(vc_conn:GTP, vc_GGSN_GTP:CLIENT); - connect(vc_conn:GTP_PROC, vc_GGSN_GTP:CLIENT_PROC); + connect(vc_conn:GTP[GTP_GGSN_IDX], vc_GGSN_GTP:CLIENT); + connect(vc_conn:GTP_PROC[GTP_GGSN_IDX], vc_GGSN_GTP:CLIENT_PROC); vc_conn.start(f_handler_init(fn, id, pars)); return vc_conn; @@ -1001,7 +1001,7 @@ [] BSSGP[0].receive(tr_GMM_DET_REQ_MT(?, ?)) { setverdict(pass); } - [] GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) { setverdict(fail, "Unexpected GTP PDP CTX ACT"); mtc.stop; } @@ -1119,10 +1119,10 @@ f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause_regular_deact, false, omit), 0); for (i := 0; i < 2; i := i+1) { - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); log("Received deletePDPContextResponse " & int2str(i) & ", seq_nr=" & int2str(seq_nr)); - GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); } } @@ -1186,10 +1186,10 @@ f_pdp_ctx_act(apars); /* Wait to receive first echo request and send initial Restart counter */ - GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { BSSGP[0].clear; seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); f_sleep(int2float(mp_echo_interval)); /* wait until around next echo is expected */ } @@ -1202,14 +1202,14 @@ f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); setverdict(pass); } - [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud { /* SGSN currently doesn't send this message because it expects GGSN to be non-reachable anyway */ seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); log("Received deletePDPContextRequest seq_nr=" & int2str(seq_nr)); - GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); repeat; } - [] GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); log("Received EchoRequest seq_nr=" & int2str(seq_nr)); repeat; @@ -1244,17 +1244,17 @@ /* Activate a pdp context against the GGSN */ f_pdp_ctx_act(apars); /* Wait to receive first echo request and send initial Restart counter */ - GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); } /* Wait to receive second echo request and send incremented Restart counter. This will fake a restarted GGSN, and pdp ctx allocated should be released by SGSN */ apars.ggsn_restart_ctr := int2oct(oct2int(apars.ggsn_restart_ctr) + 1, 1); - GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); - GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); } var OCT1 cause_network_failure := int2oct(38, 1) alt { @@ -1330,7 +1330,7 @@ BSSGP[0].clear; peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); - GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); for (i := 0; i < 5; i := i+1) { alt { @@ -1339,7 +1339,7 @@ } } - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {} + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {} f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); setverdict(pass); @@ -1364,16 +1364,16 @@ f_send_l3_gmm_llc(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, apars.apn, apars.pco), 0); - GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud_first {} + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud_first {} log("First createPDPContextRequest received, dropping & waiting for retransmission"); - GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud_second { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud_second { if (g_ud_first != g_ud_second) { setverdict(fail, "Retransmitted GTP message createPDPContextRequest is different from original one!"); mtc.stop; } f_process_gtp_ctx_act_req(apars, g_ud_second.gtpc); var integer seq_nr := oct2int(g_ud_second.gtpc.opt_part.sequenceNumber); - GTP.send(ts_GTPC_CreatePdpResp(g_ud_second.peer, seq_nr, + GTP[GTP_GGSN_IDX].send(ts_GTPC_CreatePdpResp(g_ud_second.peer, seq_nr, apars.sgsn_tei_c, apars.gtp_resp_cause, apars.ggsn_tei_c, apars.ggsn_tei_u, apars.nsapi, @@ -1384,16 +1384,16 @@ /* Now the same with Deact */ f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, '00'O, false, omit), 0); - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud_first {} + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud_first {} log("First deletePDPContextRequest received, dropping & waiting for retransmission"); - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud_second { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud_second { if (g_ud_first != g_ud_second) { setverdict(fail, "Retransmitted GTP message deletePDPContextRequest is different from original one!"); mtc.stop; } var integer seq_nr := oct2int(g_ud_second.gtpc.opt_part.sequenceNumber); BSSGP[0].clear; - GTP.send(ts_GTPC_DeletePdpResp(g_ud_second.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_DeletePdpResp(g_ud_second.peer, seq_nr, apars.sgsn_tei_c, '7F'O)); } alt { [] BSSGP[0].receive(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid)) { @@ -1426,14 +1426,14 @@ BSSGP[0].clear; var Gtp1cPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); g_delete_req := ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B); - GTP.send(g_delete_req); + GTP[GTP_GGSN_IDX].send(g_delete_req); alt { [] BSSGP[0].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) { f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), 0); } [] as_xid(apars, 0); } - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) -> value g_ud_first { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) -> value g_ud_first { if (g_ud_first.gtpc.gtpc_pdu.deletePDPContextResponse.cause.causevalue != '80'O) { setverdict(fail, "Received deletePDPContextResponse cause is not 'Request accepted'"); mtc.stop; @@ -1442,8 +1442,8 @@ /* Send duplicate DeleteCtxReq */ log("First deletePDPContextResponse received, dropping & retransmitting retransmission of deletePDPContextRequest"); - GTP.send(g_delete_req); - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) -> value g_ud_second { + GTP[GTP_GGSN_IDX].send(g_delete_req); + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) -> value g_ud_second { if (g_ud_first != g_ud_second) { setverdict(fail, "Retransmitted GTP message deletePDPContextResponse is different from original one!"); mtc.stop; @@ -1453,9 +1453,9 @@ /* Let's send now a new DeleteCtxReq (increased seq_nr) to make sure it * is handled differently by SGSN (expect "non-existent" cause) */ g_delete_req := ts_GTPC_DeletePDP(peer, seq_nr + 1, apars.sgsn_tei_c, apars.nsapi, '1'B); - GTP.send(g_delete_req); + GTP[GTP_GGSN_IDX].send(g_delete_req); /* Response with cause "non-existent" must be sent with TEID 0 according to specs */ - GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, '00000000'O)) -> value g_ud_second { + GTP[GTP_GGSN_IDX].receive(tr_GTPC_MsgType(?, deletePDPContextResponse, '00000000'O)) -> value g_ud_second { if (g_ud_second.gtpc.gtpc_pdu.deletePDPContextResponse.cause.causevalue != 'C0'O) { setverdict(fail, "Received deletePDPContextResponse cause is not 'Non-existent'"); mtc.stop; @@ -2843,7 +2843,7 @@ timer T := 2.0; T.start; alt { - [] GTP.receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload)) { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload)) { setverdict(fail, "Unexpected GTP message"); } [] T.timeout { setverdict(pass); } @@ -2916,7 +2916,7 @@ sgsn_addr_control := f_inet_addr(mp_ggsn_ip), ptmsi := ts_PTMSI(g_pars.p_tmsi), ptmsi_sig := ts_PTMSI_sig('010203'O)); - GTP.send(ts_GTPC_SGSNContextReq(peer, seq_nr, ctx_req)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_SGSNContextReq(peer, seq_nr, ctx_req)); /* The SGSN responds with subscriber's IMSI */ var template (present) GTPC_PDUs ctx_rsp; @@ -2941,13 +2941,13 @@ T.start(2.0); alt { - [] GTP.receive(tr_GTPC_SGSNContextResp(?, ?, ctx_rsp)) -> value gtpc_ud { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_SGSNContextResp(?, ?, ctx_rsp)) -> value gtpc_ud { log("Rx SGSN Context Resp from SGSN, sending Ack"); - GTP.send(ts_GTPC_SGSNContextAck(gtpc_ud.peer, '12345678'O, seq_nr)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_SGSNContextAck(gtpc_ud.peer, '12345678'O, seq_nr)); setverdict(pass); } - [] GTP.receive(tr_GTPC_SGSNContextResp) -> value gtpc_ud { - GTP.send(ts_GTPC_SGSNContextAck(gtpc_ud.peer, '12345678'O, seq_nr, + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_SGSNContextResp) -> value gtpc_ud { + GTP[GTP_GGSN_IDX].send(ts_GTPC_SGSNContextAck(gtpc_ud.peer, '12345678'O, seq_nr, ts_SGSNContextAckPDU(GTP_CAUSE_INVALID_MSG_FORMAT))); setverdict(fail, "Rx unexpected SGSN Context Resp"); } @@ -2985,12 +2985,12 @@ /* The SGSN has no idea about the MS and inquires the MME about it */ T.start(2.0); alt { - [] GTP.receive(tr_GTPC_SGSNContextReq(?, ?)) -> value gtpc_ud { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_SGSNContextReq(?, ?)) -> value gtpc_ud { log("Rx SGSN Context Req from SGSN"); setverdict(pass); T.stop; } - [] GTP.receive(tr_GTPC_SGSNContextResp) { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_SGSNContextResp) { setverdict(fail, "Rx unexpected SGSN Context Req"); mtc.stop; } @@ -3023,14 +3023,14 @@ teic := '12345678'O, mm_context := ts_MM_ContextGSM(kc), pdp_ctx_list := { pdp_ctx }); - GTP.send(ts_GTPC_SGSNContextResp(gtpc_ud.peer, '12345678'O, seq_nr, ctx_rsp)); + GTP[GTP_GGSN_IDX].send(ts_GTPC_SGSNContextResp(gtpc_ud.peer, '12345678'O, seq_nr, ctx_rsp)); /* TODO: Security Functions (auth/ciphering?) */ /* The SGSN ACKs */ T.start(2.0); alt { - [] GTP.receive(tr_GTPC_SGSNContextAck) -> value gtpc_ud { + [] GTP[GTP_GGSN_IDX].receive(tr_GTPC_SGSNContextAck) -> value gtpc_ud { log("Rx SGSN Context ACK from SGSN"); setverdict(pass); T.stop; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37591?usp=email 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: I6fc49428967ebcf0f6c8a9f9f20f4a98a81f3273 Gerrit-Change-Number: 37591 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Set up GTPv1U in emulated RNCs
by osmith 26 Jul '24

26 Jul '24
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37592?usp=email ) Change subject: sgsn: Set up GTPv1U in emulated RNCs ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37592?usp=email 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: Icf5fa28ea08cfd255b49b546eadd74e91a9c7ecf Gerrit-Change-Number: 37592 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 26 Jul 2024 10:35:24 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: GTP_ConnHdlr: Allow connection to multiple GTP_Emulation
by osmith 26 Jul '24

26 Jul '24
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37591?usp=email ) Change subject: GTP_ConnHdlr: Allow connection to multiple GTP_Emulation ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37591?usp=email 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: I6fc49428967ebcf0f6c8a9f9f20f4a98a81f3273 Gerrit-Change-Number: 37591 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 26 Jul 2024 10:28:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: sgsn: Rename vc_GTP -> vc_GGSN_GTP
by osmith 26 Jul '24

26 Jul '24
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37590?usp=email ) Change subject: sgsn: Rename vc_GTP -> vc_GGSN_GTP ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37590?usp=email 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: I663e667956935372809c1c42ebe8d4312d6a4d41 Gerrit-Change-Number: 37590 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 26 Jul 2024 10:26:13 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: library/GTP_Emulation: Make GTPv1C port optional
by osmith 26 Jul '24

26 Jul '24
Attention is currently required from: daniel, laforge, pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37589?usp=email ) Change subject: library/GTP_Emulation: Make GTPv1C port optional ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37589?usp=email 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: I3ffb54d0cb8b3a81ed5235feaaac6d989baf6e0d Gerrit-Change-Number: 37589 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Fri, 26 Jul 2024 10:24:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pySim.tlv: Add convenience methods to IE class
by laforge 26 Jul '24

26 Jul '24
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/37620?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: pySim.tlv: Add convenience methods to IE class ...................................................................... pySim.tlv: Add convenience methods to IE class The new methods allow programmatic resolution of nested IEs from a parent, assuming there's only one child of a given type (which is often but not always the case). Change-Id: Ic95b74437647ae8d4bf3cdc481832afb622e3cf0 --- M pySim/tlv.py 1 file changed, 32 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/20/37620/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37620?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ic95b74437647ae8d4bf3cdc481832afb622e3cf0 Gerrit-Change-Number: 37620 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in pysim[master]: pySim.global_platform.ota: Support KVN 0x70 for SCP02
by laforge 26 Jul '24

26 Jul '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37542?usp=email ) Change subject: pySim.global_platform.ota: Support KVN 0x70 for SCP02 ...................................................................... pySim.global_platform.ota: Support KVN 0x70 for SCP02 This is a non-standard extension of sysmocom products. Change-Id: I00d52f7629aae190ee487ea3453f42b5f94cf42f --- M pySim/global_platform/scp.py 1 file changed, 19 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/pySim/global_platform/scp.py b/pySim/global_platform/scp.py index 967a582..f68bcf9 100644 --- a/pySim/global_platform/scp.py +++ b/pySim/global_platform/scp.py @@ -115,6 +115,12 @@ if not card_keys.kvn in range(self.kvn_range[0], self.kvn_range[1]+1): raise ValueError('%s cannot be used with KVN outside range 0x%02x..0x%02x' % (self.__class__.__name__, self.kvn_range[0], self.kvn_range[1])) + elif hasattr(self, 'kvn_ranges'): + # pylint: disable=no-member + if all([not card_keys.kvn in range(x[0], x[1]+1) for x in self.kvn_ranges]): + raise ValueError('%s cannot be used with KVN outside permitted ranges %s' % + (self.__class__.__name__, self.kvn_ranges)) + self.lchan_nr = lchan_nr self.card_keys = card_keys self.sk = None @@ -216,7 +222,8 @@ constr_iur = Struct('key_div_data'/Bytes(10), 'key_ver'/Int8ub, Const(b'\x02'), 'seq_counter'/Int16ub, 'card_challenge'/Bytes(6), 'card_cryptogram'/Bytes(8)) - kvn_range = [0x20, 0x2f] + # The 0x70 is a non-spec special-case of sysmoISIM-SJA2/SJA5 and possibly more sysmocom products + kvn_ranges = [[0x20, 0x2f], [0x70, 0x70]] def __init__(self, *args, **kwargs): self.overhead = 8 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37542?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I00d52f7629aae190ee487ea3453f42b5f94cf42f Gerrit-Change-Number: 37542 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[M] Change in pysim[master]: pySim.apdu.global_platform: Decode the INSTALL command parameters
by laforge 26 Jul '24

26 Jul '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37537?usp=email ) Change subject: pySim.apdu.global_platform: Decode the INSTALL command parameters ...................................................................... pySim.apdu.global_platform: Decode the INSTALL command parameters Change-Id: I1c323c1cb1be504c6ad5b7efb0fa85d87eaa8cf7 --- M pySim/apdu/global_platform.py M pySim/global_platform/__init__.py 2 files changed, 109 insertions(+), 1 deletion(-) Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/apdu/global_platform.py b/pySim/apdu/global_platform.py index bdba24e..894d864 100644 --- a/pySim/apdu/global_platform.py +++ b/pySim/apdu/global_platform.py @@ -1,7 +1,7 @@ # coding=utf-8 """APDU definition/decoder of GlobalPLatform Card Spec (currently 2.1.1) -(C) 2022 by Harald Welte <laforge(a)osmocom.org> +(C) 2022-2024 by Harald Welte <laforge(a)osmocom.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ +from construct import FlagsEnum, Struct +from pySim.tlv import flatten_dict_lists from pySim.apdu import ApduCommand, ApduCommandSet +from pySim.construct import * +from pySim.global_platform import InstallParameters class GpDelete(ApduCommand, n='DELETE', ins=0xE4, cla=['8X', 'CX', 'EX']): _apdu_case = 4 @@ -40,8 +44,29 @@ class GpGetStatus(ApduCommand, n='GET STATUS', ins=0xF2, cla=['8X', 'CX', 'EX']): _apdu_case = 4 +# GPCS Section 11.5.2 class GpInstall(ApduCommand, n='INSTALL', ins=0xE6, cla=['8X', 'CX', 'EX']): _apdu_case = 4 + _construct_p1 = FlagsEnum(Byte, more_commands=0x80, for_registry_update=0x40, + for_personalization=0x20, for_extradition=0x10, + for_make_selectable=0x08, for_install=0x04, for_load=0x02) + _construct_p2 = Enum(Byte, no_info_provided=0x00, beginning_of_combined=0x01, + end_of_combined=0x03) + _construct = Struct('load_file_aid'/Prefixed(Int8ub, GreedyBytes), + 'module_aid'/Prefixed(Int8ub, GreedyBytes), + 'application_aid'/Prefixed(Int8ub, GreedyBytes), + 'privileges'/Prefixed(Int8ub, GreedyBytes), + 'install_parameters'/Prefixed(Int8ub, GreedyBytes), # TODO: InstallParameters + 'install_token'/Prefixed(Int8ub, GreedyBytes)) + def _decode_cmd(self): + # first use _construct* above + res = self._cmd_to_dict() + # then do TLV decode of install_parameters + ip = InstallParameters() + ip.from_tlv(res['body']['install_parameters']) + res['body']['install_parameters'] = flatten_dict_lists(ip.to_dict()) + return res + class GpLoad(ApduCommand, n='LOAD', ins=0xE8, cla=['8X', 'CX', 'EX']): _apdu_case = 4 diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index 0be316b..075a189 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -30,6 +30,80 @@ from pySim.filesystem import * from pySim.tlv import * from pySim.profile import CardProfile +from pySim.ota import SimFileAccessAndToolkitAppSpecParams + +# GPCS Table 11-48 Load Parameter Tags +class NonVolatileCodeMinMemoryReq(BER_TLV_IE, tag=0xC6): + _construct = GreedyInteger() + +# GPCS Table 11-48 Load Parameter Tags +class VolatileMinMemoryReq(BER_TLV_IE, tag=0xC7): + _construct = GreedyInteger() + +# GPCS Table 11-48 Load Parameter Tags +class NonVolatileDataMinMemoryReq(BER_TLV_IE, tag=0xC8): + _construct = GreedyInteger() + +# GPCS Table 11-49: Install Parameter Tags +class GlobalServiceParams(BER_TLV_IE, tag=0xCB): + pass + +# GPCS Table 11-49: Install Parameter Tags +class VolatileReservedMemory(BER_TLV_IE, tag=0xD7): + _construct = GreedyInteger() + +# GPCS Table 11-49: Install Parameter Tags +class NonVolatileReservedMemory(BER_TLV_IE, tag=0xD8): + _construct = GreedyInteger() + +# GPCS Table 11-49: Install Parameter Tags +class Ts102226SpecificParameter(BER_TLV_IE, tag=0xCA): + _construct = SimFileAccessAndToolkitAppSpecParams + +# GPCS Table 11-48 Load Parameter Tags +class LoadFileDataBlockFormatId(BER_TLV_IE, tag=0xCD): + pass + +# GPCS Table 11-50: Make Selectable Parameter Tags +class ImplicitSelectionParam(BER_TLV_IE, tag=0xCF): + pass + +# GPCS Table 11-48 Load Parameter Tags +class LoadFileDtaBlockParameters(BER_TLV_IE, tag=0xDD): + pass + +# GPCS Table 11-48 Load Parameter Tags / 11-49: Install Parameter Tags +class SystemSpecificParams(BER_TLV_IE, tag=0xEF, + nested=[NonVolatileCodeMinMemoryReq, + VolatileMinMemoryReq, + NonVolatileDataMinMemoryReq, + GlobalServiceParams, + VolatileReservedMemory, + NonVolatileReservedMemory, + Ts102226SpecificParameter, + LoadFileDataBlockFormatId, + ImplicitSelectionParam, + LoadFileDtaBlockParameters]): + pass + +# GPCS Table 11-49: Install Parameter Tags +class ApplicationSpecificParams(BER_TLV_IE, tag=0xC9): + _construct = GreedyBytes + +class Ts102226SpecificTemplate(BER_TLV_IE, tag=0xEA): + pass + +class CrtForDigitalSignature(BER_TLV_IE, tag=0xB6): + # FIXME: nested + pass + + +class InstallParameters(TLV_IE_Collection, nested=[ApplicationSpecificParams, + SystemSpecificParams, + Ts102226SpecificTemplate, + CrtForDigitalSignature]): + pass + sw_table = { 'Warnings': { -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37537?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I1c323c1cb1be504c6ad5b7efb0fa85d87eaa8cf7 Gerrit-Change-Number: 37537 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.