laforge submitted this change.

View Change


Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified
pySim.ts_31_103: update to spec v18.1.0 Release 18

This adds two new EFs and one new IST service.

Change-Id: Iced1700046b459399a3e8305e1387ec65eeb3536
---
M pySim/ts_31_103.py
M pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py
index 81de13c..2a71449 100644
--- a/pySim/ts_31_103.py
+++ b/pySim/ts_31_103.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-

"""
-Various constants from 3GPP TS 31.103 V16.1.0
+Various constants from 3GPP TS 31.103 V18.1.0
"""

#
# Copyright (C) 2020 Supreeth Herle <herlesupreeth@gmail.com>
-# Copyright (C) 2021 Harald Welte <laforge@osmocom.org>
+# Copyright (C) 2021-2024 Harald Welte <laforge@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
@@ -56,6 +56,7 @@
19: 'XCAP Configuration Data',
20: 'WebRTC URI',
21: 'MuD and MiD configuration data',
+ 22: 'IMS Data Channel indication',
}

# TS 31.103 Section 4.2.2
@@ -279,6 +280,29 @@
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
self._tlv = EF_MuDMiDConfigData.MudMidConfigDataCollection

+# TS 31.103 Section 4.2.22
+class EF_AC_GBAUAPI(LinFixedEF):
+ """The use of this EF is eescribed in 3GPP TS 31.130"""
+ class AppletNafAccessControl(BER_TLV_IE, tag=0x80):
+ # the use of Int8ub as length field in Prefixed is strictly speaking incorrect, as it is a BER-TLV
+ # length field whihc will consume two bytes from length > 127 bytes. However, AIDs and NAF IDs can
+ # safely be assumed shorter than that
+ _construct = Struct('aid'/Prefixed(Int8ub, GreedyBytes),
+ 'naf_id'/Prefixed(Int8ub, GreedyBytes))
+ def __init__(self, fid='6f0a', sfid=None, name='EF.GBAUAPI',
+ desc='Access Control to GBA_U_API', **kwargs):
+ super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
+ self._tlv = EF_AC_GBAUAPI.AppletNafAccessControl
+
+# TS 31.103 Section 4.2.23
+class EF_IMSDCI(TransparentEF):
+ """See Management object as defined in 3GPP TS 24.275."""
+ def __init__(self, fid='6f0b', sfid=None, name='EF.IMSDCI', desc='IMS Data Channel Indication', **kwargs):
+ super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
+ self._construct = Enum(Byte, ims_dc_not_allowed=0x00,
+ ims_dc_allowed_after_ims_session=0x01,
+ ims_dc_allowed_simultaneous_ims_session=0x02)
+

class ADF_ISIM(CardADF):
def __init__(self, aid='a0000000871004', has_fs=True, name='ADF.ISIM', fid=None, sfid=None,
@@ -306,6 +330,8 @@
EF_XCAPConfigData(service=19),
EF_WebRTCURI(service=20),
EF_MuDMiDConfigData(service=21),
+ EF_AC_GBAUAPI(service=2),
+ EF_IMSDCI(service=22),
]
self.add_files(files)
# add those commands to the general commands of a TransparentEF
diff --git a/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok b/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
index b947983..9c17b69 100644
--- a/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
+++ b/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
@@ -347,7 +347,7 @@
===============================
01 READ RECORD MF/ADF.ISIM/EF.P-CSCF 01 9000 {'pcscf_address': None}
===============================
-01 READ BINARY MF/ADF.ISIM/EF.IST - 9000 {1: {'activated': True, 'description': 'P-CSCF address'}, 2: {'activated': False, 'description': 'Generic Bootstrapping Architecture (GBA)'}, 3: {'activated': False, 'description': 'HTTP Digest'}, 4: {'activated': True, 'description': 'GBA-based Local Key Establishment Mechanism'}, 5: {'activated': True, 'description': 'Support of P-CSCF discovery for IMS Local Break Out'}, 6: {'activated': False, 'description': 'Short Message Storage (SMS)'}, 7: {'activated': False, 'description': 'Short Message Status Reports (SMSR)'}, 8: {'activated': False, 'description': 'Support for SM-over-IP including data download via SMS-PP as defined in TS 31.111 [31]'}, 9: {'activated': False, 'description': 'Communication Control for IMS by ISIM'}, 10: {'activated': True, 'description': 'Support of UICC access to IMS'}, 11: {'activated': False, 'description': 'URI support by UICC'}, 12: {'activated': False, 'description': 'Media Type support'}, 13: {'activated': False, 'description': 'IMS call disconnection cause'}, 14: {'activated': False, 'description': 'URI support for MO SHORT MESSAGE CONTROL'}, 15: {'activated': False, 'description': 'MCPTT'}, 16: {'activated': False, 'description': 'URI support for SMS-PP DOWNLOAD as defined in 3GPP TS 31.111 [31]'}, 17: {'activated': False, 'description': 'From Preferred'}, 18: {'activated': False, 'description': 'IMS configuration data'}, 19: {'activated': False, 'description': 'XCAP Configuration Data'}, 20: {'activated': False, 'description': 'WebRTC URI'}, 21: {'activated': False, 'description': 'MuD and MiD configuration data'}, 22: {'activated': False}, 23: {'activated': False}, 24: {'activated': False}}
+01 READ BINARY MF/ADF.ISIM/EF.IST - 9000 {1: {'activated': True, 'description': 'P-CSCF address'}, 2: {'activated': False, 'description': 'Generic Bootstrapping Architecture (GBA)'}, 3: {'activated': False, 'description': 'HTTP Digest'}, 4: {'activated': True, 'description': 'GBA-based Local Key Establishment Mechanism'}, 5: {'activated': True, 'description': 'Support of P-CSCF discovery for IMS Local Break Out'}, 6: {'activated': False, 'description': 'Short Message Storage (SMS)'}, 7: {'activated': False, 'description': 'Short Message Status Reports (SMSR)'}, 8: {'activated': False, 'description': 'Support for SM-over-IP including data download via SMS-PP as defined in TS 31.111 [31]'}, 9: {'activated': False, 'description': 'Communication Control for IMS by ISIM'}, 10: {'activated': True, 'description': 'Support of UICC access to IMS'}, 11: {'activated': False, 'description': 'URI support by UICC'}, 12: {'activated': False, 'description': 'Media Type support'}, 13: {'activated': False, 'description': 'IMS call disconnection cause'}, 14: {'activated': False, 'description': 'URI support for MO SHORT MESSAGE CONTROL'}, 15: {'activated': False, 'description': 'MCPTT'}, 16: {'activated': False, 'description': 'URI support for SMS-PP DOWNLOAD as defined in 3GPP TS 31.111 [31]'}, 17: {'activated': False, 'description': 'From Preferred'}, 18: {'activated': False, 'description': 'IMS configuration data'}, 19: {'activated': False, 'description': 'XCAP Configuration Data'}, 20: {'activated': False, 'description': 'WebRTC URI'}, 21: {'activated': False, 'description': 'MuD and MiD configuration data'}, 22: {'activated': False, 'description': 'IMS Data Channel indication'}, 23: {'activated': False}, 24: {'activated': False}}
===============================
01 READ BINARY MF/ADF.ISIM/EF.GBABP - 9000 None
===============================

To view, visit change 37523. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iced1700046b459399a3e8305e1387ec65eeb3536
Gerrit-Change-Number: 37523
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-MessageType: merged