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

December 2025

  • 1 participants
  • 1175 discussions
[M] Change in osmo-ttcn3-hacks[master]: 5gc: Network Triggered Service Request
by pespin 23 Dec '25

23 Dec '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41756?usp=email ) Change subject: 5gc: Network Triggered Service Request ...................................................................... 5gc: Network Triggered Service Request Change-Id: I42e422d104f254bc27d5f3bb3e8df0cba6380648 --- M 5gc/C5G_Tests.ttcn M 5gc/ConnHdlr.ttcn M library/GTPv1U_Emulation.ttcnpp 3 files changed, 93 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/41756/1 diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn index 22c67e0..9e9d750 100644 --- a/5gc/C5G_Tests.ttcn +++ b/5gc/C5G_Tests.ttcn @@ -499,6 +499,46 @@ vc_conn.done; } +/* 3GPP TS 23.502 4.2.3.3 Network Triggered Service Request */ +private function f_TC_net_triggered_service_req() runs on ConnHdlr { + var PDU_SessionStatus pdu_session_status; + + f_register(); + f_pdu_sess_establish(); + f_sleep(1.0); + f_ue_context_release(); + f_sleep(1.0); + f_create_ngap_expect_proc(id_Paging, self); + + /* NOTE: In theory we should generate DL-originated traffic here, but since + * UPF let our UL traffic pass (bug?), make use of it to generate some DL + * traffic (ping reply) triggering the Paging: */ + var integer pid := f_ping4_async(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname, interval := 1, count := 1); + + NGAP.receive(mw_ngap_initMsg(mw_n2_Paging(?, ?))); + log("Rx Paging") + + /* We emulate UE in CM-IDLE: */ + pdu_session_status := f_PDU_SessionStatus(); + f_service_request_cm_idle(pdu_sess_status := pdu_session_status); + /* open5gs GH#771: open5gs-amfd sends InitialContextSetupRequest instead of PDUSessionResourceSetupRequest */ + as_ngap_handle_InitialCtxReq_withPDUSessionList(); + NGAP.receive(cr_NG_SERVICE_ACCEPT(p_PDU_SessionStatus := cr_PDU_SessionStatus('00000010'B, '00000000'B))); + as_ngap_handle_configuration_update(); + + f_gtp1u_wait_term(pid, 0, 1.0); + + f_deregister(); +} +testcase TC_net_triggered_service_req() runs on MTC_CT { + f_init(); + f_ngap_setup(0); + + var ConnHdlrPars pars := f_init_pars(ue_idx := 0); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_TC_net_triggered_service_req), pars); + vc_conn.done; +} control { execute( TC_ng_setup() ); @@ -520,13 +560,14 @@ execute( TC_ue_service_request_cm_idle_inact_sess() ); execute( TC_ue_service_request_cm_idle_unknown_sess_active() ); execute( TC_ue_service_request_cm_connected() ); + + execute( TC_net_triggered_service_req() ); } /* TODO: * - 3GPP TS 23.502 4.2.2.2.3 Registration with AMF re-allocation: Not supported by open5gs (https://github.com/open5gs/open5gs/issues/4214) * - 3GPP TS 23.502 4.2.2.2.4 Registration with Onboarding SNPN: Not supported by open5gs (https://github.com/open5gs/open5gs/issues/4215) * - 3GPP TS 23.502 4.2.2.3.3 Network-initiated Deregistration: Not supported by open5gs (https://github.com/open5gs/open5gs/issues/4216) - * - 3GPP TS 23.502 4.2.3.3 Network Triggered Service Request * - 3GPP TS 23.502 4.2.4.3 UE Configuration Update procedure for transparent UE Policy delivery * - 3GPP TS 23.502 4.2.5.2 UE Reachability Notification Request procedure * - 3GPP TS 23.502 4.2.5.3 UE Activity Notification procedure diff --git a/5gc/ConnHdlr.ttcn b/5gc/ConnHdlr.ttcn index 1e7ed5a..aa932bf 100644 --- a/5gc/ConnHdlr.ttcn +++ b/5gc/ConnHdlr.ttcn @@ -293,7 +293,7 @@ } } -private altstep as_ngap_handle_configuration_update() runs on ConnHdlr { +altstep as_ngap_handle_configuration_update() runs on ConnHdlr { var NG_NAS_DL_Message_Type rx_nas; [] NGAP.receive(cr_NG_CONFIGURATION_UPDATE_COMMAND) -> value rx_nas { @@ -359,20 +359,31 @@ } /* 3GPP TS 23.502 Figure 4.3.2.2.1-1 steps 12-14. */ -private altstep as_ngap_handle_InitialCtxReq_withPDUSessionList() runs on ConnHdlr { +altstep as_ngap_handle_InitialCtxReq_withPDUSessionList(template (present) AMF_UE_NGAP_ID amf_id := ?) runs on ConnHdlr { var NGAP_PDU rx_ngap; var template (present) NGAP_PDU exp_ngap := - mw_ngap_initMsg(f_mw_n2_InitialContextSetupRequest(g_pars.ue_pars.amf_id, - g_pars.ue_pars.ran_id, - p_uEAggregateMaximumBitRate := ?, - p_pDUSessionResourceSetupListCxtReq := ?, - p_nextHopNH := ?, - p_maskedIMEISV := ?)); + mw_ngap_initMsg((f_mw_n2_InitialContextSetupRequest(amf_id, + g_pars.ue_pars.ran_id, + p_uEAggregateMaximumBitRate := ?, + p_pDUSessionResourceSetupListCxtReq := ?, + p_nextHopNH := ?, + p_maskedIMEISV := ?), + f_mw_n2_InitialContextSetupRequest(amf_id, + g_pars.ue_pars.ran_id, + p_uEAggregateMaximumBitRate := ?, + p_pDUSessionResourceSetupListCxtReq := ?, + p_nextHopNH := ?, + p_maskedIMEISV := ?, + p_nAS_PDU := ?) + )); [] NGAP.receive(exp_ngap) -> value rx_ngap { var InitialContextSetupRequest ctx_setup_req := rx_ngap.initiatingMessage.value_.initialContextSetupRequest; var PDUSessionResourceSetupListCxtRes resources; + /* Update amf_id: */ + g_pars.ue_pars.amf_id := ctx_setup_req.protocolIEs[0].value_.aMF_UE_NGAP_ID; + for (var integer i := 0; i < lengthof(ctx_setup_req.protocolIEs); i := i + 1) { if (ctx_setup_req.protocolIEs[i].id != id_PDUSessionResourceSetupListCxtReq) { continue; @@ -463,7 +474,7 @@ p_RequestType := cs_NG_Request_TypeTV('001'B), p_DNN := cs_DNN_TLV(f_enc_dns_hostname(g_pars.ue_pars.apn))); NGAP.send(nas_ul_msg); - as_ngap_handle_InitialCtxReq_withPDUSessionList(); + as_ngap_handle_InitialCtxReq_withPDUSessionList(g_pars.ue_pars.amf_id); /* PDU Session Establishment Accept: This DL NAS arrives contained in InitialCtxReq handled above: */ NGAP.receive(cr_NG_DL_NAS_TRANSPORT) -> value rx_nas; @@ -966,4 +977,15 @@ redirect_output_path_prefix := f_run_prog_unique_log_path()); } +function f_ping4_async(charstring host, integer interval := 1, integer count := 10) runs on ConnHdlr return integer +{ + /* command will be filled in by f_gtp1u_ping4() below: */ + var UECUPS_StartProgram sprog := f_run_prog_init(""); + var integer pid := f_gtp1u_ping4_async(sprog, host, + interval, count, g_pars.ue_pars.sess_pars.ue_ip, + redirect_output := true, + redirect_output_path_prefix := f_run_prog_unique_log_path()); + return pid; +} + } diff --git a/library/GTPv1U_Emulation.ttcnpp b/library/GTPv1U_Emulation.ttcnpp index aa97210..51fc5a1 100644 --- a/library/GTPv1U_Emulation.ttcnpp +++ b/library/GTPv1U_Emulation.ttcnpp @@ -454,6 +454,26 @@ f_gtp1u_wait_term(pid, exit_code, tout, port_idx); } +function f_gtp1u_ping4_async(UECUPS_StartProgram sprog, + charstring host, integer interval := 1, integer count := 10, + template (omit) charstring src_ip := omit, + boolean redirect_output := false, + charstring redirect_output_path_prefix := "gtp1u_run_prog", + integer port_idx := 0) runs on GTP1U_ConnHdlr return integer +{ + var charstring ping :="ping -c " & int2str(count) & " -i " & int2str(interval); + var integer pid; + + if (isvalue(src_ip)) { + ping := ping & " -I " & valueof(src_ip); + } + ping := ping & " " & host; + sprog.command := ping; + pid := f_gtp1u_start_prog(sprog, redirect_output, redirect_output_path_prefix, port_idx); + return pid; + +} + /* execute ping command and wait for result. sprog.command is filled in based on params. */ function f_gtp1u_ping4(UECUPS_StartProgram sprog, charstring host, integer interval := 1, integer count := 10, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41756?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I42e422d104f254bc27d5f3bb3e8df0cba6380648 Gerrit-Change-Number: 41756 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: library/NGAP_Emulation: Route Paging through NGAP_UNIT
by pespin 23 Dec '25

23 Dec '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41755?usp=email ) Change subject: library/NGAP_Emulation: Route Paging through NGAP_UNIT ...................................................................... library/NGAP_Emulation: Route Paging through NGAP_UNIT The Paging message has no amf_ue_id/ran_ue_id, hence it's a non-ue message. Route it over NGAP_UNIT; ConnHdlr can then use the f_create_ngap_expect_proc() function to get a copy of it. Change-Id: I93cf5e5779208f5e8c3b4d4acf0341c0e78d1ee8 --- M library/NGAP_Emulation.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/55/41755/1 diff --git a/library/NGAP_Emulation.ttcn b/library/NGAP_Emulation.ttcn index 3034fab..d18d7a0 100644 --- a/library/NGAP_Emulation.ttcn +++ b/library/NGAP_Emulation.ttcn @@ -425,7 +425,7 @@ } template ProcedureCode tr_NGAP_ProcedureCode_non_UErelated := -(id_NGSetup, id_RANConfigurationUpdate, id_AMFStatusIndication, id_NGReset, id_ErrorIndication, id_OverloadStart, id_OverloadStop); +(id_NGSetup, id_RANConfigurationUpdate, id_AMFStatusIndication, id_NGReset, id_ErrorIndication, id_OverloadStart, id_OverloadStop, id_Paging); template (present) NGAP_PDU tr_NGAP_nonUErelated := (mw_ngap_initMsg({procedureCode := tr_NGAP_ProcedureCode_non_UErelated, criticality := ?, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41755?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I93cf5e5779208f5e8c3b4d4acf0341c0e78d1ee8 Gerrit-Change-Number: 41755 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: library/NGAP_Functions: return NAS_PDU IE from InitialContextSetup if...
by pespin 23 Dec '25

23 Dec '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41754?usp=email ) Change subject: library/NGAP_Functions: return NAS_PDU IE from InitialContextSetup if present ...................................................................... library/NGAP_Functions: return NAS_PDU IE from InitialContextSetup if present This is required to obtain the NAS PDU transmitted by open5gs-smfd during Network Triggered Service Request. In that message, the NAS_PDU inside the PDUSessionResourceSetupListCxtReq item is empty, and instead the global NAS_PDU is filled with a Service Accept. Change-Id: I7fced3f920c2514f58711a2ca1cc60c8dc79e395 --- M library/NGAP_Functions.ttcn 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/41754/1 diff --git a/library/NGAP_Functions.ttcn b/library/NGAP_Functions.ttcn index c096214..e1fcf6d 100644 --- a/library/NGAP_Functions.ttcn +++ b/library/NGAP_Functions.ttcn @@ -153,10 +153,17 @@ case (id_InitialContextSetup) { var InitialContextSetupRequest msg := im.value_.initialContextSetupRequest; for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) { + if (msg.protocolIEs[i].id == id_NAS_PDU) { + return msg.protocolIEs[i].value_.NAS_PDU; + } + } + for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) { if (msg.protocolIEs[i].id == id_PDUSessionResourceSetupListCxtReq) { var PDUSessionResourceSetupListCxtReq req_li := msg.protocolIEs[i].value_.pDUSessionResourceSetupListCxtReq; for (j := 0; j < lengthof(req_li); j := j+1) { - return req_li[j].nAS_PDU; + if (ispresent(req_li[j].nAS_PDU)) { + return req_li[j].nAS_PDU; + } /* FIXME: we should be returning req_li[j].pDUSessionResourceSetupRequestTransfer too... */ } } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41754?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I7fced3f920c2514f58711a2ca1cc60c8dc79e395 Gerrit-Change-Number: 41754 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: 5gc: Test UE Triggered Service Request
by pespin 23 Dec '25

23 Dec '25
pespin has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41747?usp=email ) Change subject: 5gc: Test UE Triggered Service Request ...................................................................... 5gc: Test UE Triggered Service Request Related: SYS#7073 Change-Id: I65cf7844d11be55d9d5c8e31fd87a3c72e6a607b --- M 5gc/C5G_Tests.ttcn M 5gc/ConnHdlr.ttcn M 5gc/expected-results.xml M library/NGAP_Functions.ttcn M library/NG_NAS_Osmo_Templates.ttcn M library/NG_NAS_Osmo_Types.ttcn 6 files changed, 348 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/41747/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41747?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I65cf7844d11be55d9d5c8e31fd87a3c72e6a607b Gerrit-Change-Number: 41747 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in pysim[master]: card_key_provider: add PostgreSQL support
by laforge 23 Dec '25

23 Dec '25
Attention is currently required from: daniel, dexter, fixeria. laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41508?usp=email ) Change subject: card_key_provider: add PostgreSQL support ...................................................................... Patch Set 10: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41508?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Icba625c02a60d7e1f519b506a46bda5ded0537d3 Gerrit-Change-Number: 41508 Gerrit-PatchSet: 10 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 23 Dec 2025 16:23:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in pysim[master]: ts_51_011: Improve testing of EF_SMSP
by laforge 23 Dec '25

23 Dec '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41677?usp=email ) Change subject: ts_51_011: Improve testing of EF_SMSP ...................................................................... ts_51_011: Improve testing of EF_SMSP * add another set of test data (from a real-world SIM card) * switch from test_decode to test_de_encode as our encoder now works due to previous commits. Change-Id: I8d16e195641bb59b2c26072008f88434692c0cab --- M pySim/ts_51_011.py 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved dexter: Looks good to me, approved diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 6e3f5e9..f87683f 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -239,8 +239,17 @@ # TS 51.011 Section 10.5.6 class EF_SMSP(LinFixedEF): - # FIXME: re-encode fails / missing alpha_id at start of output - _test_decode = [ + _test_de_encode = [ + ( '534d5343ffffffffffffffffffffffffe1ffffffffffffffffffffffff0891945197109099f9ffffff0000a9', + { "alpha_id": "SMSC", "parameter_indicators": { "tp_dest_addr": False, "tp_sc_addr": True, + "tp_pid": True, "tp_dcs": True, "tp_vp": True }, + "tp_dest_addr": { "length": 255, "ton_npi": { "ext": True, "type_of_number": "reserved_for_extension", + "numbering_plan_id": "reserved_for_extension" }, + "call_number": "" }, + "tp_sc_addr": { "length": 8, "ton_npi": { "ext": True, "type_of_number": "international", + "numbering_plan_id": "isdn_e164" }, + "call_number": "4915790109999f" }, + "tp_pid": b"\x00", "tp_dcs": b"\x00", "tp_vp_minutes": 4320 } ), ( '454e6574776f726b73fffffffffffffff1ffffffffffffffffffffffffffffffffffffffffffffffff0000a7', { "alpha_id": "ENetworks", "parameter_indicators": { "tp_dest_addr": False, "tp_sc_addr": True, "tp_pid": True, "tp_dcs": True, "tp_vp": False }, -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41677?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I8d16e195641bb59b2c26072008f88434692c0cab Gerrit-Change-Number: 41677 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-Reviewer: neels <nhofmeyr(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: pySim/ts_51_011: Properly re-compute ScAddr length
by laforge 23 Dec '25

23 Dec '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41732?usp=email ) Change subject: pySim/ts_51_011: Properly re-compute ScAddr length ...................................................................... pySim/ts_51_011: Properly re-compute ScAddr length EF.SMSP contains up to two addresses: Both are stored in a fixed-length field of 12 octets. However, the actually used size depends on the number of digits in the respective number. Let's compute that length field properly Change-Id: Idef54a3545d1a5367a1efa2f0a6f7f0c1f860105 --- M pySim/ts_51_011.py M pySim/utils.py 2 files changed, 18 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/ts_51_011.py b/pySim/ts_51_011.py index f87683f..0161f7d 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -40,6 +40,7 @@ from osmocom.construct import * from pySim.utils import dec_iccid, enc_iccid, dec_imsi, enc_imsi, dec_plmn, enc_plmn, dec_xplmn_w_act +from pySim.utils import bytes_for_nibbles from pySim.profile import CardProfile, CardProfileAddon from pySim.filesystem import * from pySim.ts_31_102_telecom import DF_PHONEBOOK, DF_MULTIMEDIA, DF_MCS, DF_V2X @@ -286,9 +287,18 @@ else: raise ValueError + @staticmethod + def sc_addr_len(ctx): + """Compute the length field for an address field (like TP-DestAddr or TP-ScAddr).""" + if not hasattr(ctx, 'call_number') or len(ctx.call_number) == 0: + return 0xff + else: + return bytes_for_nibbles(len(ctx.call_number)) + 1 + def __init__(self, fid='6f42', sfid=None, name='EF.SMSP', desc='Short message service parameters', **kwargs): super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(28, None), **kwargs) - ScAddr = Struct('length'/Int8ub, 'ton_npi'/TonNpi, 'call_number'/BcdAdapter(Rpad(Bytes(10)))) + ScAddr = Struct('length'/Rebuild(Int8ub, lambda ctx: EF_SMSP.sc_addr_len(ctx)), + 'ton_npi'/TonNpi, 'call_number'/BcdAdapter(Rpad(Bytes(10)))) self._construct = Struct('alpha_id'/COptional(GsmOrUcs2Adapter(Rpad(Bytes(this._.total_len-28)))), 'parameter_indicators'/InvertAdapter(BitStruct( Const(7, BitsInteger(3)), diff --git a/pySim/utils.py b/pySim/utils.py index a8fd30c..7d8e3fa 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -526,6 +526,13 @@ # no change return hexstring +def bytes_for_nibbles(num_nibbles: int) -> int: + """compute the number of bytes needed to store the given number of nibbles.""" + n_bytes = num_nibbles // 2 + if num_nibbles & 1: + n_bytes += 1 + return n_bytes + def boxed_heading_str(heading, width=80): """Generate a string that contains a boxed heading.""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41732?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Idef54a3545d1a5367a1efa2f0a6f7f0c1f860105 Gerrit-Change-Number: 41732 Gerrit-PatchSet: 3 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>
1 0
0 0
[S] Change in pysim[master]: pySim.ts_51_011.EF_SMSP: Properly handle odd-length ScAddr / TpAddr
by laforge 23 Dec '25

23 Dec '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41733?usp=email ) Change subject: pySim.ts_51_011.EF_SMSP: Properly handle odd-length ScAddr / TpAddr ...................................................................... pySim.ts_51_011.EF_SMSP: Properly handle odd-length ScAddr / TpAddr As the input phone number ("address") might be of an odd length of digits, let's use PaddedBcdAdapter to fix two problems: 1) strip any potential trailing f in decoding 2) fix truncation of last digit during encoding Change-Id: I1e9865e172bc29b8a31c281106d903934e81c686 Depends: pyosmocom Ib5afb5ab5c2bc9b519dc92818fc6974f7eecba16 (0.0.12 --- M pySim/ts_51_011.py M requirements.txt M setup.py M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok 4 files changed, 5 insertions(+), 5 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified dexter: Looks good to me, approved diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 0161f7d..d37715f 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -249,7 +249,7 @@ "call_number": "" }, "tp_sc_addr": { "length": 8, "ton_npi": { "ext": True, "type_of_number": "international", "numbering_plan_id": "isdn_e164" }, - "call_number": "4915790109999f" }, + "call_number": "4915790109999" }, "tp_pid": b"\x00", "tp_dcs": b"\x00", "tp_vp_minutes": 4320 } ), ( '454e6574776f726b73fffffffffffffff1ffffffffffffffffffffffffffffffffffffffffffffffff0000a7', { "alpha_id": "ENetworks", "parameter_indicators": { "tp_dest_addr": False, "tp_sc_addr": True, @@ -298,7 +298,7 @@ def __init__(self, fid='6f42', sfid=None, name='EF.SMSP', desc='Short message service parameters', **kwargs): super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(28, None), **kwargs) ScAddr = Struct('length'/Rebuild(Int8ub, lambda ctx: EF_SMSP.sc_addr_len(ctx)), - 'ton_npi'/TonNpi, 'call_number'/BcdAdapter(Rpad(Bytes(10)))) + 'ton_npi'/TonNpi, 'call_number'/PaddedBcdAdapter(Rpad(Bytes(10)))) self._construct = Struct('alpha_id'/COptional(GsmOrUcs2Adapter(Rpad(Bytes(this._.total_len-28)))), 'parameter_indicators'/InvertAdapter(BitStruct( Const(7, BitsInteger(3)), diff --git a/requirements.txt b/requirements.txt index 056d912..2ffd999 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ jsonpath-ng construct>=2.10.70 bidict -pyosmocom>=0.0.9 +pyosmocom>=0.0.12 pyyaml>=5.1 termcolor colorlog diff --git a/setup.py b/setup.py index 1b78274..3942df1 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ "jsonpath-ng", "construct >= 2.10.70", "bidict", - "pyosmocom >= 0.0.9", + "pyosmocom >= 0.0.12", "pyyaml >= 5.1", "termcolor", "colorlog", diff --git a/tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok b/tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok index 49b28bd..c965250 100644 --- a/tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok +++ b/tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok @@ -143,7 +143,7 @@ =============================== 00 SEARCH RECORD MF/ADF.USIM/EF.SMSP 01 9000 {"cmd": {"file": "currently_selected_ef", "mode": "forward_search", "record_number": 1, "search_string": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"}, "rsp": {"body": [2], "sw": "9000"}} =============================== -00 READ RECORD MF/ADF.USIM/EF.SMSP 01 9000 {"alpha_id": "", "parameter_indicators": {"tp_vp": true, "tp_dcs": true, "tp_pid": true, "tp_sc_addr": true, "tp_dest_addr": false}, "tp_dest_addr": {"length": 255, "ton_npi": {"ext": true, "type_of_number": "reserved_for_extension", "numbering_plan_id": "reserved_for_extension"}, "call_number": ""}, "tp_sc_addr": {"length": 5, "ton_npi": {"ext": true, "type_of_number": "unknown", "numbering_plan_id": "isdn_e164"}, "call_number": "0015555f"}, "tp_pid": "00", "tp_dcs": "00", "tp_vp_minutes": 5} +00 READ RECORD MF/ADF.USIM/EF.SMSP 01 9000 {"alpha_id": "", "parameter_indicators": {"tp_vp": true, "tp_dcs": true, "tp_pid": true, "tp_sc_addr": true, "tp_dest_addr": false}, "tp_dest_addr": {"length": 255, "ton_npi": {"ext": true, "type_of_number": "reserved_for_extension", "numbering_plan_id": "reserved_for_extension"}, "call_number": ""}, "tp_sc_addr": {"length": 5, "ton_npi": {"ext": true, "type_of_number": "unknown", "numbering_plan_id": "isdn_e164"}, "call_number": "0015555"}, "tp_pid": "00", "tp_dcs": "00", "tp_vp_minutes": 5} =============================== 00 SEARCH RECORD MF/ADF.USIM/EF.SMS 01 9000 {"cmd": {"file": "currently_selected_ef", "mode": "forward_search", "record_number": 1, "search_string": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"}, "rsp": {"body": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30], "sw": "9000"}} =============================== -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41733?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I1e9865e172bc29b8a31c281106d903934e81c686 Gerrit-Change-Number: 41733 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>
1 0
0 0
[S] Change in pysim[master]: pySim/ts_51_011: Properly re-compute ScAddr length
by laforge 23 Dec '25

23 Dec '25
Attention is currently required from: dexter. laforge has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/41732?usp=email ) Change subject: pySim/ts_51_011: Properly re-compute ScAddr length ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41732?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Idef54a3545d1a5367a1efa2f0a6f7f0c1f860105 Gerrit-Change-Number: 41732 Gerrit-PatchSet: 2 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-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 23 Dec 2025 16:21:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[L] Change in pysim[master]: card_key_provider: add PostgreSQL support
by dexter 23 Dec '25

23 Dec '25
Attention is currently required from: daniel, fixeria, laforge. dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41508?usp=email ) Change subject: card_key_provider: add PostgreSQL support ...................................................................... Patch Set 10: (1 comment) File contrib/csv-to-pgsql.py: https://gerrit.osmocom.org/c/pysim/+/41508/comment/7199d524_47c67c4e?usp=em… : PS8, Line 261: str(Path.home()) + "/.osmocom/pysim/card_data_pqsql.cfg" > thanks - but why is it still called pqsql? As I commented earlier, pgsql or psql are industry standa […] I have now grepped through and double checked with git grep. I hope the typos are now all fixed. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41508?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Icba625c02a60d7e1f519b506a46bda5ded0537d3 Gerrit-Change-Number: 41508 Gerrit-PatchSet: 10 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Tue, 23 Dec 2025 13:44:16 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • ...
  • 118
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.