blob: ef40ba195773b0ce2e6a2b9e821d040bf9483ccf [file] [log] [blame]
Alexander Chemeris067f69c2017-07-18 16:44:26 +03001# -*- coding: utf-8 -*-
2
3""" Various constants from ETSI TS 151.011
4"""
5
6#
7# Copyright (C) 2017 Alexander.Chemeris <Alexander.Chemeris@gmail.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22
23MF_num = '3F00'
24
25DF_num = {
26'TELECOM': '7F10',
27
28'GSM': '7F20',
29'IS-41': '7F22',
30'FP-CTS': '7F23',
31
32'GRAPHICS': '5F50',
33
34'IRIDIUM': '5F30',
35'GLOBST': '5F31',
36'ICO': '5F32',
37'ACeS': '5F33',
38
39'EIA/TIA-553': '5F40',
40'CTS': '5F60',
41'SOLSA': '5F70',
42
43'MExE': '5F3C',
44}
45
46EF_num = {
47# MF
48'ICCID': '2FE2',
49'ELP': '2F05',
Sebastian Viviani0dc8f692020-05-29 00:14:55 +010050'DIR': '2F00',
Alexander Chemeris067f69c2017-07-18 16:44:26 +030051
52# DF_TELECOM
53'ADN': '6F3A',
54'FDN': '6F3B',
55'SMS': '6F3C',
56'CCP': '6F3D',
57'MSISDN': '6F40',
58'SMSP': '6F42',
59'SMSS': '6F43',
60'LND': '6F44',
61'SMSR': '6F47',
62'SDN': '6F49',
63'EXT1': '6F4A',
64'EXT2': '6F4B',
65'EXT3': '6F4C',
66'BDN': '6F4D',
67'EXT4': '6F4E',
68'CMI': '6F58',
69'ECCP': '6F4F',
70
71# DF_GRAPHICS
72'IMG': '4F20',
73
74# DF_SoLSA
75'SAI': '4F30',
76'SLL': '4F31',
77
78# DF_MExE
79'MExE-ST': '4F40',
80'ORPK': '4F41',
81'ARPK': '4F42',
82'TPRPK': '4F43',
83
84# DF_GSM
85'LP': '6F05',
86'IMSI': '6F07',
87'Kc': '6F20',
88'DCK': '6F2C',
89'PLMNsel': '6F30',
90'HPPLMN': '6F31',
91'CNL': '6F32',
92'ACMmax': '6F37',
93'SST': '6F38',
94'ACM': '6F39',
95'GID1': '6F3E',
96'GID2': '6F3F',
97'PUCT': '6F41',
98'CBMI': '6F45',
99'SPN': '6F46',
100'CBMID': '6F48',
101'BCCH': '6F74',
102'ACC': '6F78',
103'FPLMN': '6F7B',
104'LOCI': '6F7E',
105'AD': '6FAD',
106'PHASE': '6FAE',
107'VGCS': '6FB1',
108'VGCSS': '6FB2',
109'VBS': '6FB3',
110'VBSS': '6FB4',
111'eMLPP': '6FB5',
112'AAeM': '6FB6',
113'ECC': '6FB7',
114'CBMIR': '6F50',
115'NIA': '6F51',
116'KcGPRS': '6F52',
117'LOCIGPRS': '6F53',
118'SUME': '6F54',
119'PLMNwAcT': '6F60',
120'OPLMNwAcT': '6F61',
121# Figure 8 names it HPLMNAcT, but in the text it's names it HPLMNwAcT
122'HPLMNAcT': '6F62',
123'HPLMNwAcT': '6F62',
124'CPBCCH': '6F63',
125'INVSCAN': '6F64',
126'PNN': '6FC5',
127'OPL': '6FC6',
128'MBDN': '6FC7',
129'EXT6': '6FC8',
130'MBI': '6FC9',
131'MWIS': '6FCA',
132'CFIS': '6FCB',
133'EXT7': '6FCC',
134'SPDI': '6FCD',
135'MMSN': '6FCE',
136'EXT8': '6FCF',
137'MMSICP': '6FD0',
138'MMSUP': '6FD1',
139'MMSUCP': '6FD2',
140}
141
142DF = {
143'TELECOM': [MF_num, DF_num['TELECOM']],
144
145'GSM': [MF_num, DF_num['GSM']],
146'IS-41': [MF_num, DF_num['IS-41']],
147'FP-CTS': [MF_num, DF_num['FP-CTS']],
148
149'GRAPHICS': [MF_num, DF_num['GRAPHICS']],
150
151'IRIDIUM': [MF_num, DF_num['IRIDIUM']],
152'GLOBST': [MF_num, DF_num['GLOBST']],
153'ICO': [MF_num, DF_num['ICO']],
154'ACeS': [MF_num, DF_num['ACeS']],
155
156'EIA/TIA-553': [MF_num, DF_num['EIA/TIA-553']],
157'CTS': [MF_num, DF_num['CTS']],
158'SoLSA': [MF_num, DF_num['SOLSA']],
159
160'MExE': [MF_num, DF_num['MExE']],
161}
162
163
164EF = {
165'ICCID': [MF_num, EF_num['ICCID']],
166'ELP': [MF_num, EF_num['ELP']],
Sebastian Viviani0dc8f692020-05-29 00:14:55 +0100167'DIR': [MF_num, EF_num['DIR']],
Alexander Chemeris067f69c2017-07-18 16:44:26 +0300168
169'ADN': DF['TELECOM']+[EF_num['ADN']],
170'FDN': DF['TELECOM']+[EF_num['FDN']],
171'SMS': DF['TELECOM']+[EF_num['SMS']],
172'CCP': DF['TELECOM']+[EF_num['CCP']],
173'MSISDN': DF['TELECOM']+[EF_num['MSISDN']],
174'SMSP': DF['TELECOM']+[EF_num['SMSP']],
175'SMSS': DF['TELECOM']+[EF_num['SMSS']],
176'LND': DF['TELECOM']+[EF_num['LND']],
177'SMSR': DF['TELECOM']+[EF_num['SMSR']],
178'SDN': DF['TELECOM']+[EF_num['SDN']],
179'EXT1': DF['TELECOM']+[EF_num['EXT1']],
180'EXT2': DF['TELECOM']+[EF_num['EXT2']],
181'EXT3': DF['TELECOM']+[EF_num['EXT3']],
182'BDN': DF['TELECOM']+[EF_num['BDN']],
183'EXT4': DF['TELECOM']+[EF_num['EXT4']],
184'CMI': DF['TELECOM']+[EF_num['CMI']],
185'ECCP': DF['TELECOM']+[EF_num['ECCP']],
186
187'IMG': DF['GRAPHICS']+[EF_num['IMG']],
188
189'SAI': DF['SoLSA']+[EF_num['SAI']],
190'SLL': DF['SoLSA']+[EF_num['SLL']],
191
192'MExE-ST': DF['MExE']+[EF_num['MExE-ST']],
193'ORPK': DF['MExE']+[EF_num['ORPK']],
194'ARPK': DF['MExE']+[EF_num['ARPK']],
195'TPRPK': DF['MExE']+[EF_num['TPRPK']],
196
197'LP': DF['GSM']+[EF_num['LP']],
198'IMSI': DF['GSM']+[EF_num['IMSI']],
199'Kc': DF['GSM']+[EF_num['Kc']],
200'DCK': DF['GSM']+[EF_num['DCK']],
201'PLMNsel': DF['GSM']+[EF_num['PLMNsel']],
202'HPPLMN': DF['GSM']+[EF_num['HPPLMN']],
203'CNL': DF['GSM']+[EF_num['CNL']],
204'ACMmax': DF['GSM']+[EF_num['ACMmax']],
205'SST': DF['GSM']+[EF_num['SST']],
206'ACM': DF['GSM']+[EF_num['ACM']],
207'GID1': DF['GSM']+[EF_num['GID1']],
208'GID2': DF['GSM']+[EF_num['GID2']],
209'PUCT': DF['GSM']+[EF_num['PUCT']],
210'CBMI': DF['GSM']+[EF_num['CBMI']],
211'SPN': DF['GSM']+[EF_num['SPN']],
212'CBMID': DF['GSM']+[EF_num['CBMID']],
213'BCCH': DF['GSM']+[EF_num['BCCH']],
214'ACC': DF['GSM']+[EF_num['ACC']],
215'FPLMN': DF['GSM']+[EF_num['FPLMN']],
216'LOCI': DF['GSM']+[EF_num['LOCI']],
217'AD': DF['GSM']+[EF_num['AD']],
218'PHASE': DF['GSM']+[EF_num['PHASE']],
219'VGCS': DF['GSM']+[EF_num['VGCS']],
220'VGCSS': DF['GSM']+[EF_num['VGCSS']],
221'VBS': DF['GSM']+[EF_num['VBS']],
222'VBSS': DF['GSM']+[EF_num['VBSS']],
223'eMLPP': DF['GSM']+[EF_num['eMLPP']],
224'AAeM': DF['GSM']+[EF_num['AAeM']],
225'ECC': DF['GSM']+[EF_num['ECC']],
226'CBMIR': DF['GSM']+[EF_num['CBMIR']],
227'NIA': DF['GSM']+[EF_num['NIA']],
228'KcGPRS': DF['GSM']+[EF_num['KcGPRS']],
229'LOCIGPRS': DF['GSM']+[EF_num['LOCIGPRS']],
230'SUME': DF['GSM']+[EF_num['SUME']],
231'PLMNwAcT': DF['GSM']+[EF_num['PLMNwAcT']],
232'OPLMNwAcT': DF['GSM']+[EF_num['OPLMNwAcT']],
233# Figure 8 names it HPLMNAcT, but in the text it's names it HPLMNwAcT
234'HPLMNAcT': DF['GSM']+[EF_num['HPLMNAcT']],
235'HPLMNwAcT': DF['GSM']+[EF_num['HPLMNAcT']],
236'CPBCCH': DF['GSM']+[EF_num['CPBCCH']],
237'INVSCAN': DF['GSM']+[EF_num['INVSCAN']],
238'PNN': DF['GSM']+[EF_num['PNN']],
239'OPL': DF['GSM']+[EF_num['OPL']],
240'MBDN': DF['GSM']+[EF_num['MBDN']],
241'EXT6': DF['GSM']+[EF_num['EXT6']],
242'MBI': DF['GSM']+[EF_num['MBI']],
243'MWIS': DF['GSM']+[EF_num['MWIS']],
244'CFIS': DF['GSM']+[EF_num['CFIS']],
245'EXT7': DF['GSM']+[EF_num['EXT7']],
246'SPDI': DF['GSM']+[EF_num['SPDI']],
247'MMSN': DF['GSM']+[EF_num['MMSN']],
248'EXT8': DF['GSM']+[EF_num['EXT8']],
249'MMSICP': DF['GSM']+[EF_num['MMSICP']],
250'MMSUP': DF['GSM']+[EF_num['MMSUP']],
251'MMSUCP': DF['GSM']+[EF_num['MMSUCP']],
252}
Supreeth Herlebf5d6022020-03-20 15:18:27 +0100253
254# Mapping between SIM Service Number and its description
255EF_SST_map = {
256 1: 'CHV1 disable function',
257 2: 'Abbreviated Dialling Numbers (ADN)',
258 3: 'Fixed Dialling Numbers (FDN)',
259 4: 'Short Message Storage (SMS)',
260 5: 'Advice of Charge (AoC)',
261 6: 'Capability Configuration Parameters (CCP)',
262 7: 'PLMN selector',
263 8: 'RFU',
264 9: 'MSISDN',
265 10: 'Extension1',
266 11: 'Extension2',
267 12: 'SMS Parameters',
268 13: 'Last Number Dialled (LND)',
269 14: 'Cell Broadcast Message Identifier',
270 15: 'Group Identifier Level 1',
271 16: 'Group Identifier Level 2',
272 17: 'Service Provider Name',
273 18: 'Service Dialling Numbers (SDN)',
274 19: 'Extension3',
275 20: 'RFU',
276 21: 'VGCS Group Identifier List (EFVGCS and EFVGCSS)',
277 22: 'VBS Group Identifier List (EFVBS and EFVBSS)',
278 23: 'enhanced Multi-Level Precedence and Pre-emption Service',
279 24: 'Automatic Answer for eMLPP',
280 25: 'Data download via SMS-CB',
281 26: 'Data download via SMS-PP',
282 27: 'Menu selection',
283 28: 'Call control',
284 29: 'Proactive SIM',
285 30: 'Cell Broadcast Message Identifier Ranges',
286 31: 'Barred Dialling Numbers (BDN)',
287 32: 'Extension4',
288 33: 'De-personalization Control Keys',
289 34: 'Co-operative Network List',
290 35: 'Short Message Status Reports',
291 36: 'Network\'s indication of alerting in the MS',
292 37: 'Mobile Originated Short Message control by SIM',
293 38: 'GPRS',
294 39: 'Image (IMG)',
295 40: 'SoLSA (Support of Local Service Area)',
296 41: 'USSD string data object supported in Call Control',
297 42: 'RUN AT COMMAND command',
298 43: 'User controlled PLMN Selector with Access Technology',
299 44: 'Operator controlled PLMN Selector with Access Technology',
300 45: 'HPLMN Selector with Access Technology',
301 46: 'CPBCCH Information',
302 47: 'Investigation Scan',
303 48: 'Extended Capability Configuration Parameters',
304 49: 'MExE',
305 50: 'Reserved and shall be ignored',
306 51: 'PLMN Network Name',
307 52: 'Operator PLMN List',
308 53: 'Mailbox Dialling Numbers',
309 54: 'Message Waiting Indication Status',
310 55: 'Call Forwarding Indication Status',
311 56: 'Service Provider Display Information',
312 57: 'Multimedia Messaging Service (MMS)',
313 58: 'Extension 8',
314 59: 'MMS User Connectivity Parameters',
Vadim Yanitskiydfe3dbb2020-07-28 05:26:02 +0700315}
316
317# 10.3.18 "EF.AD (Administrative data) "
318EF_AD_mode_map = {
319 '00' : 'normal operation',
320 '80' : 'type approval operations',
321 '01' : 'normal operation + specific facilities',
322 '81' : 'type approval operations + specific facilities',
323 '02' : 'maintenance (off line)',
324 '04' : 'cell test operation',
325}