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
[XS] Change in pysim[master]: pySim.esim.saip.ProfileElementSequence: Update type annotations
by fixeria 26 Dec '25

26 Dec '25
Attention is currently required from: laforge. fixeria has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/41736?usp=email ) Change subject: pySim.esim.saip.ProfileElementSequence: Update type annotations ...................................................................... Patch Set 5: Code-Review+2 -- 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: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib99c00a38bf009c63180b4a593d6cc796ff282d3 Gerrit-Change-Number: 41736 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 26 Dec 2025 08:27:36 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in pysim[master]: pySim.esim.saip.ProfileElementSequence: Update type annotations
by laforge 26 Dec '25

26 Dec '25
Attention is currently required from: fixeria. laforge has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/41736?usp=email ) Change subject: pySim.esim.saip.ProfileElementSequence: Update type annotations ...................................................................... Patch Set 5: (1 comment) Patchset: PS4: > Not sure if `(...)` is a valid type-spec. for tuples. […] Done -- 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: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib99c00a38bf009c63180b4a593d6cc796ff282d3 Gerrit-Change-Number: 41736 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 26 Dec 2025 07:42:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in pysim[master]: pySim.esim.saip.ProfileElementSequence: Update type annotations
by laforge 26 Dec '25

26 Dec '25
Attention is currently required from: fixeria, laforge. Hello Jenkins Builder, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/41736?usp=email to look at the new patch set (#5). The following approvals got outdated and were removed: Code-Review-1 by fixeria, Verified+1 by Jenkins Builder 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/5 -- 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: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib99c00a38bf009c63180b4a593d6cc796ff282d3 Gerrit-Change-Number: 41736 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in pysim[master]: global_platform: Add KCV computation for TLS-PSK keys
by laforge 26 Dec '25

26 Dec '25
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41765?usp=email ) Change subject: global_platform: Add KCV computation for TLS-PSK keys ...................................................................... global_platform: Add KCV computation for TLS-PSK keys This adds support for computing the KCV (key check value) for TLS-PSK keys such as those used in SCP81. The spec reference is "Remote Application Management over HTTP Card Specification v2.2 - Amendment B Version 1.1.3" Change-Id: I8c56ba1341fd4615f8a9ed0c13f25790639f9098 --- M pySim/global_platform/__init__.py 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/65/41765/1 diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index 8a99677..a1f4824 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -18,6 +18,7 @@ """ import io +import hashlib from copy import deepcopy from typing import Optional, List, Dict, Tuple from construct import Optional as COptional @@ -1051,10 +1052,18 @@ cipher = AES.new(key, AES.MODE_ECB) return cipher.encrypt(plaintext) +def compute_kcv_sha1(key:bytes) -> bytes: + # GPC 2.2 B RAM over HTTP Section 3.8: A key check value shall be computed as the three most + # significant bytes of the SHA-1 digest of the PSK TLS Key + m = hashlib.sha1() + m.update(key) + return m.digest()[:3] + # dict is keyed by the string name of the KeyType enum above in this file KCV_CALCULATOR = { 'aes': compute_kcv_aes, 'des': compute_kcv_des, + 'tls_psk': compute_kcv_sha1, } def compute_kcv(key_type: str, key: bytes) -> Optional[bytes]: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41765?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: I8c56ba1341fd4615f8a9ed0c13f25790639f9098 Gerrit-Change-Number: 41765 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: Fix more odd-length digit sequences via PaddedBcdAdapter
by laforge 26 Dec '25

26 Dec '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41742?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Fix more odd-length digit sequences via PaddedBcdAdapter ...................................................................... Fix more odd-length digit sequences via PaddedBcdAdapter There are more files where trailing digits are indicated using 'f' and should be stripped during decode, including EF.MSISDN and EF.VGCS This is not just a presentation issue, but actually rendered wrong data before, see the modified test output where our "read_record_uicc.ok" file contained "bcd_len: 7" but then only 6 BCD digits due to this bug. Change-Id: I4571482da924a3d645caa297108279d182448d21 --- M pySim/ts_31_102.py M pySim/ts_51_011.py M tests/pySim-shell_test/file_content/test_record_uicc.ok 3 files changed, 13 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, approved fixeria: Looks good to me, but someone else must approve diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 3ae178c..a93f1e8 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -596,7 +596,7 @@ self._construct = Struct('alpha_id'/Bytes(this._.total_len-28), 'len_of_bcd_contents'/Int8ub, 'ton_npi'/Int8ub, - 'call_number'/BcdAdapter(Bytes(10)), + 'call_number'/PaddedBcdAdapter(Rpad(Bytes(10))), 'cap_cfg2_record_id'/Int8ub, 'ext5_record_id'/Int8ub, 'date_and_time'/BcdAdapter(Bytes(7)), @@ -612,7 +612,7 @@ self._construct = Struct('alpha_id'/Bytes(this._.total_len-27), 'len_of_bcd_contents'/Int8ub, 'ton_npi'/Int8ub, - 'call_number'/BcdAdapter(Bytes(10)), + 'call_number'/PaddedBcdAdapter(Rpad(Bytes(10))), 'cap_cfg2_record_id'/Int8ub, 'ext5_record_id'/Int8ub, 'date_and_time'/BcdAdapter(Bytes(7)), @@ -1118,7 +1118,7 @@ # responsibility of home network operator but BCD coding shall be used. If a network # operator decides to assign less than 4 digits to Routing Indicator, the remaining digits # shall be coded as "1111" to fill the 4 digits coding of Routing Indicator - self._construct = Struct('routing_indicator'/Rpad(BcdAdapter(Bytes(2)), 'f', 2), + self._construct = Struct('routing_indicator'/PaddedBcdAdapter(Rpad(Bytes(2))), 'rfu'/Bytes(2)) # TS 31.102 Section 4.4.11.13 (Rel 16) diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index d37715f..70c38b1 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -152,7 +152,7 @@ self._construct = Struct('alpha_id'/COptional(GsmOrUcs2Adapter(Rpad(Bytes(this._.total_len-14)))), 'len_of_bcd'/Int8ub, 'ton_npi'/TonNpi, - 'dialing_nr'/ExtendedBcdAdapter(BcdAdapter(Rpad(Bytes(10)))), + 'dialing_nr'/ExtendedBcdAdapter(PaddedBcdAdapter(Rpad(Bytes(10)))), 'cap_conf_id'/Int8ub, ext_name/Int8ub) @@ -193,11 +193,11 @@ ( 'ffffffffffffffffffffffffffffffffffffffff04b12143f5ffffffffffffffffff', {"alpha_id": "", "len_of_bcd": 4, "ton_npi": {"ext": True, "type_of_number": "network_specific", "numbering_plan_id": "isdn_e164"}, - "dialing_nr": "12345f"}), + "dialing_nr": "12345"}), ( '456967656e65205275666e756d6d6572ffffffff0891947172199181f3ffffffffff', {"alpha_id": "Eigene Rufnummer", "len_of_bcd": 8, "ton_npi": {"ext": True, "type_of_number": "international", "numbering_plan_id": "isdn_e164"}, - "dialing_nr": "4917279119183f"}), + "dialing_nr": "4917279119183"}), ] # Ensure deprecated representations still work @@ -215,7 +215,7 @@ self._construct = Struct('alpha_id'/COptional(GsmOrUcs2Adapter(Rpad(Bytes(this._.total_len-14)))), 'len_of_bcd'/Int8ub, 'ton_npi'/TonNpi, - 'dialing_nr'/ExtendedBcdAdapter(BcdAdapter(Rpad(Bytes(10)))), + 'dialing_nr'/ExtendedBcdAdapter(PaddedBcdAdapter(Rpad(Bytes(10)))), Padding(2, pattern=b'\xff')) # Maintain compatibility with deprecated representations @@ -661,12 +661,12 @@ # TS 51.011 Section 10.3.20 / 10.3.22 class EF_VGCS(TransRecEF): _test_de_encode = [ - ( "92f9ffff", "299fffff" ), + ( "92f9ffff", "299" ), ] def __init__(self, fid='6fb1', sfid=None, name='EF.VGCS', size=(4, 200), rec_len=4, desc='Voice Group Call Service', **kwargs): super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len, **kwargs) - self._construct = BcdAdapter(Bytes(4)) + self._construct = PaddedBcdAdapter(Rpad(Bytes(4))) # TS 51.011 Section 10.3.21 / 10.3.23 class EF_VGCSS(TransparentEF): diff --git a/tests/pySim-shell_test/file_content/test_record_uicc.ok b/tests/pySim-shell_test/file_content/test_record_uicc.ok index 14183eb..5a4e747 100644 --- a/tests/pySim-shell_test/file_content/test_record_uicc.ok +++ b/tests/pySim-shell_test/file_content/test_record_uicc.ok @@ -19,7 +19,7 @@ "type_of_number": "reserved_for_extension", "numbering_plan_id": "reserved_for_extension" }, - "dialing_nr": "123456", + "dialing_nr": "1234567", "cap_conf_id": 42, "ext4_record_id": 23 }, @@ -67,7 +67,7 @@ "type_of_number": "reserved_for_extension", "numbering_plan_id": "reserved_for_extension" }, - "dialing_nr": "123456", + "dialing_nr": "1234567", "cap_conf_id": 42, "ext4_record_id": 23 }, @@ -127,7 +127,7 @@ "type_of_number": "reserved_for_extension", "numbering_plan_id": "reserved_for_extension" }, - "dialing_nr": "123456", + "dialing_nr": "1234567", "cap_conf_id": 42, "ext4_record_id": 23 } @@ -140,7 +140,7 @@ "type_of_number": "reserved_for_extension", "numbering_plan_id": "reserved_for_extension" }, - "dialing_nr": "123456", + "dialing_nr": "1234567", "cap_conf_id": 42, "ext4_record_id": 23 } -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41742?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: I4571482da924a3d645caa297108279d182448d21 Gerrit-Change-Number: 41742 Gerrit-PatchSet: 5 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
[XS] Change in pysim[master]: ts_31_102.EF_ECC: Use PaddedBcdAdapter to skip trailing 'f'
by laforge 26 Dec '25

26 Dec '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41741?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: ts_31_102.EF_ECC: Use PaddedBcdAdapter to skip trailing 'f' ...................................................................... ts_31_102.EF_ECC: Use PaddedBcdAdapter to skip trailing 'f' The emergency numbers from the example are 911 / 913, and not 911f / 311f Change-Id: Ibfe1e23431aa803b936dd8529e0542e93d9df0b9 --- M pySim/ts_31_102.py 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: dexter: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 4ee6621..3ae178c 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -486,17 +486,17 @@ # TS 31.103 Section 4.2.7 - *not* the same as DF.GSM/EF.ECC! class EF_ECC(LinFixedEF): _test_de_encode = [ - ( '19f1ff01', { "call_code": "911f", + ( '19f1ff01', { "call_code": "911", "service_category": { "police": True, "ambulance": False, "fire_brigade": False, "marine_guard": False, "mountain_rescue": False, "manual_ecall": False, "automatic_ecall": False } } ), - ( '19f3ff02', { "call_code": "913f", + ( '19f3ff02', { "call_code": "913", "service_category": { "police": False, "ambulance": True, "fire_brigade": False, "marine_guard": False, "mountain_rescue": False, "manual_ecall": False, "automatic_ecall": False } } ), ] _test_no_pad = True - cc_construct = BcdAdapter(Rpad(Bytes(3))) + cc_construct = PaddedBcdAdapter(Rpad(Bytes(3))) category_construct = FlagsEnum(Byte, police=1, ambulance=2, fire_brigade=3, marine_guard=4, mountain_rescue=5, manual_ecall=6, automatic_ecall=7) alpha_construct = GsmOrUcs2Adapter(Rpad(GreedyBytes)) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41741?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: Ibfe1e23431aa803b936dd8529e0542e93d9df0b9 Gerrit-Change-Number: 41741 Gerrit-PatchSet: 5 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
[XS] Change in pysim[master]: esim.saip.FsProfileElement: Add file2pe() for single file conversion
by laforge 26 Dec '25

26 Dec '25
laforge has submitted this change. ( 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, 8 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 1c0c715..c0f5340 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -633,8 +633,15 @@ self.pe_sequence.cur_df = pe_df self.pe_sequence.cur_df = self.pe_sequence.cur_df.add_file(file) + def file2pe(self, file: File): + """Update the "decoded" member for the given file with the contents from the given File instance. + We expect that the File instance is part of self.files""" + if self.files[file.pe_name] != file: + raise ValueError("The file you passed is not part of this ProfileElement") + self.decoded[file.pe_name] = file.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: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I7b7f61aae6b7df6946dadf2f78fddf92995603ec Gerrit-Change-Number: 41734 Gerrit-PatchSet: 5 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.esim.saip.personalization: Support for EF.SMSP personalization
by laforge 26 Dec '25

26 Dec '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41735?usp=email ) ( 5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pySim.esim.saip.personalization: Support for EF.SMSP personalization ...................................................................... pySim.esim.saip.personalization: Support for EF.SMSP personalization It's a not-too-uncommon requirement to modify the SMSC address stored in EF.SMSP. This adds a ConfigurableParameter for this purpose. Change-Id: I6b0776c2e753e0a6d158a8cf65cb030977782ec2 --- M pySim/esim/saip/personalization.py 1 file changed, 43 insertions(+), 0 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve dexter: Looks good to me, approved Jenkins Builder: Verified 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: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I6b0776c2e753e0a6d158a8cf65cb030977782ec2 Gerrit-Change-Number: 41735 Gerrit-PatchSet: 7 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
[XS] Change in osmo-ttcn3-hacks[master]: s1gw: fix ParamEnbId: fix charstring pattern for 'enb-conn'
by fixeria 25 Dec '25

25 Dec '25
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41763?usp=email ) Change subject: s1gw: fix ParamEnbId: fix charstring pattern for 'enb-conn' ...................................................................... s1gw: fix ParamEnbId: fix charstring pattern for 'enb-conn' Permit IPv6 addresses by including hexadecimal characters. Change-Id: Ie95fb6ca53c1fa305bc7501173102a8a7265fa38 Related: osmo-s1gw.git I112283b140a070924d59935a3bdd6fd63fc8c7ea --- M s1gw/S1GW_REST_Types.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/63/41763/1 diff --git a/s1gw/S1GW_REST_Types.ttcn b/s1gw/S1GW_REST_Types.ttcn index 8ddbc20..e76f33e 100644 --- a/s1gw/S1GW_REST_Types.ttcn +++ b/s1gw/S1GW_REST_Types.ttcn @@ -26,7 +26,7 @@ charstring pid (pattern "pid:[0-9]+.[0-9]+.[0-9]+"), charstring genbid (pattern "genbid:[0-9]#3-[0-9]#(2,3)-[0-9]+"), charstring sctp_aid (pattern "(enb|mme)-sctp-aid:[0-9]+"), - charstring enb_conn (pattern "enb-conn:[0-9:.]+-[0-9]+") + charstring enb_conn (pattern "enb-conn:[0-9a-f:.]+-[0-9]+") } with { encode "TEXT" }; type union ParamErabId { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41763?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: Ie95fb6ca53c1fa305bc7501173102a8a7265fa38 Gerrit-Change-Number: 41763 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: s1gw: add MME pool related REST definitions
by fixeria 25 Dec '25

25 Dec '25
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41764?usp=email ) Change subject: s1gw: add MME pool related REST definitions ...................................................................... s1gw: add MME pool related REST definitions Change-Id: I76f1a5cf41331d021c08fbefdf78e34da4ac2121 Related: osmo-s1gw.git Iad249aed99face9e35fd19e0596cf2364ade4c77 Related: SYS#7052, SYS#7066 --- M s1gw/S1GW_REST_Functions.ttcn M s1gw/S1GW_REST_Types.ttcn 2 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/41764/1 diff --git a/s1gw/S1GW_REST_Functions.ttcn b/s1gw/S1GW_REST_Functions.ttcn index fb8731b..454d77e 100644 --- a/s1gw/S1GW_REST_Functions.ttcn +++ b/s1gw/S1GW_REST_Functions.ttcn @@ -53,6 +53,37 @@ return dec_OperationResult(char2oct(rsp.response.body)); } +/* Get a list of MMEs in the pool */ +function f_REST_MmeList() +runs on http_CT return MmeList { + var HTTPMessage rsp := f_http_transact("/mme-list", method := "GET"); + return dec_MmeList(char2oct(rsp.response.body)); +} + +/* Add an MME to the pool */ +function f_REST_MmeAdd(MmeItem mme_item) +runs on http_CT return boolean { + var HTTPMessage rsp := f_http_transact("/mme-list", method := "POST", + binary_body := enc_MmeItem(mme_item)); + return rsp.response.statuscode == 201; +} + +/* Get information about a specific MME */ +function f_REST_MmeInfo(ParamMmeId mme_id) +runs on http_CT return MmeItem { + var charstring p_mme_id := enc_ParamMmeId(mme_id); + var HTTPMessage rsp := f_http_transact("/mme/" & p_mme_id, method := "GET"); + return dec_MmeItem(char2oct(rsp.response.body)); +} + +/* Delete an MME from the pool */ +function f_REST_MmeDelete(ParamMmeId mme_id) +runs on http_CT return boolean { + var charstring p_mme_id := enc_ParamMmeId(mme_id); + var HTTPMessage rsp := f_http_transact("/mme/" & p_mme_id, method := "DELETE"); + return rsp.response.statuscode == 200; +} + /* Get a list of eNB connections */ function f_REST_EnbList() runs on http_CT return EnbList { diff --git a/s1gw/S1GW_REST_Types.ttcn b/s1gw/S1GW_REST_Types.ttcn index e76f33e..f182ae9 100644 --- a/s1gw/S1GW_REST_Types.ttcn +++ b/s1gw/S1GW_REST_Types.ttcn @@ -21,6 +21,11 @@ type integer TEID (0..4294967295); type integer Port (0..65535); +type union ParamMmeId { + charstring name (pattern "name:*"), + charstring addr (pattern "addr:[0-9a-f:.]+-[0-9]+") +} with { encode "TEXT" }; + type union ParamEnbId { charstring handle (pattern "handle:[0-9]+"), charstring pid (pattern "pid:[0-9]+.[0-9]+.[0-9]+"), @@ -69,6 +74,17 @@ connected }; +type set of MmeItem MmeList; +type set MmeItem { + charstring name, /* Unique, human-readable identifier */ + charstring laddr optional, /* Local (bind) IP address (default: any) */ + charstring raddr, /* Remote (connect) IP address */ + Port rport optional, /* Remote port (default: 36412) */ + TacList tac_list optional /* List of allowed TACs (empty means allow-all) */ +}; + +type record of integer TacList; + type set of EnbItem EnbList; type set EnbItem { EnbHandle handle, /* Unique number in the eNB registry */ @@ -112,17 +128,26 @@ charstring tla /* GTP-U TLA (Transport Layer Address) */ }; +external function enc_ParamMmeId(in ParamMmeId mme_id) return charstring + with { extension "prototype(convert) encode(TEXT)" } external function enc_ParamEnbId(in ParamEnbId enb_id) return charstring with { extension "prototype(convert) encode(TEXT)" } external function enc_ParamErabId(in ParamErabId erab_id) return charstring with { extension "prototype(convert) encode(TEXT)" } +external function enc_MmeItem(in MmeItem mme_item) return octetstring + with { extension "prototype(convert) encode(JSON)" } + external function dec_OperationResult(in octetstring data) return OperationResult with { extension "prototype(convert) decode(JSON)" } external function dec_MetricsList(in octetstring data) return MetricsList with { extension "prototype(convert) decode(JSON)" } external function dec_PfcpAssocInfo(in octetstring data) return PfcpAssocInfo with { extension "prototype(convert) decode(JSON)" } +external function dec_MmeList(in octetstring data) return MmeList + with { extension "prototype(convert) decode(JSON)" } +external function dec_MmeItem(in octetstring data) return MmeItem + with { extension "prototype(convert) decode(JSON)" } external function dec_EnbList(in octetstring data) return EnbList with { extension "prototype(convert) decode(JSON)" } external function dec_EnbItem(in octetstring data) return EnbItem -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41764?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: I76f1a5cf41331d021c08fbefdf78e34da4ac2121 Gerrit-Change-Number: 41764 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • ...
  • 118
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.