osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/31059 )
Change subject: mgcp_client: add new clearmode codec
......................................................................
mgcp_client: add new clearmode codec
According to RFC 4040, the payload type is dynamically assigned. Choose
97, the next free one in the 96-127 range for dynamically assigned
payload types. It's also the one used in the example in RFC 4040
section 5.
Related: OS#4395
Related: https://www.rfc-editor.org/rfc/rfc4040#section-5
Change-Id: I55f9fe241a405935dbedc3947b0a4f4986acd5cb
---
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
2 files changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/59/31059/1
diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h
index b40923d..df4ed9d 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -50,6 +50,7 @@
CODEC_AMR_8000_1 = 112,
CODEC_AMRWB_16000_1 = 113,
CODEC_IUFP = 96,
+ CODEC_CLEARMODE = 97,
};
/* Note: when new codec types are added, the corresponding value strings
* in mgcp_client.c (codec_table) must be updated as well. Enumerations
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 6f1ab6b..c3ecc9f 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -60,6 +60,7 @@
{ CODEC_AMR_8000_1, "AMR/8000/1" },
{ CODEC_AMRWB_16000_1, "AMR-WB/16000/1" },
{ CODEC_IUFP, "VND.3GPP.IUFP/16000" },
+ { CODEC_CLEARMODE, "CLEARMODE/8000" },
{ 0, NULL },
};
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/31059
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I55f9fe241a405935dbedc3947b0a4f4986acd5cb
Gerrit-Change-Number: 31059
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/31057
to look at the new patch set (#2).
Change subject: gsm_r: Fix byte/nibble ordering of predefined_value1
......................................................................
gsm_r: Fix byte/nibble ordering of predefined_value1
Change-Id: Ia0dd8994556548a17a0a3101225c23e804511717
Related: OS#5784
---
M pySim/gsm_r.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/57/31057/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/31057
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia0dd8994556548a17a0a3101225c23e804511717
Gerrit-Change-Number: 31057
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/31056 )
Change subject: gsm_r: EF_Predefined: Decode first record different from others
......................................................................
gsm_r: EF_Predefined: Decode first record different from others
In their infinite wisdom, the authors of the EIRENE FFFIS for GSM-R SIM
cards invented yet a new way of encoding data in SIM card files: The
first record of a file may be encoded differently than further records
of files.
This patch implements the feature based on the newly-introduced way by
which we pass the record number to the encoder and decoder methods.
Change-Id: Ib526f6c3c2ac9a945b8242e2e54536628376efc0
Related: OS#5784
---
M pySim/gsm_r.py
1 file changed, 18 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/56/31056/1
diff --git a/pySim/gsm_r.py b/pySim/gsm_r.py
index 5ddb04b..68e0aa8 100644
--- a/pySim/gsm_r.py
+++ b/pySim/gsm_r.py
@@ -237,17 +237,29 @@
class EF_Predefined(LinFixedEF):
"""Section 8.5"""
+ # header and other records have different structure. WTF !?!
+ construct_first = Struct('next_table_type'/NextTableType,
+ 'id_of_next_table'/HexAdapter(Bytes(2)))
+ construct_others = Struct('predefined_value1'/HexAdapter(Bytes(2)),
+ 'string_table_index1'/Int8ub)
def __init__(self, fid, name, desc):
super().__init__(fid=fid, sfid=None,
name=name, desc=desc, rec_len=(3, 3))
- # header and other records have different structure. WTF !?!
- self._construct = Struct('next_table_type'/NextTableType,
- 'id_of_next_table'/HexAdapter(Bytes(2)),
- 'predefined_value1'/HexAdapter(Bytes(2)),
- 'string_table_index1'/Int8ub)
- # TODO: predefined value n, ...
+ def _decode_record_bin(self, raw_bin_data : bytes, record_nr : int) -> dict:
+ if record_nr == 1:
+ return parse_construct(EF_Predefined.construct_first, raw_bin_data)
+ else:
+ return parse_construct(EF_Predefined.construct_others, raw_bin_data)
+
+ def _encode_record_bin(self, abstract_data : dict, record_nr : int) -> bytearray:
+ r = None
+ if record_nr == 1:
+ r = EF_Predefined.construct_first.build(abstract_data)
+ else:
+ r = EF_Predefined.construct_others.build(abstract_data)
+ return filter_dict(r)
class EF_DialledVals(TransparentEF):
"""Section 8.6"""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/31056
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib526f6c3c2ac9a945b8242e2e54536628376efc0
Gerrit-Change-Number: 31056
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/31055 )
Change subject: Prepare for decoding/encoding records differently based on record number
......................................................................
Prepare for decoding/encoding records differently based on record number
In their infinite wisdom, the authors of the EIRENE FFFIS for GSM-R SIM
cards invented yet a new way of encoding data in SIM card files: The
first record of a file may be encoded differently than further records
of files.
Let's add the required infrastructure to pySim so that the encode and
decode methods for record-oriented files get passed in the current
record number.
Change-Id: I02d6942016dd0631b21d1fd301711c13cb27962b
Related: OS#5784
---
M pySim/apdu/ts_102_221.py
M pySim/filesystem.py
2 files changed, 20 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/55/31055/1
diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py
index ea45602..cd246b1 100644
--- a/pySim/apdu/ts_102_221.py
+++ b/pySim/apdu/ts_102_221.py
@@ -201,7 +201,7 @@
return b2h(self.rsp_data)
method = getattr(self.file, 'decode_record_bin', None)
if self.successful and callable(method):
- return method(self.rsp_data)
+ return method(self.rsp_data, self.cmd_dict['record_number'])
# TS 102 221 Section 11.1.6
class UpdateRecord(ApduCommand, n='UPDATE RECORD', ins=0xDC, cla=['0X', '4X', '6X']):
@@ -217,7 +217,7 @@
return b2h(self.cmd_data)
method = getattr(self.file, 'decode_record_bin', None)
if self.successful and callable(method):
- return method(self.cmd_data)
+ return method(self.cmd_data, self.cmd_dict['record_number'])
# TS 102 221 Section 11.1.7
class SearchRecord(ApduCommand, n='SEARCH RECORD', ins=0xA2, cla=['0X', '4X', '6X']):
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index a3d1122..6dd1db7 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -945,7 +945,7 @@
self._construct = None
self._tlv = None
- def decode_record_hex(self, raw_hex_data: str) -> dict:
+ def decode_record_hex(self, raw_hex_data: str, record_nr: int) -> dict:
"""Decode raw (hex string) data into abstract representation.
A derived class would typically provide a _decode_record_bin() or _decode_record_hex()
@@ -954,16 +954,17 @@
Args:
raw_hex_data : hex-encoded data
+ record_nr : record number (1 for first record, ...)
Returns:
abstract_data; dict representing the decoded data
"""
method = getattr(self, '_decode_record_hex', None)
if callable(method):
- return method(raw_hex_data)
+ return method(raw_hex_data, record_nr=record_nr)
raw_bin_data = h2b(raw_hex_data)
method = getattr(self, '_decode_record_bin', None)
if callable(method):
- return method(raw_bin_data)
+ return method(raw_bin_data, record_nr=record_nr)
if self._construct:
return parse_construct(self._construct, raw_bin_data)
elif self._tlv:
@@ -972,7 +973,7 @@
return t.to_dict()
return {'raw': raw_bin_data.hex()}
- def decode_record_bin(self, raw_bin_data: bytearray) -> dict:
+ def decode_record_bin(self, raw_bin_data: bytearray, record_nr: int) -> dict:
"""Decode raw (binary) data into abstract representation.
A derived class would typically provide a _decode_record_bin() or _decode_record_hex()
@@ -981,16 +982,17 @@
Args:
raw_bin_data : binary encoded data
+ record_nr : record number (1 for first record, ...)
Returns:
abstract_data; dict representing the decoded data
"""
method = getattr(self, '_decode_record_bin', None)
if callable(method):
- return method(raw_bin_data)
+ return method(raw_bin_data, record_nr=record_nr)
raw_hex_data = b2h(raw_bin_data)
method = getattr(self, '_decode_record_hex', None)
if callable(method):
- return method(raw_hex_data)
+ return method(raw_hex_data, record_nr=record_nr)
if self._construct:
return parse_construct(self._construct, raw_bin_data)
elif self._tlv:
@@ -999,7 +1001,7 @@
return t.to_dict()
return {'raw': raw_hex_data}
- def encode_record_hex(self, abstract_data: dict) -> str:
+ def encode_record_hex(self, abstract_data: dict, record_nr: int) -> str:
"""Encode abstract representation into raw (hex string) data.
A derived class would typically provide an _encode_record_bin() or _encode_record_hex()
@@ -1008,15 +1010,16 @@
Args:
abstract_data : dict representing the decoded data
+ record_nr : record number (1 for first record, ...)
Returns:
hex string encoded data
"""
method = getattr(self, '_encode_record_hex', None)
if callable(method):
- return method(abstract_data)
+ return method(abstract_data, record_nr=record_nr)
method = getattr(self, '_encode_record_bin', None)
if callable(method):
- raw_bin_data = method(abstract_data)
+ raw_bin_data = method(abstract_data, record_nr=record_nr)
return b2h(raw_bin_data)
if self._construct:
return b2h(self._construct.build(abstract_data))
@@ -1027,7 +1030,7 @@
raise NotImplementedError(
"%s encoder not yet implemented. Patches welcome." % self)
- def encode_record_bin(self, abstract_data: dict) -> bytearray:
+ def encode_record_bin(self, abstract_data: dict, record_nr : int) -> bytearray:
"""Encode abstract representation into raw (binary) data.
A derived class would typically provide an _encode_record_bin() or _encode_record_hex()
@@ -1036,15 +1039,16 @@
Args:
abstract_data : dict representing the decoded data
+ record_nr : record number (1 for first record, ...)
Returns:
binary encoded data
"""
method = getattr(self, '_encode_record_bin', None)
if callable(method):
- return method(abstract_data)
+ return method(abstract_data, record_nr=record_nr)
method = getattr(self, '_encode_record_hex', None)
if callable(method):
- return h2b(method(abstract_data))
+ return h2b(method(abstract_data, record_nr=record_nr))
if self._construct:
return self._construct.build(abstract_data)
elif self._tlv:
@@ -1681,7 +1685,7 @@
abstract data contained in record
"""
(data, sw) = self.read_record(rec_nr)
- return (self.selected_file.decode_record_hex(data), sw)
+ return (self.selected_file.decode_record_hex(data, rec_nr), sw)
def update_record(self, rec_nr: int, data_hex: str):
"""Update a record with given binary data
@@ -1702,7 +1706,7 @@
rec_nr : Record number to read
data_hex : Abstract data to be written
"""
- data_hex = self.selected_file.encode_record_hex(data)
+ data_hex = self.selected_file.encode_record_hex(data, rec_nr)
return self.update_record(rec_nr, data_hex)
def retrieve_data(self, tag: int = 0):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/31055
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I02d6942016dd0631b21d1fd301711c13cb27962b
Gerrit-Change-Number: 31055
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/31057 )
Change subject: gsm_r: Fix byte ordering of predefined_value1
......................................................................
gsm_r: Fix byte ordering of predefined_value1
In GSM-R, a number of files such as EF.FC, EF.Service, etc. are
defined to have reverse byte ordering for their first two bytes
in all but the first record. Let's implement this using a
new ReverseOrderAdapter() class for construct.
Change-Id: Ia0dd8994556548a17a0a3101225c23e804511717
Related: OS#5784
---
M pySim/construct.py
M pySim/gsm_r.py
2 files changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/57/31057/1
diff --git a/pySim/construct.py b/pySim/construct.py
index 97af235..5db6724 100644
--- a/pySim/construct.py
+++ b/pySim/construct.py
@@ -64,6 +64,14 @@
def _encode(self, obj, context, path):
return self._invert_bool_in_obj(obj)
+class ReverseOrderAdapter(Adapter):
+
+ def _decode(self, obj, context, path):
+ return reversed(obj)
+
+ def _encode(self, obj, context, path):
+ return reversed(obj)
+
class Rpad(Adapter):
"""
Encoder appends padding bytes (b'\\xff') up to target size.
diff --git a/pySim/gsm_r.py b/pySim/gsm_r.py
index 68e0aa8..74bdf20 100644
--- a/pySim/gsm_r.py
+++ b/pySim/gsm_r.py
@@ -240,7 +240,7 @@
# header and other records have different structure. WTF !?!
construct_first = Struct('next_table_type'/NextTableType,
'id_of_next_table'/HexAdapter(Bytes(2)))
- construct_others = Struct('predefined_value1'/HexAdapter(Bytes(2)),
+ construct_others = Struct('predefined_value1'/HexAdapter(ReverseOrderAdapter(Bytes(2))),
'string_table_index1'/Int8ub)
def __init__(self, fid, name, desc):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/31057
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia0dd8994556548a17a0a3101225c23e804511717
Gerrit-Change-Number: 31057
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/31053 )
Change subject: jobs/master,gerrit: add docker_run_ccache
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> what do we win with this? All I see is having to maintain 2 differnet sets of commands now.
This is needed, because not all jobs can use ccache. For example pysim running on the simtester node:
* this was not provisioned with ansible, hence there is no osmocom-build user
* there is not enough space to use ccache there anyway
So pysim now still uses {docker_run}, but doesn't have the ccache arguments.
See also the following patch.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/31053
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ib6d7f309b972979d3a3bc87f8fcf71f9e930c0da
Gerrit-Change-Number: 31053
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 24 Jan 2023 14:51:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ci/+/31054
to look at the new patch set (#3).
Change subject: jobs/master,gerrit: fix pysim, sysmo-usim-tool
......................................................................
jobs/master,gerrit: fix pysim, sysmo-usim-tool
Don't attempt to create the CCACHE_DIR and chown it to osmocom-build for
the simtester jenkins node, and more generally all that were not
created with the ansible provisioning scripts. In case of simtester,
there is no osmocom-build user and we don't have the space there to use
ccache.
Fix for:
chown: invalid user: ‘osmocom-build:osmocom-build’
Related: OS#5848
Change-Id: I339d9ba4ad0c959d7325820eb53bfa1f0e04c164
---
M jobs/gerrit-verifications.yml
M jobs/master-builds.yml
2 files changed, 10 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/54/31054/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/31054
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I339d9ba4ad0c959d7325820eb53bfa1f0e04c164
Gerrit-Change-Number: 31054
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset