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

June 2024

  • 1 participants
  • 1566 discussions
[S] Change in pysim[master]: pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.c...
by fixeria 08 Jun '24

08 Jun '24
Attention is currently required from: laforge. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/37133?usp=email ) Change subject: pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.cat TLV ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37133?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: I5ecdbe0b5fa8856cb723569896b73cd49778ed5f Gerrit-Change-Number: 37133 Gerrit-PatchSet: 1 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: Sat, 08 Jun 2024 18:04:49 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: pySim.cat: More TLV Definitions for Event Download
by fixeria 08 Jun '24

08 Jun '24
Attention is currently required from: laforge. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/37132?usp=email ) Change subject: pySim.cat: More TLV Definitions for Event Download ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37132?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: I713f12577cab1678cdf97b7ae0e6f3815a42242c Gerrit-Change-Number: 37132 Gerrit-PatchSet: 1 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: Sat, 08 Jun 2024 18:04:02 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pySim.apdu: Allow TLV based decoders for APDU command and response body
by fixeria 08 Jun '24

08 Jun '24
Attention is currently required from: laforge. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/37131?usp=email ) Change subject: pySim.apdu: Allow TLV based decoders for APDU command and response body ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37131?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: Ibb80d328c9a1f464aa5338ca0ca1d6bfb00734e1 Gerrit-Change-Number: 37131 Gerrit-PatchSet: 1 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: Sat, 08 Jun 2024 17:59:39 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: pySim-trace: Add support for the TCA Loader log file format
by fixeria 08 Jun '24

08 Jun '24
Attention is currently required from: laforge. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/37130?usp=email ) Change subject: pySim-trace: Add support for the TCA Loader log file format ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37130?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: Ie76d36bb18c6bd8968d2a5b74ec1b8c5ccaaa409 Gerrit-Change-Number: 37130 Gerrit-PatchSet: 1 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: Sat, 08 Jun 2024 17:44:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: pySim.apdu: Allow TLV based decoders for APDU command and response body
by laforge 08 Jun '24

08 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37131?usp=email ) Change subject: pySim.apdu: Allow TLV based decoders for APDU command and response body ...................................................................... pySim.apdu: Allow TLV based decoders for APDU command and response body So far we only supported construct. Change-Id: Ibb80d328c9a1f464aa5338ca0ca1d6bfb00734e1 --- M pySim/apdu/__init__.py 1 file changed, 26 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/31/37131/1 diff --git a/pySim/apdu/__init__.py b/pySim/apdu/__init__.py index f5b7852..02ccbad 100644 --- a/pySim/apdu/__init__.py +++ b/pySim/apdu/__init__.py @@ -9,7 +9,7 @@ we already know in pySim about the filesystem structure, file encoding, etc. """ -# (C) 2022 by Harald Welte <laforge(a)osmocom.org> +# (C) 2022-2024 by Harald Welte <laforge(a)osmocom.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -152,6 +152,8 @@ _construct_p2 = Byte _construct = HexAdapter(GreedyBytes) _construct_rsp = HexAdapter(GreedyBytes) + _tlv = None + _tlv_rsp = None def __init__(self, cmd: BytesOrHex, rsp: Optional[BytesOrHex] = None): """Instantiate a new ApduCommand from give cmd + resp.""" @@ -299,7 +301,12 @@ r['p2'] = parse_construct(self._construct_p2, self.p2.to_bytes(1, 'big')) r['p3'] = self.p3 if self.cmd_data: - r['body'] = parse_construct(self._construct, self.cmd_data) + if self._tlv: + ie = self._tlv() + ie.from_tlv(self.cmd_data) + r['body'] = ie.to_dict() + else: + r['body'] = parse_construct(self._construct, self.cmd_data) return r def rsp_to_dict(self) -> Dict: @@ -310,7 +317,12 @@ else: r = {} if self.rsp_data: - r['body'] = parse_construct(self._construct_rsp, self.rsp_data) + if self._tlv_rsp: + ie = self._tlv_rsp() + ie.from_tlv(self.rsp_data) + r['body'] = ie.to_dict() + else: + r['body'] = parse_construct(self._construct_rsp, self.rsp_data) r['sw'] = b2h(self.sw) return r -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37131?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: Ibb80d328c9a1f464aa5338ca0ca1d6bfb00734e1 Gerrit-Change-Number: 37131 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim-trace: Add support for the TCA Loader log file format
by laforge 08 Jun '24

08 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37130?usp=email ) Change subject: pySim-trace: Add support for the TCA Loader log file format ...................................................................... pySim-trace: Add support for the TCA Loader log file format The "TCA Loader" is a freeware utility program published by the Trusted Connectivity Alliance for testing SCP80, SCP81, SCP02 and SCP03 in UICCs. It can generate text log files of the APDUs it exchanges; let's add this file format to pySim-trace Change-Id: Ie76d36bb18c6bd8968d2a5b74ec1b8c5ccaaa409 --- M pySim-trace.py A pySim/apdu_source/tca_loader_log.py 2 files changed, 70 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/30/37130/1 diff --git a/pySim-trace.py b/pySim-trace.py index 165e338..3257cb7 100755 --- a/pySim-trace.py +++ b/pySim-trace.py @@ -20,6 +20,7 @@ from pySim.apdu_source.gsmtap import GsmtapApduSource from pySim.apdu_source.pyshark_rspro import PysharkRsproPcap, PysharkRsproLive from pySim.apdu_source.pyshark_gsmtap import PysharkGsmtapPcap +from pySim.apdu_source.tca_loader_log import TcaLoaderLogApduSource from pySim.apdu.ts_102_221 import UiccSelect, UiccStatus @@ -181,6 +182,11 @@ parser_rspro_pyshark_live.add_argument('-i', '--interface', required=True, help='Name of the network interface to capture on') +parser_tcaloader_log = subparsers.add_parser('tca-loader-log', help=""" + Read APDUs from a TCA Loader log file.""") +parser_tcaloader_log.add_argument('-f', '--log-file', required=True, + help='Name of te log file to be read') + if __name__ == '__main__': opts = option_parser.parse_args() @@ -194,6 +200,8 @@ s = PysharkRsproLive(opts.interface) elif opts.source == 'gsmtap-pyshark-pcap': s = PysharkGsmtapPcap(opts.pcap_file) + elif opts.source == 'tca-loader-log': + s = TcaLoaderLogApduSource(opts.log_file) else: raise ValueError("unsupported source %s", opts.source) diff --git a/pySim/apdu_source/tca_loader_log.py b/pySim/apdu_source/tca_loader_log.py new file mode 100644 index 0000000..6efc605 --- /dev/null +++ b/pySim/apdu_source/tca_loader_log.py @@ -0,0 +1,48 @@ +# coding=utf-8 + +# (C) 2024 by Harald Welte <laforge(a)osmocom.org> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +from pySim.utils import h2b +from pySim.gsmtap import GsmtapSource + +from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands +from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands +from pySim.apdu.global_platform import ApduCommands as GpApduCommands + +from . import ApduSource, PacketType, CardReset + +ApduCommands = UiccApduCommands + UsimApduCommands + GpApduCommands + +class TcaLoaderLogApduSource(ApduSource): + """ApduSource for reading log files created by TCALoader.""" + def __init__(self, filename:str): + super().__init__() + self.logfile = open(filename, 'r') + + def read_packet(self) -> PacketType: + command = None + response = None + for line in self.logfile: + if line.startswith('Command'): + command = line.split()[1] + print("Command: '%s'" % command) + pass + elif command and line.startswith('Response'): + response = line.split()[1] + print("Response: '%s'" % response) + return ApduCommands.parse_cmd_bytes(h2b(command) + h2b(response)) + raise StopIteration -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37130?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: Ie76d36bb18c6bd8968d2a5b74ec1b8c5ccaaa409 Gerrit-Change-Number: 37130 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim.cat: More TLV Definitions for Event Download
by laforge 08 Jun '24

08 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37132?usp=email ) Change subject: pySim.cat: More TLV Definitions for Event Download ...................................................................... pySim.cat: More TLV Definitions for Event Download Change-Id: I713f12577cab1678cdf97b7ae0e6f3815a42242c --- M pySim/cat.py 1 file changed, 183 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/32/37132/1 diff --git a/pySim/cat.py b/pySim/cat.py index fdaf8f3..a14f4e2 100644 --- a/pySim/cat.py +++ b/pySim/cat.py @@ -717,19 +717,193 @@ nested=[DeviceIdentities, CBSPage]): pass +# TS 101 220 Table 7.17 +class MenuSelection(BER_TLV_IE, tag=0xD3, + nested=[DeviceIdentities, ItemIdentifier, HelpRequest]): + pass +class BcRepeatIndicator(BER_TLV_IE, tag=0x2A): + pass + +# TS 101 220 Table 7.17 +class CallControl(BER_TLV_IE, tag=0xD4, + nested=[DeviceIdentities, Address, CapabilityConfigParams, Subaddress, + LocationInformation, BcRepeatIndicator]): + pass + +# TS 101 220 Table 7.17 +class MoShortMessageControl(BER_TLV_IE, tag=0xD5): + pass + + +# TS 101 220 Table 7.23 +class TransactionIdentifier(BER_TLV_IE, tag=0x1C): + pass + +# TS 101 220 Table 7.23 +class ImsURI(BER_TLV_IE, tag=0x31): + pass + +# TS 101 220 Table 7.23 +class UriTruncated(BER_TLV_IE, tag=0x73): + pass + +# TS 101 220 Table 7.23 +class TrackingAreaIdentification(BER_TLV_IE, tag=0x7D): + pass + +# TS 101 220 Table 7.23 +class ExtendedRejectionCauseCode(BER_TLV_IE, tag=0x57): + pass + +# TS 101 220 Table 7.23 +class CsgCellSelectionStatus(BER_TLV_IE, tag=0x55): + pass + +# TS 101 220 Table 7.23 +class CsgId(BER_TLV_IE, tag=0x56): + pass + +# TS 101 220 Table 7.23 +class HnbName(BER_TLV_IE, tag=0x57): + pass + +# TS 101 220 Table 7.23 +class PlmnId(BER_TLV_IE, tag=0x09): + pass + +# TS 101 220 Table 7.23 +class ImsCallDisconnectionStatus(BER_TLV_IE, tag=0x55): + pass + +# TS 101 220 Table 7.23 +class Iari(BER_TLV_IE, tag=0x76): + pass + +# TS 101 220 Table 7.23 +class ImpuList(BER_TLV_IE, tag=0x77): + pass + +# TS 101 220 Table 7.23 +class ImsStatusCode(BER_TLV_IE, tag=0x77): + pass + +# TS 101 220 Table 7.23 +class DateTimeAndTimezone(BER_TLV_IE, tag=0x26): + pass + +# TS 101 220 Table 7.23 +class PdpPdnPduType(BER_TLV_IE, tag=0x0B): + pass + +# TS 101 220 Table 7.23 +class GadShape(BER_TLV_IE, tag=0x77): + pass + +# TS 101 220 Table 7.23 +class NmeaSentence(BER_TLV_IE, tag=0x78): + pass + +# TS 101 220 Table 7.23 +class WlanAccessStatus(BER_TLV_IE, tag=0x4B): + pass + +# TS 101 220 Table 7.17 +class EventDownload(BER_TLV_IE, tag=0xD6, + nested=[EventList, DeviceIdentities, + # 7.5.1.2 (I-)WLAN Access Status + WlanAccessStatus, + # 7.5.1A.2 MT Call + TransactionIdentifier, Address, + Subaddress, ImsURI, MediaType, UriTruncated, + # 7.5.2.2 Network Rejection + LocationInformation, RoutingAreaIdentification, TrackingAreaIdentification, + AccessTechnology, UpdateAttachRegistrationType, RejectionCauseCode, + ExtendedRejectionCauseCode, + # 7.5.2A.2 Call Connected + # TransactionIdentifier, MediaType + # 7.5.3.2 CSG Cell Selection + # AccessTechnology + CsgCellSelectionStatus, CsgId, HnbName, PlmnId, + # 7.5.3A.2 CAll Disconnected + # TransactionIdentifier, MediaType, + ImsCallDisconnectionStatus, + # TS 102 223 7.5.4 LocationStatusEvent + # TS 102 223 7.5.5 UserActivityEvent + # TS 102 223 7.5.6 IdleScreenAvailableEvent + # TS 102 223 7.5.7 CardReaderStatusEvent + # TS 102 223 7.5.8 LanguageSelectionEvent + # TS 102 223 7.5.9 BrowserTerminationEvent + # TS 102 223 7.5.10 DataAvailableEvent + # TS 102 223 7.5.11 ChannelStatusEvent + # TS 102 223 7.5.12 AccessTechnologyChangeEvent + # TS 102 223 7.5.13 DisplayParametersChangedEvent + # TS 102 223 7.5.14 LocalConnectionEvent + # TS 102 223 7.5.15 NetworkSearchModeChangeEvent + # TS 102 223 7.5.16 BrowsingStatusEvent + # TS 102 223 7.5.17 FramesInformationChangedEvent + # 7.5.20 Incoming IMS Data + Iari, + # 7.5.21 MS Registration Event + ImpuList, ImsStatusCode, + # 7.5.24 / TS 102 223 7.5.22 PollIntervalNegotiation + # 7.5.25 DataConnectionStatusChangeEvent + DataConnectionStatus, DataConnectionType, SmCause, + # TransactionIdentifier, LocationInformation, AccessTechnology + DateTimeAndTimezone, LocationStatus, NetworkAccessName, PdpPdnPduType, + # 7.7 / TS 102 223 7.6 MMS Transfer Status + # 7.8 / TS 102 223 MMS Notification Download + # 7.9 / TS 102 223 8.8 Terminal Applications + ]): + pass + +# TS 101 220 Table 7.17 +class TimerExpiration(BER_TLV_IE, tag=0xD7): + pass + +# TS 101 220 Table 7.17 + TS 31.111 7.6.2 class USSDDownload(BER_TLV_IE, tag=0xD9, nested=[DeviceIdentities, USSDString]): pass +# TS 101 220 Table 7.17 + TS 102 223 7.6 +class MmsTransferStatus(BER_TLV_IE, tag=0xDA): + pass +# TS 101 220 Table 7.17 + 102 223 +class MmsNotificationDownload(BER_TLV_IE, tag=0xDB): + pass +# TS 101 220 Table 7.17 + 102 223 7.8 +class TerminalApplication(BER_TLV_IE, tag=0xDC): + pass +# TS 101 220 Table 7.17 + TS 31.111 7.10.2 +class GeographicalLocation(BER_TLV_IE, tag=0xDD, + nested=[DeviceIdentities, GadShape, NmeaSentence]): + pass + +# TS 101 220 Table 7.17 +class EnvelopeContainer(BER_TLV_IE, tag=0xDE): + pass + +# TS 101 220 Table 7.17 +class ProSeReport(BER_TLV_IE, tag=0xDF): + pass + +# TS 101 220 Table 7.17 class ProactiveCmd(BER_TLV_IE): def _compute_tag(self) -> int: return 0xD0 +class EventCollection(TLV_IE_Collection, + nested=[SMSPPDownload, SMSCBDownload, + EventDownload, CallControl, MoShortMessageControl, + USSDDownload, GeographicalLocation, ProSeReport]): + pass + + # TS 101 220 Table 7.17 + 102 223 6.6.13/9.4 + TS 31.111 6.6.13 class Refresh(ProactiveCmd, tag=0x01, nested=[CommandDetails, DeviceIdentities, FileList, Aid, AlphaIdentifier, -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37132?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: I713f12577cab1678cdf97b7ae0e6f3815a42242c Gerrit-Change-Number: 37132 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.apdu.ts_102_221: Decode FETCH and TERMINAL RESPONSE body
by laforge 08 Jun '24

08 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37134?usp=email ) Change subject: pySim.apdu.ts_102_221: Decode FETCH and TERMINAL RESPONSE body ...................................................................... pySim.apdu.ts_102_221: Decode FETCH and TERMINAL RESPONSE body This gives a meaningful decode during pySim-trace. Change-Id: Ifa410e1fefc25e87ffa8e3a2230af80180a36a18 --- M pySim/apdu/ts_102_221.py M pySim/cat.py 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/34/37134/1 diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py index 5636da2..eaac868 100644 --- a/pySim/apdu/ts_102_221.py +++ b/pySim/apdu/ts_102_221.py @@ -464,10 +464,12 @@ # TS 102 221 Section 11.2.3 / TS 102 223 class Fetch(ApduCommand, n='FETCH', ins=0x12, cla=['80']): _apdu_case = 2 + _tlv_rsp = cat.ProactiveCommand # TS 102 221 Section 11.2.3 / TS 102 223 class TerminalResponse(ApduCommand, n='TERMINAL RESPONSE', ins=0x14, cla=['80']): _apdu_case = 3 + _tlv = cat.TerminalResponse # TS 102 221 Section 11.3.1 class RetrieveData(ApduCommand, n='RETRIEVE DATA', ins=0xCB, cla=['8X', 'CX', 'EX']): diff --git a/pySim/cat.py b/pySim/cat.py index a14f4e2..2a830c3 100644 --- a/pySim/cat.py +++ b/pySim/cat.py @@ -1196,6 +1196,13 @@ def to_bytes(self, context: dict = {}): return self.decoded.to_tlv() +# TS 101 223 Section 6.8.0 +class TerminalResponse(TLV_IE_Collection, + nested=[CommandDetails, DeviceIdentities, Result, + Duration, TextString, ItemIdentifier, + #TODO: LocalInformation and other optional/conditional IEs + ]): + pass # reasonable default for playing with OTA # 010203040506070809101112131415161718192021222324252627282930313233 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37134?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: Ifa410e1fefc25e87ffa8e3a2230af80180a36a18 Gerrit-Change-Number: 37134 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.c...
by laforge 08 Jun '24

08 Jun '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37133?usp=email ) Change subject: pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.cat TLV ...................................................................... pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.cat TLV This will decode the ENVELOPE body in pySim-trace further. Before: 00 ENVELOPE - 9000 {'p1': 0, 'p2': 0, 'cmd': 'd14682028381060291978b3c40048111227ff6407070611535002d02700000281516011212000001eae1bd578fa25791898128811b2206cc71639ca292ec2526da8aef4273d2fe2e', 'rsp': '027100001f0a00000100000001200000ab12800101230d08a0000001510000000f829000'} After: 00 ENVELOPE - 9000 {'p1': 0, 'p2': 0, 'cmd': [{'smspp_download': [{'device_identities': {'source_dev_id': 'network', 'dest_dev_id': 'uicc'}}, {'address': {'ton_npi': 145, 'call_number': '79'}}, {'sms_tpdu': {'tpdu': '40048111227ff6407070611535002d02700000281516011212000001eae1bd578fa25791898128811b2206cc71639ca292ec2526da8aef4273d2fe2e'}}]}], 'rsp': '027100001f0a00000100000001200000ab12800101230d08a0000001510000000f829000'} Change-Id: I5ecdbe0b5fa8856cb723569896b73cd49778ed5f --- M pySim/apdu/ts_102_221.py 1 file changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/37133/1 diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py index 52d88d2..5636da2 100644 --- a/pySim/apdu/ts_102_221.py +++ b/pySim/apdu/ts_102_221.py @@ -1,7 +1,7 @@ # coding=utf-8 """APDU definitions/decoders of ETSI TS 102 221, the core UICC spec. -(C) 2022 by Harald Welte <laforge(a)osmocom.org> +(C) 2022-2024 by Harald Welte <laforge(a)osmocom.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ from pySim.runtime import RuntimeLchan from pySim.apdu import ApduCommand, ApduCommandSet from pySim.utils import i2h +from pySim import cat logger = logging.getLogger(__name__) @@ -458,6 +459,7 @@ # TS 102 221 Section 11.2.2 / TS 102 223 class Envelope(ApduCommand, n='ENVELOPE', ins=0xC2, cla=['80']): _apdu_case = 4 + _tlv = cat.EventCollection # TS 102 221 Section 11.2.3 / TS 102 223 class Fetch(ApduCommand, n='FETCH', ins=0x12, cla=['80']): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37133?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: I5ecdbe0b5fa8856cb723569896b73cd49778ed5f Gerrit-Change-Number: 37133 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: add support for RTP extensions via TW-TS-003
by falconia 08 Jun '24

08 Jun '24
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/37129?usp=email ) Change subject: add support for RTP extensions via TW-TS-003 ...................................................................... add support for RTP extensions via TW-TS-003 Themyscira Wireless Technical Specification TW-TS-003 defines a mechanism whereby the CN can ask the BSS (via an extension to BSSMAP Assignment procedure) to use enhanced RTP payload formats that are contrary to the stipulations of 3GPP TS 48.103. However, these RTP extensions need to originate at the BTS, hence if the BSC receives a request from the CN to use them, it needs to validate that request against BTS capabilities, and then actually pass it to the BTS via an Osmocom-defined RSL IE that replicates TW-TS-003 in Abis. Implement this logic. Intra-BSC handovers: if ThemWi RTP extensions are used in a GSM network that allows handovers, all deployed BTSes must have the same capabilities with regard to these extensions, practically meaning same or close-enough version of OsmoBTS. OsmoBSC checks CN-requested RTP extensions against BTS capabilities on the initial assignment, but not on subsequent handovers. Inter-BSC handovers: support for RTP extensions in this deployment configuration (networks that allow such handovers) remains to be implemented. OsmoMGW considerations: if all deployed BTSes are native IP OsmoBTS, as opposed to E1-based, OsmoMGW does not need to know anything at all about ThemWi RTP extensions. However, future support for these RTP extensions with E1-based BTSes will require adding a mechanism for communicating the necessary non-standard request to OsmoMGW. LCLS considerations: enabling ThemWi RTP extensions affects only the uplink RTP output path in OsmoBTS and not the path from RTP input to downlink Tx. The latter path accepts both basic and extended RTP formats; any ThemWi extensions in the incoming RTP stream are harmlessly ignored. Therefore, activation of ThemWi RTP extensions will have no impact on LCLS operation. Related: OS#6448 Depends: I0eccfe5ddcf44f8f20440acb01e2d4870ec0cd91 (libosmocore) Change-Id: I2a742afff160a9a8286633bf5ae0dd4a828c7a42 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/osmo_bsc_bssap.c 4 files changed, 120 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/29/37129/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index bd51a42..6bffcc4 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -150,6 +150,7 @@ uint16_t msc_rtp_port; bool use_osmux; uint8_t osmux_cid; + uint8_t rtp_extensions; /* Rate/codec setting in preference order (need at least 1 !) */ int n_ch_mode_rate; @@ -359,6 +360,7 @@ /* RTP address where the MSC expects us to send the RTP stream coming from the BTS. */ char msc_assigned_rtp_addr[INET6_ADDRSTRLEN]; uint16_t msc_assigned_rtp_port; + uint8_t rtp_extensions; /* The endpoint at the MGW used to join both BTS and MSC side connections, e.g. * "rtpbridge/23@mgw". */ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 49e8b52..9d922d0 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -3033,6 +3033,11 @@ if (lchan->abis_ip.osmux.use) msgb_tlv_put(msg, RSL_IE_OSMO_OSMUX_CID, 1, &lchan->abis_ip.osmux.local_cid); + /* Are we serving a GSM subscriber for whom the CN requested + * the use of RTP extensions? */ + if (lchan->conn && lchan->conn->user_plane.rtp_extensions) + msgb_tlv_put(msg, RSL_IE_OSMO_RTP_EXTENSIONS, 1, + &lchan->conn->user_plane.rtp_extensions); msg->dst = rsl_chan_link(lchan); @@ -3077,6 +3082,9 @@ msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD2, lchan->abis_ip.rtp_payload2); if (lchan->abis_ip.osmux.use) msgb_tlv_put(msg, RSL_IE_OSMO_OSMUX_CID, 1, &lchan->abis_ip.osmux.local_cid); + if (lchan->conn && lchan->conn->user_plane.rtp_extensions) + msgb_tlv_put(msg, RSL_IE_OSMO_RTP_EXTENSIONS, 1, + &lchan->conn->user_plane.rtp_extensions); msg->dst = rsl_chan_link(lchan); diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 5e98a28..79c4ac7 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -22,6 +22,8 @@ #include <osmocom/core/tdef.h> #include <osmocom/gsm/gsm0808.h> +#include <osmocom/gsm/rtp_extensions.h> +#include <osmocom/gsm/bts_features.h> #include <osmocom/mgcp_client/mgcp_client_endpoint_fsm.h> @@ -172,6 +174,13 @@ msg->l3h[1] = msgb_l3len(msg) - 2; } +static void bssap_extend_twts003(struct msgb *msg, uint8_t accepted_ext) +{ + OSMO_ASSERT(msg->l3h[1] == msgb_l3len(msg) - 2); /*TL not in len */ + msgb_tlv_put(msg, GSM0808_IE_THEMWI_RTP_EXTENSIONS, 1, &accepted_ext); + msg->l3h[1] = msgb_l3len(msg) - 2; +} + static void send_assignment_complete(struct gsm_subscriber_connection *conn) { int rc; @@ -267,6 +276,9 @@ conn->assignment.req.use_osmux) bssap_extend_osmux(resp, osmux_cid); + if (conn->user_plane.rtp_extensions) + bssap_extend_twts003(resp, conn->user_plane.rtp_extensions); + rate_ctr_inc(rate_ctr_group_get_ctr(conn->sccp.msc->msc_ctrs, MSC_CTR_BSSMAP_TX_DT1_ASSIGNMENT_COMPLETE)); rc = gscon_sigtran_send(conn, resp); if (rc) { @@ -478,6 +490,7 @@ .aoip = gscon_is_aoip(conn), .msc_assigned_cic = conn->user_plane.msc_assigned_cic, .msc_rtp_port = conn->user_plane.msc_assigned_rtp_port, + .rtp_extensions = conn->user_plane.rtp_extensions, .n_ch_mode_rate = 1, .ch_mode_rate_list = { lchan->current_ch_mode_rate }, .target_lchan = to_lchan, @@ -522,6 +535,31 @@ return _reassignment_request(assign_for, lchan, NULL, new_lchan_type, -1, -1); } +/* + * The CN may have requested RTP extensions (payload format modifications + * contrary to the stipulations of TS 48.103) via BSSMAP IE of TW-TS-003. + * This function checks whether or not we can fulfill that request + * based on BTS capabilities, and sets the bitmask of accepted extensions + * that will be passed on to the BTS via Abis RSL. + */ +static void handle_rtp_extensions(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + const struct assignment_request *req = &conn->assignment.req; + uint8_t requested_ext = req->rtp_extensions; + uint8_t accepted_ext = 0; + + if ((requested_ext & OSMO_RTP_EXT_TWTS001) && + osmo_bts_has_feature(&bts->features, BTS_FEAT_TWTS001)) + accepted_ext |= OSMO_RTP_EXT_TWTS001; + + if ((requested_ext & OSMO_RTP_EXT_TWTS002) && + osmo_bts_has_feature(&bts->features, BTS_FEAT_TWTS002)) + accepted_ext |= OSMO_RTP_EXT_TWTS002; + + conn->user_plane.rtp_extensions = accepted_ext; +} + void assignment_fsm_start(struct gsm_subscriber_connection *conn, struct gsm_bts *bts, struct assignment_request *req) { @@ -553,6 +591,8 @@ return; conn->assignment.ch_indctr = req->ch_indctr; + handle_rtp_extensions(conn, bts); + if (!req->target_lchan && reuse_existing_lchan(conn)) { /* The already existing lchan is suitable for this mode */ conn->assignment.new_lchan = NULL; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 2a98054..c9e8e5e 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -992,6 +992,26 @@ return 0; } +static int bssmap_handle_ass_req_tp_rtp_ext(struct tlv_parsed *tp, + struct assignment_request *req, + uint8_t *cause) +{ + /* If the special TW-TS-003 BSSMAP IE is not included, + * we are in standard 3GPP-compliant operation mode - + * no more work is needed here. */ + if (!TLVP_PRESENT(tp, GSM0808_IE_THEMWI_RTP_EXTENSIONS)) + return 0; + + /* the format is TLV with one required byte of value */ + if (TLVP_LEN(tp, GSM0808_IE_THEMWI_RTP_EXTENSIONS) < 1) { + *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; + return -1; + } + + req->rtp_extensions = *TLVP_VAL(tp, GSM0808_IE_THEMWI_RTP_EXTENSIONS); + return 0; +} + static int bssmap_handle_ass_req_ct_data(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, struct gsm0808_channel_type *ct, struct assignment_request *req, uint8_t *cause) @@ -1056,6 +1076,10 @@ return -1; } + /* optional RTP extensions per TW-TS-003 */ + if (bssmap_handle_ass_req_tp_rtp_ext(tp, req, cause) < 0) + return -1; + return 0; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/37129?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I2a742afff160a9a8286633bf5ae0dd4a828c7a42 Gerrit-Change-Number: 37129 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.