lists.osmocom.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
Download
gerrit-log
July 2022
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
gerrit-log@lists.osmocom.org
3 participants
2175 discussions
Start a n
N
ew thread
Change in pysim[master]: ts_31_102: Add support for obsolete EF.RPLMNAcT
by laforge
laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28636
) Change subject: ts_31_102: Add support for obsolete EF.RPLMNAcT ...................................................................... ts_31_102: Add support for obsolete EF.RPLMNAcT This file existed in earlier specs like Release 3.8.0, but was removed in later revisions. Still, there are cards around implementing that older spec, so let's add a decoder. Change-Id: Ic7163b2a01f64ef1223cf15b8d0813d3edf5b61a --- M pySim/ts_31_102.py 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/36/28636/1 diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index a4f3532..5ebdb3f 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -743,6 +743,15 @@ super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, **kwargs) self._construct = Struct('max_start'/Int24ub) +# TS 31.102 (old releases like 3.8.0) Section 4.2.56 +class EF_RPLMNAcT(TransRecEF): + def __init__(self, fid='6f65', sfid=None, name='EF.RPLMNAcTD', size={2, 4}, rec_len=2, + desc='RPLMN Last used Access Technology', **kwargs): + super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len, **kwargs) + def _decode_record_hex(self, in_hex): + return dec_act(in_hex) + # TODO: Encode + # TS 31.102 Section 4.2.77 class EF_VGCSCA(TransRecEF): def __init__(self, fid='6fd4', sfid=None, name='EF.VGCSCA', size={2, 100}, rec_len=2, @@ -1165,6 +1174,7 @@ EF_xPLMNwAcT('6f61', 0x11, 'EF.OPLMNwAcT', 'User controlled PLMN Selector with Access Technology', service=42), EF_xPLMNwAcT('6f62', 0x13, 'EF.HPLMNwAcT', 'HPLMN Selector with Access Technology', service=43), EF_ARR('6f06', 0x17), + EF_RPLMNAcT(), TransparentEF('6fc4', None, 'EF.NETPAR', 'Network Parameters'), EF_PNN('6fc5', 0x19, service=45), EF_OPL(service=46), -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28636
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ic7163b2a01f64ef1223cf15b8d0813d3edf5b61a Gerrit-Change-Number: 28636 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 years, 11 months
1
0
0
0
Change in pysim[master]: Add very simplistic DF_PHONEBOOK support
by fixeria
Attention is currently required from: laforge. fixeria has posted comments on this change. (
https://gerrit.osmocom.org/c/pysim/+/28626
) Change subject: Add very simplistic DF_PHONEBOOK support ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28626
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I12f70ae78e219e765ecb44cacff421d64c7b3f19 Gerrit-Change-Number: 28626 Gerrit-PatchSet: 2 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: Sun, 17 Jul 2022 20:17:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 11 months
1
0
0
0
Change in pysim[master]: ts_31_103: Fix typos related to IMSConfigData + MudMidConfigData
by fixeria
Attention is currently required from: laforge. fixeria has posted comments on this change. (
https://gerrit.osmocom.org/c/pysim/+/28630
) Change subject: ts_31_103: Fix typos related to IMSConfigData + MudMidConfigData ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28630
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I9049ed12b8e7e6d1fdb7d19ed0b98ce8b46f9b0e Gerrit-Change-Number: 28630 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sun, 17 Jul 2022 20:17:30 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 11 months
1
0
0
0
Change in pysim[master]: ts_31_102: Fix FID in DF.HNB
by fixeria
Attention is currently required from: laforge. fixeria has posted comments on this change. (
https://gerrit.osmocom.org/c/pysim/+/28629
) Change subject: ts_31_102: Fix FID in DF.HNB ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28629
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0cfd623693a5017efe01bc6891640db22ba3f9f9 Gerrit-Change-Number: 28629 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sun, 17 Jul 2022 20:17:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 11 months
1
0
0
0
Change in pysim[master]: ts_31_102: Support for files of DF.V2X (Vehicle 2 X)
by laforge
laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28634
) Change subject: ts_31_102: Support for files of DF.V2X (Vehicle 2 X) ...................................................................... ts_31_102: Support for files of DF.V2X (Vehicle 2 X) Change-Id: I7246f165aebbc42a685f36a7a6f973498b23b614 --- M pySim/ts_31_102_telecom.py M pySim/ts_51_011.py 2 files changed, 44 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/34/28634/1 diff --git a/pySim/ts_31_102_telecom.py b/pySim/ts_31_102_telecom.py index d0f33b1..c020a07 100644 --- a/pySim/ts_31_102_telecom.py +++ b/pySim/ts_31_102_telecom.py @@ -246,3 +246,45 @@ EF_MCS_CONFIG(), ] self.add_files(files) + + +# TS 31.102 Section 4.6.5.2 +EF_VST_map = { + 1: 'MCPTT UE configuration data', + 2: 'MCPTT User profile data', + 3: 'MCS Group configuration data', + 4: 'MCPTT Service configuration data', + 5: 'MCS UE initial configuration data', + 6: 'MCData UE configuration data', + 7: 'MCData user profile data', + 8: 'MCData service configuration data', + 9: 'MCVideo UE configuration data', + 10: 'MCVideo user profile data', + 11: 'MCVideo service configuration data', + } + +# TS 31.102 Section 4.6.5.2 +class EF_VST(EF_UServiceTable): + def __init__(self, fid='4F01', sfid=0x01, name='EF.VST', desc='V2X Service Table', size={2,2}, + table=EF_VST_map, **kwargs): + super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, size=size, table=table) + +# TS 31.102 Section 4.6.5.3 +class EF_V2X_CONFIG(BerTlvEF): + class V2xConfigurationData(BER_TLV_IE, tag=0x80): + pass + class V2xConfigDataCollection(TLV_IE_Collection, nested=[V2xConfigurationData]): + pass + def __init__(self, fid='4F02', sfid=0x02, name='EF.V2X_CONFIG', desc='V2X configuration data', **kwargs): + super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs) + self._tlv = EF_V2X_CONFIG.V2xConfigDataCollection + +# TS 31.102 Section 4.6.5 +class DF_V2X(CardDF): + def __init__(self, fid='5F3E', name='DF.V2X', desc='Vehicle to X', **kwargs): + super().__init__(fid=fid, name=name, desc=desc, **kwargs) + files = [ + EF_VST(), + EF_V2X_CONFIG(), + ] + self.add_files(files) diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 362d484..0a481e1 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -32,7 +32,7 @@ from pySim.profile import match_sim from pySim.profile import CardProfile from pySim.filesystem import * -from pySim.ts_31_102_telecom import DF_PHONEBOOK, DF_MULTIMEDIA, DF_MCS +from pySim.ts_31_102_telecom import DF_PHONEBOOK, DF_MULTIMEDIA, DF_MCS, DF_V2X import enum from pySim.construct import * from construct import Optional as COptional @@ -502,6 +502,7 @@ DF_PHONEBOOK(), DF_MULTIMEDIA(), DF_MCS(), + DF_V2X(), ] self.add_files(files) -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28634
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I7246f165aebbc42a685f36a7a6f973498b23b614 Gerrit-Change-Number: 28634 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 years, 11 months
1
0
0
0
Change in pysim[master]: ts_31_102: Add support for DF.GSM-ACCESS
by laforge
laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28635
) Change subject: ts_31_102: Add support for DF.GSM-ACCESS ...................................................................... ts_31_102: Add support for DF.GSM-ACCESS Change-Id: I244c3eea13587e6213062d9a58e821697614a86a --- M pySim/ts_31_102.py M pySim/ts_51_011.py 2 files changed, 25 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/35/28635/1 diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 786bd64..a4f3532 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -33,6 +33,7 @@ from pySim.ts_51_011 import EF_SMSR, EF_DCK, EF_EXT, EF_CNL, EF_OPL, EF_MBI, EF_MWIS from pySim.ts_51_011 import EF_CBMID, EF_CBMIR, EF_ADN, EF_SMS, EF_MSISDN, EF_SMSP, EF_SMSS from pySim.ts_51_011 import EF_IMSI, EF_xPLMNwAcT, EF_SPN, EF_CBMI, EF_ACC, EF_PLMNsel +from pySim.ts_51_011 import EF_Kc, EF_CPBCCH, EF_InvScan from pySim.ts_102_221 import EF_ARR from pySim.tlv import * from pySim.filesystem import * @@ -920,6 +921,23 @@ super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, **kwargs) self._construct = BitStruct('rfu'/BitsRFU(7), 'from_preferred'/Bit) + +###################################################################### +# DF.GSM-ACCESS +###################################################################### + +class DF_GSM_ACCESS(CardDF): + def __init__(self, fid='5F3B', name='DF.GSM-ACCESS', desc='GSM Access', **kwargs): + super().__init__(fid=fid, name=name, desc=desc, service=27, **kwargs) + files = [ + EF_Kc(fid='4f20', sfid=0x01, service=27), + EF_Kc(fid='4f52', sfid=0x02, name='EF.KcGPRS', desc='GPRS Ciphering key KcGPRS', service=27), + EF_CPBCCH(fid='4f63', service=39), + EF_InvScan(fid='4f64', service=40), + ] + self.add_files(files) + + ###################################################################### # DF.5GS ###################################################################### @@ -1196,7 +1214,7 @@ EF_FromPreferred(service=114), # FIXME: DF_SoLSA service=23 DF_PHONEBOOK(), - # FIXME: DF_GSM_ACCESS service=27 + DF_GSM_ACCESS(), DF_WLAN(service=[59, 60, 61, 62, 63, 66, 81, 82, 83, 84, 88]), DF_HNB(service=[86, 90]), DF_ProSe(service=101), diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 0a481e1..0927c9f 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -798,8 +798,8 @@ # TS 51.011 Section 10.3.32 class EF_Kc(TransparentEF): - def __init__(self, fid='6f20', sfid=None, name='EF.Kc', desc='Ciphering key Kc', size={9, 9}): - super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size) + def __init__(self, fid='6f20', sfid=None, name='EF.Kc', desc='Ciphering key Kc', size={9, 9}, **kwargs): + super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, **kwargs) self._construct = Struct('kc'/HexAdapter(Bytes(8)), 'cksn'/Int8ub) # TS 51.011 Section 10.3.33 @@ -862,15 +862,15 @@ # TS 51.011 Section 10.3.38 class EF_CPBCCH(TransRecEF): def __init__(self, fid='6f63', sfid=None, name='EF.CPBCCH', size={2, 14}, rec_len=2, - desc='CPBCCH Information'): - super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len) + desc='CPBCCH Information', **kwargs): + super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len, **kwargs) self._construct = Struct('cpbcch'/Int16ub) # TS 51.011 Section 10.3.39 class EF_InvScan(TransparentEF): def __init__(self, fid='6f64', sfid=None, name='EF.InvScan', size={1, 1}, - desc='IOnvestigation Scan'): - super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size) + desc='IOnvestigation Scan', **kwargs): + super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, **kwargs) self._construct = FlagsEnum( Byte, in_limited_service_mode=1, after_successful_plmn_selection=2) -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28635
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I244c3eea13587e6213062d9a58e821697614a86a Gerrit-Change-Number: 28635 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 years, 11 months
1
0
0
0
Change in pysim[master]: minimalistic support for DF.MULTIMEDIA
by laforge
laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28631
) Change subject: minimalistic support for DF.MULTIMEDIA ...................................................................... minimalistic support for DF.MULTIMEDIA No decode of the payload of the files yet, but let's at least name them. Change-Id: I2d9c56bdea08fe6629978b6a1f7c139f487d075a --- M pySim/ts_31_102_telecom.py M pySim/ts_51_011.py 2 files changed, 25 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/31/28631/1 diff --git a/pySim/ts_31_102_telecom.py b/pySim/ts_31_102_telecom.py index 49f6868..5f695ed 100644 --- a/pySim/ts_31_102_telecom.py +++ b/pySim/ts_31_102_telecom.py @@ -5,7 +5,7 @@ # pylint: disable=undefined-variable """ -DF_PHONEBOOK as specified in 3GPP TS 31.102 V16.6.0 +DF_PHONEBOOK, DF_MULTIMEDIA as specified in 3GPP TS 31.102 V16.6.0 Needs to be a separate python module to avoid cyclic imports """ @@ -69,3 +69,24 @@ # FIXME: Those 4Fxx entries with unspecified FID... ] self.add_files(files) + + + +# TS 31.102 Section 4.6.3.1 +class EF_MML(BerTlvEF): + def __init__(self, fid='4F47', name='EF.MML', desc='Multimedia Messages List', **kwargs): + super().__init__(fid, name=name, desc=desc, **kwargs) + +# TS 31.102 Section 4.6.3.2 +class EF_MMDF(BerTlvEF): + def __init__(self, fid='4F48', name='EF.MMDF', desc='Multimedia Messages Data File', **kwargs): + super().__init__(fid, name=name, desc=desc, **kwargs) + +class DF_MULTIMEDIA(CardDF): + def __init__(self, fid='5F3B', name='DF.MULTIMEDIA', desc='Multimedia', **kwargs): + super().__init__(fid=fid, name=name, desc=desc, **kwargs) + files = [ + EF_MML(), + EF_MMDF(), + ] + self.add_files(files) diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 21fd54b..b2a9ca4 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -32,7 +32,7 @@ from pySim.profile import match_sim from pySim.profile import CardProfile from pySim.filesystem import * -from pySim.ts_31_102_telecom import DF_PHONEBOOK +from pySim.ts_31_102_telecom import DF_PHONEBOOK, DF_MULTIMEDIA import enum from pySim.construct import * from construct import Optional as COptional @@ -500,6 +500,8 @@ EF_CMI(), # not really part of 51.011 but something that TS 31.102 specifies may exist here. DF_PHONEBOOK(), + # not really part of 51.011 but something that TS 31.102 specifies may exist here. + DF_MULTIMEDIA(), ] self.add_files(files) -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28631
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I2d9c56bdea08fe6629978b6a1f7c139f487d075a Gerrit-Change-Number: 28631 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 years, 11 months
1
0
0
0
Change in pysim[master]: ts_31_102: Support for DF_MCS (Mission Critical Services)
by laforge
laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28633
) Change subject: ts_31_102: Support for DF_MCS (Mission Critical Services) ...................................................................... ts_31_102: Support for DF_MCS (Mission Critical Services) Change-Id: I0485a14c7820f7b345eeba6109a93b6d4bc639bf --- M pySim/ts_31_102_telecom.py M pySim/ts_51_011.py 2 files changed, 69 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/28633/1 diff --git a/pySim/ts_31_102_telecom.py b/pySim/ts_31_102_telecom.py index 5b2162a..d0f33b1 100644 --- a/pySim/ts_31_102_telecom.py +++ b/pySim/ts_31_102_telecom.py @@ -5,7 +5,7 @@ # pylint: disable=undefined-variable """ -DF_PHONEBOOK, DF_MULTIMEDIA as specified in 3GPP TS 31.102 V16.6.0 +DF_PHONEBOOK, DF_MULTIMEDIA, DF_MCS as specified in 3GPP TS 31.102 V16.6.0 Needs to be a separate python module to avoid cyclic imports """ @@ -180,3 +180,69 @@ EF_MMDF(), ] self.add_files(files) + + +# TS 31.102 Section 4.6.4.1 +EF_MST_map = { + 1: 'MCPTT UE configuration data', + 2: 'MCPTT User profile data', + 3: 'MCS Group configuration data', + 4: 'MCPTT Service configuration data', + 5: 'MCS UE initial configuration data', + 6: 'MCData UE configuration data', + 7: 'MCData user profile data', + 8: 'MCData service configuration data', + 9: 'MCVideo UE configuration data', + 10: 'MCVideo user profile data', + 11: 'MCVideo service configuration data', + } + +# TS 31.102 Section 4.6.4.2 +class EF_MCS_CONFIG(BerTlvEF): + class McpttUeConfigurationData(BER_TLV_IE, tag=0x80): + pass + class McpttUserProfileData(BER_TLV_IE, tag=0x81): + pass + class McsGroupConfigurationData(BER_TLV_IE, tag=0x82): + pass + class McpttServiceConfigurationData(BER_TLV_IE, tag=0x83): + pass + class McsUeInitialConfigurationData(BER_TLV_IE, tag=0x84): + pass + class McdataUeConfigurationData(BER_TLV_IE, tag=0x85): + pass + class McdataUserProfileData(BER_TLV_IE, tag=0x86): + pass + class McdataServiceConfigurationData(BER_TLV_IE, tag=0x87): + pass + class McvideoUeConfigurationData(BER_TLV_IE, tag=0x88): + pass + class McvideoUserProfileData(BER_TLV_IE, tag=0x89): + pass + class McvideoServiceConfigurationData(BER_TLV_IE, tag=0x8a): + pass + class McsConfigDataCollection(TLV_IE_Collection, nested=[McpttUeConfigurationData, + McpttUserProfileData, McsGroupConfigurationData, + McpttServiceConfigurationData, McsUeInitialConfigurationData, + McdataUeConfigurationData, McdataUserProfileData, + McdataServiceConfigurationData, McvideoUeConfigurationData, + McvideoUserProfileData, McvideoServiceConfigurationData]): + pass + def __init__(self, fid='4F02', sfid=0x02, name='EF.MCS_CONFIG', desc='MCS configuration data', **kwargs): + super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs) + self._tlv = EF_MCS_CONFIG.McsConfigDataCollection + +# TS 31.102 Section 4.6.4.1 +class EF_MST(EF_UServiceTable): + def __init__(self, fid='4F01', sfid=0x01, name='EF.MST', desc='MCS Service Table', size={2,2}, + table=EF_MST_map, **kwargs): + super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, size=size, table=table) + +class DF_MCS(CardDF): + def __init__(self, fid='5F3D', name='DF.MCS', desc='Mission Critical Services', **kwargs): + super().__init__(fid=fid, name=name, desc=desc, **kwargs) + files = [ + EF_MST(), + EF_MCS_CONFIG(), + ] + self.add_files(files) diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index b2a9ca4..362d484 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -32,7 +32,7 @@ from pySim.profile import match_sim from pySim.profile import CardProfile from pySim.filesystem import * -from pySim.ts_31_102_telecom import DF_PHONEBOOK, DF_MULTIMEDIA +from pySim.ts_31_102_telecom import DF_PHONEBOOK, DF_MULTIMEDIA, DF_MCS import enum from pySim.construct import * from construct import Optional as COptional @@ -500,8 +500,8 @@ EF_CMI(), # not really part of 51.011 but something that TS 31.102 specifies may exist here. DF_PHONEBOOK(), - # not really part of 51.011 but something that TS 31.102 specifies may exist here. DF_MULTIMEDIA(), + DF_MCS(), ] self.add_files(files) -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28633
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0485a14c7820f7b345eeba6109a93b6d4bc639bf Gerrit-Change-Number: 28633 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 years, 11 months
1
0
0
0
Change in pysim[master]: move EF_UServiceTable from ts_31_102 to ts_31_102_telecom
by laforge
laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28632
) Change subject: move EF_UServiceTable from ts_31_102 to ts_31_102_telecom ...................................................................... move EF_UServiceTable from ts_31_102 to ts_31_102_telecom We want to use this class in an upcoming patch for DF_MCS support, and in order to avoid cyclic imports, EF_UServiceTable must be moved. Change-Id: I9cd6ab795bfd92f845eb943679a3d6302f1003ce --- M pySim/ts_31_102.py M pySim/ts_31_102_telecom.py M pySim/ts_31_103.py 3 files changed, 93 insertions(+), 90 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/32/28632/1 diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index d9ee3a0..786bd64 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -36,7 +36,7 @@ from pySim.ts_102_221 import EF_ARR from pySim.tlv import * from pySim.filesystem import * -from pySim.ts_31_102_telecom import DF_PHONEBOOK +from pySim.ts_31_102_telecom import DF_PHONEBOOK, EF_UServiceTable from pySim.construct import * from construct import Optional as COptional from construct import * @@ -538,94 +538,6 @@ super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size) self._construct = Int8ub -# TS 31.102 Section 4.2.8 -class EF_UServiceTable(TransparentEF): - def __init__(self, fid, sfid, name, desc, size, table, **kwargs): - super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, size=size, **kwargs) - self.table = table - - @staticmethod - def _bit_byte_offset_for_service(service: int) -> Tuple[int, int]: - i = service - 1 - byte_offset = i//8 - bit_offset = (i % 8) - return (byte_offset, bit_offset) - - def _decode_bin(self, in_bin): - ret = {} - for i in range(0, len(in_bin)): - byte = in_bin[i] - for bitno in range(0, 8): - service_nr = i * 8 + bitno + 1 - ret[service_nr] = { - 'activated': True if byte & (1 << bitno) else False - } - if service_nr in self.table: - ret[service_nr]['description'] = self.table[service_nr] - return ret - - def _encode_bin(self, in_json): - # compute the required binary size - bin_len = 0 - for srv in in_json.keys(): - service_nr = int(srv) - (byte_offset, bit_offset) = EF_UServiceTable._bit_byte_offset_for_service( - service_nr) - if byte_offset >= bin_len: - bin_len = byte_offset+1 - # encode the actual data - out = bytearray(b'\x00' * bin_len) - for srv in in_json.keys(): - service_nr = int(srv) - (byte_offset, bit_offset) = EF_UServiceTable._bit_byte_offset_for_service( - service_nr) - if in_json[srv]['activated'] == True: - bit = 1 - else: - bit = 0 - out[byte_offset] |= (bit) << bit_offset - return out - - def get_active_services(self, cmd): - # obtain list of currently active services - (service_data, sw) = cmd.lchan.read_binary_dec() - active_services = [] - for s in service_data.keys(): - if service_data[s]['activated']: - active_services.append(s) - return active_services - - def ust_service_check(self, cmd): - """Check consistency between services of this file and files present/activated""" - num_problems = 0 - # obtain list of currently active services - active_services = self.get_active_services(cmd) - # iterate over all the service-constraints we know of - files_by_service = self.parent.files_by_service - try: - for s in sorted(files_by_service.keys()): - active_str = 'active' if s in active_services else 'inactive' - cmd.poutput("Checking service No %u (%s)" % (s, active_str)) - for f in files_by_service[s]: - should_exist = f.should_exist_for_services(active_services) - try: - cmd.lchan.select_file(f) - sw = None - exists = True - except SwMatchError as e: - sw = str(e) - exists = False - if exists != should_exist: - num_problems += 1 - if exists: - cmd.perror(" ERROR: File %s is selectable but should not!" % f) - else: - cmd.perror(" ERROR: File %s is not selectable (%s) but should!" % (f, sw)) - finally: - # re-select the EF.UST - cmd.lchan.select_file(self) - return num_problems - class EF_UST(EF_UServiceTable): def __init__(self, **kwargs): super().__init__(fid='6f38', sfid=0x04, name='EF.UST', desc='USIM Service Table', size={1,17}, table=EF_UST_map, **kwargs) diff --git a/pySim/ts_31_102_telecom.py b/pySim/ts_31_102_telecom.py index 5f695ed..5b2162a 100644 --- a/pySim/ts_31_102_telecom.py +++ b/pySim/ts_31_102_telecom.py @@ -32,6 +32,96 @@ from construct import Optional as COptional from construct import * +# TS 31.102 Section 4.2.8 +class EF_UServiceTable(TransparentEF): + def __init__(self, fid, sfid, name, desc, size, table, **kwargs): + super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, size=size, **kwargs) + self.table = table + + @staticmethod + def _bit_byte_offset_for_service(service: int) -> Tuple[int, int]: + i = service - 1 + byte_offset = i//8 + bit_offset = (i % 8) + return (byte_offset, bit_offset) + + def _decode_bin(self, in_bin): + ret = {} + for i in range(0, len(in_bin)): + byte = in_bin[i] + for bitno in range(0, 8): + service_nr = i * 8 + bitno + 1 + ret[service_nr] = { + 'activated': True if byte & (1 << bitno) else False + } + if service_nr in self.table: + ret[service_nr]['description'] = self.table[service_nr] + return ret + + def _encode_bin(self, in_json): + # compute the required binary size + bin_len = 0 + for srv in in_json.keys(): + service_nr = int(srv) + (byte_offset, bit_offset) = EF_UServiceTable._bit_byte_offset_for_service( + service_nr) + if byte_offset >= bin_len: + bin_len = byte_offset+1 + # encode the actual data + out = bytearray(b'\x00' * bin_len) + for srv in in_json.keys(): + service_nr = int(srv) + (byte_offset, bit_offset) = EF_UServiceTable._bit_byte_offset_for_service( + service_nr) + if in_json[srv]['activated'] == True: + bit = 1 + else: + bit = 0 + out[byte_offset] |= (bit) << bit_offset + return out + + def get_active_services(self, cmd): + # obtain list of currently active services + (service_data, sw) = cmd.lchan.read_binary_dec() + active_services = [] + for s in service_data.keys(): + if service_data[s]['activated']: + active_services.append(s) + return active_services + + def ust_service_check(self, cmd): + """Check consistency between services of this file and files present/activated""" + num_problems = 0 + # obtain list of currently active services + active_services = self.get_active_services(cmd) + # iterate over all the service-constraints we know of + files_by_service = self.parent.files_by_service + try: + for s in sorted(files_by_service.keys()): + active_str = 'active' if s in active_services else 'inactive' + cmd.poutput("Checking service No %u (%s)" % (s, active_str)) + for f in files_by_service[s]: + should_exist = f.should_exist_for_services(active_services) + try: + cmd.lchan.select_file(f) + sw = None + exists = True + except SwMatchError as e: + sw = str(e) + exists = False + if exists != should_exist: + num_problems += 1 + if exists: + cmd.perror(" ERROR: File %s is selectable but should not!" % f) + else: + cmd.perror(" ERROR: File %s is not selectable (%s) but should!" % (f, sw)) + finally: + # re-select the EF.UST + cmd.lchan.select_file(self) + return num_problems + + + # TS 31.102 Section 4.4.2.1 class EF_PBR(LinFixedEF): def __init__(self, fid='4F30', name='EF.PBR', desc='Phone Book Reference', **kwargs): diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py index 77eb0f2..ef60a7d 100644 --- a/pySim/ts_31_103.py +++ b/pySim/ts_31_103.py @@ -26,7 +26,8 @@ from pySim.utils import * from pySim.tlv import * from pySim.ts_51_011 import EF_AD, EF_SMS, EF_SMSS, EF_SMSR, EF_SMSP -from pySim.ts_31_102 import ADF_USIM, EF_FromPreferred, EF_UServiceTable +from pySim.ts_31_102 import ADF_USIM, EF_FromPreferred +from pySim.ts_31_102_telecom import EF_UServiceTable import pySim.ts_102_221 from pySim.ts_102_221 import EF_ARR -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28632
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I9cd6ab795bfd92f845eb943679a3d6302f1003ce Gerrit-Change-Number: 28632 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 years, 11 months
1
0
0
0
Change in pysim[master]: ts_31_102: Fix FID in DF.HNB
by laforge
laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/28629
) Change subject: ts_31_102: Fix FID in DF.HNB ...................................................................... ts_31_102: Fix FID in DF.HNB The FID are all specified as 4f8x and not 4f0x Change-Id: I0cfd623693a5017efe01bc6891640db22ba3f9f9 --- M pySim/ts_31_102.py 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/28629/1 diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index fa3af75..cf03a50 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -1102,12 +1102,12 @@ def __init__(self, fid='5f50', name='DF.HNB', desc='Files for HomeNodeB purpose', **kwargs): super().__init__(fid=fid, name=name, desc=desc, **kwargs) files = [ - LinFixedEF('4f01', 0x01, 'EF.ACSGL', 'Allowed CSG Lists', service=86), - LinFixedEF('4f02', 0x02, 'EF.CSGTL', 'CSG Types', service=86), - LinFixedEF('4f03', 0x03, 'EF.HNBN', 'Home NodeB Name', service=86), - LinFixedEF('4f04', 0x04, 'EF.OCSGL', 'Operator CSG Lists', service=90), - LinFixedEF('4f05', 0x05, 'EF.OCSGT', 'Operator CSG Type', service=90), - LinFixedEF('4f06', 0x06, 'EF.OHNBN', 'Operator Home NodeB Name', service=90), + LinFixedEF('4f81', 0x01, 'EF.ACSGL', 'Allowed CSG Lists', service=86), + LinFixedEF('4f82', 0x02, 'EF.CSGTL', 'CSG Types', service=86), + LinFixedEF('4f83', 0x03, 'EF.HNBN', 'Home NodeB Name', service=86), + LinFixedEF('4f84', 0x04, 'EF.OCSGL', 'Operator CSG Lists', service=90), + LinFixedEF('4f85', 0x05, 'EF.OCSGT', 'Operator CSG Type', service=90), + LinFixedEF('4f86', 0x06, 'EF.OHNBN', 'Operator Home NodeB Name', service=90), ] self.add_files(files) -- To view, visit
https://gerrit.osmocom.org/c/pysim/+/28629
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I0cfd623693a5017efe01bc6891640db22ba3f9f9 Gerrit-Change-Number: 28629 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 years, 11 months
1
0
0
0
← Newer
1
...
142
143
144
145
146
147
148
...
218
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
Results per page:
10
25
50
100
200