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/+/41733?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.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
---
M pySim/ts_51_011.py
M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/41733/2
--
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: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1e9865e172bc29b8a31c281106d903934e81c686
Gerrit-Change-Number: 41733
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: fixeria, laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41738?usp=email )
Change subject: pySim-shell: output git hash in case get_distribution fails
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
When the repository is just cloned from current master, the version command fails with an exception. I think we should try to print at least some kind of version reference. The topmost commit hash might be an option.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41738?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: I2b9038f88cfcaa07894a2f09c7f5ad8a5474083d
Gerrit-Change-Number: 41738
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:46:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Jenkins Builder has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41738?usp=email )
Change subject: pySim-shell: output git hash in case get_distribution fails
......................................................................
Patch Set 1:
(1 comment)
File pySim-shell.py:
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/pysim/+/41738/comment/8f948d97_13afc301?usp=em… :
PS1, Line 531: version = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
trailing whitespace
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41738?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: I2b9038f88cfcaa07894a2f09c7f5ad8a5474083d
Gerrit-Change-Number: 41738
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:44:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41738?usp=email )
Change subject: pySim-shell: output git hash in case get_distribution fails
......................................................................
pySim-shell: output git hash in case get_distribution fails
In case pySim-shell is used directly from the git repository (not
installed via a package manager), the version command fails with an
exception because pkg_resources.get_distribution('pySim') fails. In
that case, let's check if pySim-shell.py is inside a git repository
and if so, get the HEAD commit hash and display it instead.
Related: OS#6830
Change-Id: I2b9038f88cfcaa07894a2f09c7f5ad8a5474083d
---
M pySim-shell.py
1 file changed, 12 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/38/41738/1
diff --git a/pySim-shell.py b/pySim-shell.py
index a8b15d5..96658d3 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -520,7 +520,18 @@
def do_version(self, opts):
"""Print the pySim software version."""
import pkg_resources
- self.poutput(pkg_resources.get_distribution('pySim'))
+ from pkg_resources import DistributionNotFound
+ try:
+ self.poutput(pkg_resources.get_distribution('pySim'))
+ except DistributionNotFound as e:
+ import subprocess
+ import os
+ cwd = os.path.dirname(os.path.realpath(__file__))
+ if os.path.isdir(cwd + "/.git"):
+ version = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
+ self.poutput("pySim-git-" + version)
+ else:
+ raise(e)
@with_default_category('pySim Commands')
class PySimCommands(CommandSet):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41738?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I2b9038f88cfcaa07894a2f09c7f5ad8a5474083d
Gerrit-Change-Number: 41738
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41737?usp=email )
Change subject: esim.saip: Better docstring about FsNode class
......................................................................
esim.saip: Better docstring about FsNode class
Change-Id: Id9d196e8d9b1d1b892ec50100b170d72d2c3910b
---
M pySim/esim/saip/__init__.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/37/41737/1
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index f661745..dacd35e 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -1885,7 +1885,10 @@
class FsNode:
- """A node in the filesystem hierarchy."""
+ """A node in the filesystem hierarchy. Each node can have a parent node and any number of children.
+ Each node is identified uniquely within the parent by its numeric FID and its optional human-readable
+ name. Each node usually is associated with an instance of the File class for the actual content of
+ the file. FsNode is the base class used by more specific nodes, such as FsNode{EF,DF,ADF,MF}."""
def __init__(self, fid: int, parent: Optional['FsNode'], file: Optional[File] = None,
name: Optional[str] = None):
self.fid = fid
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41737?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id9d196e8d9b1d1b892ec50100b170d72d2c3910b
Gerrit-Change-Number: 41737
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41736?usp=email )
Change subject: pySim.esim.saip.ProfileElementSequence: Update type annotations
......................................................................
pySim.esim.saip.ProfileElementSequence: Update type annotations
The type annotations didn't reflect reality in two cases.
Change-Id: Ib99c00a38bf009c63180b4a593d6cc796ff282d3
---
M pySim/esim/saip/__init__.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/36/41736/1
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index 6e8823b..f661745 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -1786,7 +1786,7 @@
return None
@staticmethod
- def peclass_for_path(path: Path) -> Optional[ProfileElement]:
+ def peclass_for_path(path: Path) -> (Optional[ProfileElement], Optional[templates.FileTemplate]):
"""Return the ProfileElement class that can contain a file with given path."""
naa = ProfileElementSequence.naa_for_path(path)
if naa:
@@ -1819,7 +1819,7 @@
return ProfileElementTelecom, ft
return ProfileElementGFM, None
- def pe_for_path(self, path: Path) -> Optional[ProfileElement]:
+ def pe_for_path(self, path: Path) -> (Optional[ProfileElement], Optional[templates.FileTemplate]):
"""Return the ProfileElement instance that can contain a file with matching path. This will
either be an existing PE within the sequence, or it will be a newly-allocated PE that is
inserted into the sequence."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41736?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib99c00a38bf009c63180b4a593d6cc796ff282d3
Gerrit-Change-Number: 41736
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41735?usp=email )
Change subject: pySim.esim.saip.personalization: Support for EF.SMPP personalization
......................................................................
pySim.esim.saip.personalization: Support for EF.SMPP personalization
It's a not-too-uncommon requirement to modify the SMSC address stored in
EF.SMPP. This adds a ConfigurableParameter for this purpose.
Change-Id: I6b0776c2e753e0a6d158a8cf65cb030977782ec2
---
M pySim/esim/saip/personalization.py
1 file changed, 43 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/35/41735/1
diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py
index 71f115d..a1df068 100644
--- a/pySim/esim/saip/personalization.py
+++ b/pySim/esim/saip/personalization.py
@@ -22,6 +22,7 @@
from osmocom.tlv import camel_to_snake
from pySim.utils import enc_iccid, enc_imsi, h2b, rpad, sanitize_iccid
from pySim.esim.saip import ProfileElement, ProfileElementSequence
+from pySim.ts_51_011 import EF_SMSP
def remove_unwanted_tuples_from_list(l: List[Tuple], unwanted_keys: List[str]) -> List[Tuple]:
"""In a list of tuples, remove all tuples whose first part equals 'unwanted_key'."""
@@ -104,6 +105,48 @@
file_replace_content(pe.decoded['ef-acc'], acc.to_bytes(2, 'big'))
# TODO: DF.GSM_ACCESS if not linked?
+class SmspTpScAddr(ConfigurableParameter):
+ """Configurable SMSC (SMS Service Centre) TP-SC-ADDR. Expects to be a phone number in national or
+ international format (designated by a leading +). Automatically sets the NPI to E.164 and the TON based on
+ presence or absence of leading +"""
+
+ def validate(self):
+ addr_str = str(self.input_value)
+ if addr_str[0] == '+':
+ digits = addr_str[1:]
+ international = True
+ else:
+ digits = addr_str
+ international = False
+ if len(digits) > 20:
+ raise ValueError('TP-SC-ADDR must not exceed 20 digits')
+ if not digits.isdecimal():
+ raise ValueError('TP-SC-ADDR must only contain decimal digits')
+ self.value = (international, digits)
+
+ def apply(self, pes: ProfileElementSequence):
+ international, digits = self.value
+ for pe in pes.get_pes_for_type('usim'):
+ # obtain the File instance from the ProfileElementUSIM
+ f_smsp = pe.files['ef-smsp']
+ #print("SMSP (orig): %s" % f_smsp.body)
+ # instantiate the pySim.ts_51_011.EF_SMSP class for decode/encode
+ ef_smsp = EF_SMSP()
+ # decode the existing file body
+ ef_smsp_dec = ef_smsp.decode_record_bin(f_smsp.body, 1)
+ # patch the actual number
+ ef_smsp_dec['tp_sc_addr']['call_number'] = digits
+ # patch the NPI to isdn_e164
+ ef_smsp_dec['tp_sc_addr']['ton_npi']['numbering_plan_id'] = 'isdn_e164'
+ # patch the TON to international or unknown depending on +
+ ef_smsp_dec['tp_sc_addr']['ton_npi']['type_of_number'] = 'international' if international else 'unknown'
+ # ensure the parameter_indicators.tp_sc_addr is True
+ ef_smsp_dec['parameter_indicators']['tp_sc_addr'] = True
+ # re-encode into the File body
+ f_smsp.body = ef_smsp.encode_record_bin(ef_smsp_dec, 1)
+ #print("SMSP (new): %s" % f_smsp.body)
+ # re-generate the pe.decoded member from the File instance
+ pe.file2pe(f_smsp)
class SdKey(ConfigurableParameter, metaclass=ClassVarMeta):
"""Configurable Security Domain (SD) Key. Value is presented as bytes."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41735?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6b0776c2e753e0a6d158a8cf65cb030977782ec2
Gerrit-Change-Number: 41735
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41734?usp=email )
Change subject: esim.saip.FsProfileElement: Add file2pe() for single file conversion
......................................................................
esim.saip.FsProfileElement: Add file2pe() for single file conversion
We've had files2pe() for re-encoding all of the files, but let's add
a specific one for re-encoding only one of the files (such as commonly
needed during personalization)
Change-Id: I7b7f61aae6b7df6946dadf2f78fddf92995603ec
---
M pySim/esim/saip/__init__.py
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/34/41734/1
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index 1c0c715..6e8823b 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -633,8 +633,12 @@
self.pe_sequence.cur_df = pe_df
self.pe_sequence.cur_df = self.pe_sequence.cur_df.add_file(file)
+ def file2pe(self, f: File):
+ """Update the "decoded" member for the given file with the contents from the given File."""
+ self.decoded[f.pe_name] = f.to_tuples()
+
def files2pe(self):
- """Update the "decoded" member with the contents of the "files" member."""
+ """Update the "decoded" member for each file with the contents of the "files" member."""
for k, f in self.files.items():
self.decoded[k] = f.to_tuples()
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41734?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I7b7f61aae6b7df6946dadf2f78fddf92995603ec
Gerrit-Change-Number: 41734
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>