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/+/41913?usp=email
to look at the new patch set (#3).
Change subject: Decode GSM 7-bit packed EF.PNN data
......................................................................
Decode GSM 7-bit packed EF.PNN data
Use the NetworkNameAdapter from pyosmocom to decode the Network Name
IEs (TS 24.008 Section 10.5.3.5a) in EF.PNN records, instead of
exposing the raw bytes.
Depends: pyosmocom.git Change-Id I4661352e39031dc0041fc7851f675d6083a1035f
Change-Id: I4558fd011592aeeae2389fe8a1f62f3d7e21d219
---
M pySim/ts_51_011.py
M requirements.txt
M setup.py
3 files changed, 13 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/13/41913/3
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41913?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: I4558fd011592aeeae2389fe8a1f62f3d7e21d219
Gerrit-Change-Number: 41913
Gerrit-PatchSet: 3
Gerrit-Owner: biocape <biofel(a)cape.co>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, laforge.
biocape has posted comments on this change by biocape. ( https://gerrit.osmocom.org/c/pysim/+/41913?usp=email )
Change subject: Decode GSM 7-bit packed EF.PNN data
......................................................................
Patch Set 1:
(1 comment)
File pySim/ts_51_011.py:
https://gerrit.osmocom.org/c/pysim/+/41913/comment/c8daa132_9cfe8b43?usp=em… :
PS1, Line 906: return data.decode('utf_16_be')
> I'd assume this is all possible without too much imperative code and with some construct-magic. […]
Done — moved to pyosmocom as NetworkNameAdapter in I4661352e39031dc0041fc7851f675d6083a1035f.
I don't think parameterizing GsmOrUcs2Adapter works here: the Network Name header collides with the Annex A magic bytes. E.g. a 10-septet GSM 7-bit name starts with 0x82, which Annex A would read as UCS-2 variant 3. So I gave it its own adapter.
Also fixed two bugs from patchset 1 along the way: coding scheme is bits 7-5 (not bit 7), and the UCS-2 encode header should be 0x90, not 0xC0 (reserved).
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41913?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: I4558fd011592aeeae2389fe8a1f62f3d7e21d219
Gerrit-Change-Number: 41913
Gerrit-PatchSet: 1
Gerrit-Owner: biocape <biofel(a)cape.co>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 23 Aug 2026 07:15:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: biocape, fixeria.
Hello Jenkins Builder, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41913?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by fixeria, Verified+1 by Jenkins Builder
Change subject: Decode GSM 7-bit packed EF.PNN data
......................................................................
Decode GSM 7-bit packed EF.PNN data
Use the NetworkNameAdapter from pyosmocom to decode the Network Name
IEs (TS 24.008 Section 10.5.3.5a) in EF.PNN records, instead of
exposing the raw bytes.
Depends: pyosmocom.git Change-Id I4661352e39031dc0041fc7851f675d6083a1035f
Change-Id: I4558fd011592aeeae2389fe8a1f62f3d7e21d219
---
M pySim/ts_51_011.py
M requirements.txt
M setup.py
3 files changed, 13 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/13/41913/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41913?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: I4558fd011592aeeae2389fe8a1f62f3d7e21d219
Gerrit-Change-Number: 41913
Gerrit-PatchSet: 2
Gerrit-Owner: biocape <biofel(a)cape.co>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: biocape <biofel(a)cape.co>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/43370?usp=email )
Change subject: gsmtap: Update repo link from cgit to gitea/forgejo
......................................................................
gsmtap: Update repo link from cgit to gitea/forgejo
Change-Id: I4d6e6921dba2b379714ff9ab9d6edfc2759681f8
---
M src/osmocom/gsmtap.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/70/43370/1
diff --git a/src/osmocom/gsmtap.py b/src/osmocom/gsmtap.py
index 3474396..0c2edf7 100644
--- a/src/osmocom/gsmtap.py
+++ b/src/osmocom/gsmtap.py
@@ -28,7 +28,7 @@
from osmocom.construct import parse_construct
# The root definition of GSMTAP can be found at
-# https://cgit.osmocom.org/cgit/libosmocore/tree/include/osmocom/core/gsmtap.h
+# https://gitea.osmocom.org/osmocom/libosmocore/src/branch/master/include/osm…
GSMTAP_UDP_PORT = 4729
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/43370?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I4d6e6921dba2b379714ff9ab9d6edfc2759681f8
Gerrit-Change-Number: 43370
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/43367?usp=email )
Change subject: gsmtap: Update repo link from cgit to gitea/forgejo
......................................................................
gsmtap: Update repo link from cgit to gitea/forgejo
Change-Id: I56c53705b5911e919631eb81126f32bfdede69b3
---
M include/osmocom/core/gsmtap.h
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/43367/1
diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h
index d153efc..2a0e1a4 100644
--- a/include/osmocom/core/gsmtap.h
+++ b/include/osmocom/core/gsmtap.h
@@ -17,7 +17,7 @@
/* The GSMTAP format definition is maintained in libosmocore,
* specifically the latest version can always be obtained from
- * http://cgit.osmocom.org/cgit/libosmocore/tree/include/osmocom/core/gsmtap.h
+ * https://gitea.osmocom.org/osmocom/libosmocore/src/branch/master/include/osm…
*
* If you want to introduce new protocol/burst/channel types or extend
* GSMTAP in any way, please contact the GSMTAP maintainer at either the
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43367?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I56c53705b5911e919631eb81126f32bfdede69b3
Gerrit-Change-Number: 43367
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/43254?usp=email )
Change subject: ts_102_221: support EF.ARR record decoding for DF, not just EF
......................................................................
ts_102_221: support EF.ARR record decoding for DF, not just EF
Sadly, the EF.ARR interpretation, specifically that of the AM_DO
depends on whether the rule is for a DF or EF. As we don't know this,
allow the user to specify what kind of decode they would like, at least
in the file-specific read_arr_record + read_arr_records command.
Change-Id: I05e629e8b7dc705730d7039d2d0170ee24f8f844
---
M pySim/ts_102_221.py
1 file changed, 30 insertions(+), 8 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py
index e38483d..603bc9c 100644
--- a/pySim/ts_102_221.py
+++ b/pySim/ts_102_221.py
@@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from bidict import bidict
+import copy
from construct import Select, Const, Bit, Struct, Int16ub, FlagsEnum, GreedyString, ValidationError
from construct import Optional as COptional, Computed
@@ -732,36 +733,57 @@
raise ValueError
return by_mode
+ @staticmethod
+ def __get_do_sequence(decode_for_df : bool = False):
+ if decode_for_df:
+ return DataObjectSequence('arr', sequence=[AM_DO_DF, SC_DO])
+ else:
+ return DataObjectSequence('arr', sequence=[AM_DO_EF, SC_DO])
+
def _decode_record_bin(self, raw_bin_data, **kwargs):
- # we can only guess if we should decode for EF or DF here :(
- arr_seq = DataObjectSequence('arr', sequence=[AM_DO_EF, SC_DO])
+ # we can only guess if we should decode for EF or DF here, but our caller may
+ # be able to pass us a hint:
+ arr_seq = self.__get_do_sequence(kwargs.get('decode_for_df', False))
dec = arr_seq.decode_multi(raw_bin_data)
# we cannot pass the result through flatten() here, as we don't have a related
# 'un-flattening' decoder, and hence would be unable to encode :(
return dec[0]
def _encode_record_bin(self, in_json, **kwargs):
- # we can only guess if we should decode for EF or DF here :(
- arr_seq = DataObjectSequence('arr', sequence=[AM_DO_EF, SC_DO])
+ # we can only guess if we should decode for EF or DF here, but our caller may
+ # be able to pass us a hint:
+ arr_seq = self.__get_do_sequence(kwargs.get('encode_for_df', False))
return arr_seq.encode_multi(in_json)
@with_default_category('File-Specific Commands')
class AddlShellCommands(CommandSet):
- @cmd2.with_argparser(LinFixedEF.ShellCommands.read_rec_dec_parser)
+ read_arr_argparser = copy.deepcopy(LinFixedEF.ShellCommands.read_rec_dec_parser)
+ read_arr_argparser.add_argument('--decode-for-df', action='store_true',
+ help='Decode EF.ARR record as if used by a DF (default: EF)')
+
+ @cmd2.with_argparser(read_arr_argparser)
def do_read_arr_record(self, opts):
"""Read one EF.ARR record in flattened, human-friendly form."""
- (data, _sw) = self._cmd.lchan.read_record_dec(opts.RECORD_NR)
+ (hexdata, _sw) = self._cmd.lchan.read_record(opts.RECORD_NR)
+ data = self._cmd.lchan.selected_file._decode_record_bin(h2b(hexdata),
+ decode_for_df = opts.decode_for_df)
data = self._cmd.lchan.selected_file.flatten(data)
self._cmd.poutput_json(data, opts.oneline)
- @cmd2.with_argparser(LinFixedEF.ShellCommands.read_recs_dec_parser)
+ read_arrs_argparser = copy.deepcopy(LinFixedEF.ShellCommands.read_recs_dec_parser)
+ read_arrs_argparser.add_argument('--decode-for-df', action='store_true',
+ help='Decode EF.ARR records as if used by a DF (default: EF)')
+
+ @cmd2.with_argparser(read_arrs_argparser)
def do_read_arr_records(self, opts):
"""Read + decode all EF.ARR records in flattened, human-friendly form."""
num_of_rec = self._cmd.lchan.selected_file_num_of_rec()
# collect all results in list so they are rendered as JSON list when printing
data_list = []
for recnr in range(1, 1 + num_of_rec):
- (data, _sw) = self._cmd.lchan.read_record_dec(recnr)
+ (hexdata, _sw) = self._cmd.lchan.read_record(recnr)
+ data = self._cmd.lchan.selected_file._decode_record_bin(h2b(hexdata),
+ decode_for_df = opts.decode_for_df)
data = self._cmd.lchan.selected_file.flatten(data)
data_list.append(data)
self._cmd.poutput_json(data_list, opts.oneline)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43254?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: I05e629e8b7dc705730d7039d2d0170ee24f8f844
Gerrit-Change-Number: 43254
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>