Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34872?usp=email )
Change subject: library/DIAMETER: Split TS 29.273 templates into its own file
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34872?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I77f917404dd70559b2b2cc62199ed70289ab0825
Gerrit-Change-Number: 34872
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 24 Oct 2023 19:11:51 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34851?usp=email )
(
4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: utils: Fix bertlv_encode_tag() for multi-byte tags
......................................................................
utils: Fix bertlv_encode_tag() for multi-byte tags
We used to support only single-byte tags in bertlv_encode_tag,
let's fix that. The easy option is to simply call bertlv_parse_tag,
as that already supported multi-byte tags.
Change-Id: If0bd9137883c4c8b01c4dfcbb53cabeee5c1ce2b
---
M pySim/utils.py
1 file changed, 28 insertions(+), 8 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/utils.py b/pySim/utils.py
index 6cacdaa..7459a3f 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -262,15 +262,22 @@
remainder = inp & ~ (inp << (remain_bits - bitcnt))
return outp, remainder
+ def count_int_bytes(inp: int) -> int:
+ """count the number of bytes require to represent the given integer."""
+ i = 1
+ inp = inp >> 8
+ while inp:
+ i += 1
+ inp = inp >> 8
+ return i
+
if isinstance(t, int):
- # FIXME: multiple byte tags
- tag = t & 0x1f
- constructed = True if t & 0x20 else False
- cls = t >> 6
- else:
- tag = t['tag']
- constructed = t['constructed']
- cls = t['class']
+ # first convert to a dict representation
+ tag_size = count_int_bytes(t)
+ t, remainder = bertlv_parse_tag(t.to_bytes(tag_size, 'big'))
+ tag = t['tag']
+ constructed = t['constructed']
+ cls = t['class']
if tag <= 30:
t = tag & 0x1f
if constructed:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34851?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: If0bd9137883c4c8b01c4dfcbb53cabeee5c1ce2b
Gerrit-Change-Number: 34851
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>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34848?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-shell: Add 'switch_channel' command
......................................................................
pySim-shell: Add 'switch_channel' command
We've already had the 'open_channel' and 'close_channel' commands,
which were sent to (and acknowledged by) the card. However,
those commands didn't affect the pySim-shell state, i.e. all
communication would still happen through the default channel '0'.
With this patch we introduce a 'switch_channel' command, using which
the user can determine which of the (previously opened) logical channels
shall be used by pySim-shell.
Change-Id: Ia76eb45c4925882ae6866e50b64d9610bd4d546d
Closes: OS#6230
---
M docs/shell.rst
M pySim-shell.py
2 files changed, 37 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
dexter: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
diff --git a/docs/shell.rst b/docs/shell.rst
index dea0bb4..51fd49e 100644
--- a/docs/shell.rst
+++ b/docs/shell.rst
@@ -199,6 +199,12 @@
:module: pySim-shell
:func: Iso7816Commands.close_chan_parser
+switch_channel
+~~~~~~~~~~~~~~
+.. argparse::
+ :module: pySim-shell
+ :func: Iso7816Commands.switch_chan_parser
+
TS 102 221 commands
-------------------
diff --git a/pySim-shell.py b/pySim-shell.py
index 8a1ad01..2f97389 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -963,6 +963,18 @@
# this is executed only in successful case, as unsuccessful raises exception
self._cmd.rs.del_lchan(opts.chan_nr)
+ switch_chan_parser = argparse.ArgumentParser()
+ switch_chan_parser.add_argument(
+ 'chan_nr', type=int, default=0, help='Channel Number')
+
+ @cmd2.with_argparser(switch_chan_parser)
+ def do_switch_channel(self, opts):
+ """Switch currently active logical channel."""
+ self._cmd.lchan._select_pre(self._cmd)
+ self._cmd.lchan = self._cmd.rs.lchan[opts.chan_nr]
+ self._cmd.lchan._select_post(self._cmd)
+ self._cmd.update_prompt()
+
def do_status(self, opts):
"""Perform the STATUS command."""
fcp_dec = self._cmd.lchan.status()
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34848?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia76eb45c4925882ae6866e50b64d9610bd4d546d
Gerrit-Change-Number: 34848
Gerrit-PatchSet: 6
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-MessageType: merged
Attention is currently required from: dexter, osmith, pespin.
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/34648?usp=email )
Change subject: pcuif_proto: signal BTS model via PCUIF
......................................................................
Patch Set 7:
(1 comment)
File src/common/pcu_sock.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12085):
https://gerrit.osmocom.org/c/osmo-bts/+/34648/comment/d867ea3e_37c79262
PS7, Line 248: return PCU_IF_BTS_MODEL_TRX;
code indent should use tabs where possible
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34648?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib51238a0e09d4484a539a7f822864189872698b6
Gerrit-Change-Number: 34648
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 24 Oct 2023 15:23:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment