Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39863?usp=email )
Change subject: saip-tool: add commandline option to edit mandatory services list
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39863?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: I120b98d4b0942c26674bc1365c5711101ec95235
Gerrit-Change-Number: 39863
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 27 Mar 2025 17:24:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: dexter, fixeria.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39862?usp=email )
Change subject: saip-tool: allow removing of profile elements by type
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39862?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: I92f9f9d5b4382242963f1b3ded814a0d013c4808
Gerrit-Change-Number: 39862
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 27 Mar 2025 17:24:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39860?usp=email )
Change subject: saip-tool: add features to add and remove applications profile elements
......................................................................
Patch Set 1:
(6 comments)
Patchset:
PS1:
In general what we're seeing is that it may probably make sense to eventually (at a later point, unrelated to this patch) switch to something like a 'saip-shell' which has various commands. This way the user could start saip-shell with a UPP in DER format, and then navigate the PEs, update/remove/reorder/whatever and save at the end. Those steps then could also be performed with scripts, like pySim-shell supports.
File contrib/saip-tool.py:
https://gerrit.osmocom.org/c/pysim/+/39860/comment/a7b17e7a_3f22f4b4?usp=em… :
PS1, Line 22: import zipfile
removing those unused imports is a logically separate change, isn't it?
https://gerrit.osmocom.org/c/pysim/+/39860/comment/a793ac1c_15e913b6?usp=em… :
PS1, Line 267: app_index = 0
shouldn't we simply make this part of the 'info' command? We already display some basic information about applications there. If you're worried about verbosity, we could add a '--verbose'
https://gerrit.osmocom.org/c/pysim/+/39860/comment/75d235ac_f93364e0?usp=em… :
PS1, Line 272:
I think this line should be removed, it's likely just a debug aid?
https://gerrit.osmocom.org/c/pysim/+/39860/comment/ad77b270_2aa23f46?usp=em… :
PS1, Line 349: 0]
> I am not sure here, As far as I know there can be multiple securityDomain PEs in a profile. […]
There can be multiple security domains. It's probably unusual, but legal AFAIR. I suggest to check if there's only one and abort if there are multiple printing a message that this is currently not yet supported.
https://gerrit.osmocom.org/c/pysim/+/39860/comment/383cc264_2fd3faf4?usp=em… :
PS1, Line 375:
> I wonder if it is better to put this in a method in ProfileElementApplication?
yes, I think a method would be better style.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39860?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: I41db96f2f0ccc29c1725a92215ce6b17d87b76ce
Gerrit-Change-Number: 39860
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 27 Mar 2025 17:22:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: dexter, fixeria.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39859?usp=email )
Change subject: saip-tool: add function to write PE sequence
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39859?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: I38733422270f5b9c18187b7f247b84bf21f9121b
Gerrit-Change-Number: 39859
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 27 Mar 2025 17:16:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39863?usp=email )
Change subject: saip-tool: add commandline option to edit mandatory services list
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I am not sure if we really need this. I added this because I wanted to try something out.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39863?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: I120b98d4b0942c26674bc1365c5711101ec95235
Gerrit-Change-Number: 39863
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 27 Mar 2025 13:09:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39860?usp=email )
Change subject: saip-tool: add features to add and remove applications profile elements
......................................................................
Patch Set 1:
(2 comments)
File contrib/saip-tool.py:
https://gerrit.osmocom.org/c/pysim/+/39860/comment/4207e90f_5ada36ac?usp=em… :
PS1, Line 349: 0]
I am not sure here, As far as I know there can be multiple securityDomain PEs in a profile. If this really is the case, we have to add a parameter to identify the security domain. If not, we should be fine.
https://gerrit.osmocom.org/c/pysim/+/39860/comment/e9288f2b_b340e7fb?usp=em… :
PS1, Line 375:
I wonder if it is better to put this in a method in ProfileElementApplication?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39860?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: I41db96f2f0ccc29c1725a92215ce6b17d87b76ce
Gerrit-Change-Number: 39860
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 27 Mar 2025 13:07:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/39859?usp=email )
Change subject: saip-tool: add function to write PE sequence
......................................................................
saip-tool: add function to write PE sequence
To prevent code duplication and to make the implementation simpler,
let's add a function that takes care of writing the PE sequnece
to an output file.
Change-Id: I38733422270f5b9c18187b7f247b84bf21f9121b
---
M contrib/saip-tool.py
1 file changed, 8 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/59/39859/1
diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py
index 763e18d..b7282bd 100755
--- a/contrib/saip-tool.py
+++ b/contrib/saip-tool.py
@@ -65,6 +65,12 @@
parser_info = subparsers.add_parser('tree', help='Display the filesystem tree')
+def write_pes(pes: ProfileElementSequence, output_file:str):
+ """write the PE sequence to a file"""
+ print("Writing %u PEs to file '%s'..." % (len(pes.pe_list), output_file))
+ with open(output_file, 'wb') as f:
+ f.write(pes.to_der())
+
def do_split(pes: ProfileElementSequence, opts):
i = 0
for pe in pes.pe_list:
@@ -132,9 +138,7 @@
pes.pe_list = new_pe_list
pes._process_pelist()
- print("Writing %u PEs to file '%s'..." % (len(pes.pe_list), opts.output_file))
- with open(opts.output_file, 'wb') as f:
- f.write(pes.to_der())
+ write_pes(pes, opts.output_file)
def do_remove_naa(pes: ProfileElementSequence, opts):
if not opts.naa_type in NAAs:
@@ -142,9 +146,7 @@
naa = NAAs[opts.naa_type]
print("Removing NAAs of type '%s' from Sequence..." % opts.naa_type)
pes.remove_naas_of_type(naa)
- print("Writing %u PEs to file '%s'..." % (len(pes.pe_list), opts.output_file))
- with open(opts.output_file, 'wb') as f:
- f.write(pes.to_der())
+ write_pes(pes, opts.output_file)
def do_info(pes: ProfileElementSequence, opts):
def get_naa_count(pes: ProfileElementSequence) -> dict:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39859?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: I38733422270f5b9c18187b7f247b84bf21f9121b
Gerrit-Change-Number: 39859
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/39862?usp=email )
Change subject: saip-tool: allow removing of profile elements by type
......................................................................
saip-tool: allow removing of profile elements by type
At the moment it is only possible to remove profile elements by their identification
number. However, there may be cases where we want to remove all profile elements of
a certain type at once (e.g. when removing all applications).
Change-Id: I92f9f9d5b4382242963f1b3ded814a0d013c4808
---
M contrib/saip-tool.py
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/39862/1
diff --git a/contrib/saip-tool.py b/contrib/saip-tool.py
index 05b828b..1ffc0e2 100755
--- a/contrib/saip-tool.py
+++ b/contrib/saip-tool.py
@@ -53,7 +53,8 @@
parser_rpe = subparsers.add_parser('remove-pe', help='Remove specified PEs from PE-Sequence')
parser_rpe.add_argument('--output-file', required=True, help='Output file name')
-parser_rpe.add_argument('--identification', type=int, action='append', help='Remove PEs matching specified identification')
+parser_rpe.add_argument('--identification', default=[], type=int, action='append', help='Remove PEs matching specified identification')
+parser_rpe.add_argument('--type', default=[], action='append', help='Remove PEs matching specified type')
parser_rn = subparsers.add_parser('remove-naa', help='Remove speciifed NAAs from PE-Sequence')
parser_rn.add_argument('--output-file', required=True, help='Output file name')
@@ -180,6 +181,9 @@
if identification in opts.identification:
print("Removing PE %s (id=%u) from Sequence..." % (pe, identification))
continue
+ if pe.type in opts.type:
+ print("Removing PE %s (type=%s) from Sequence..." % (pe, pe.type))
+ continue
new_pe_list.append(pe)
pes.pe_list = new_pe_list
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39862?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: I92f9f9d5b4382242963f1b3ded814a0d013c4808
Gerrit-Change-Number: 39862
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>