additional encode/decode test data for various files

Change-Id: Ib563a2204922d2013b5f7c5abde0773051e17938
This commit is contained in:
Harald Welte 2023-12-21 20:25:30 +01:00
parent 5376251993
commit 324175f8bd
4 changed files with 33 additions and 1 deletions

View File

@ -748,6 +748,8 @@ class EF_UMPC(TransparentEF):
_test_de_encode = [
( '3cff02', { "max_current_mA": 60, "t_op_s": 255,
"addl_info": { "req_inc_idle_current": False, "support_uicc_suspend": True } } ),
( '320500', { "max_current_mA": 50, "t_op_s": 5, "addl_info": {"req_inc_idle_current": False,
"support_uicc_suspend": False } } ),
]
def __init__(self, fid='2f08', sfid=0x08, name='EF.UMPC', desc='UICC Maximum Power Consumption'):
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=(5, 5))

View File

@ -296,6 +296,16 @@ class SUCI_CalcInfo(TLV_IE_Collection, nested=[ProtSchemeIdList, HomeNetPubKeyLi
# TS 31.102 4.4.11.8
class EF_SUCI_Calc_Info(TransparentEF):
_test_de_encode = [
( 'A00401010000A14A80010A81204E858C4D49D1343E6181284C47CA721730C98742CB7C6182D2E8126E08088D3680010B8120D1BC365F4997D17CE4374E72181431CBFEBA9E1B98D7618F79D48561B144672A',
{"prot_scheme_id_list": [{"priority": 0, "identifier": 1, "key_index": 1}, {"priority": 1,
"identifier": 0,
"key_index": 0}],
"hnet_pubkey_list": [{"hnet_pubkey_identifier": 10, "hnet_pubkey":
"4e858c4d49d1343e6181284c47ca721730c98742cb7c6182d2e8126e08088d36"},
{"hnet_pubkey_identifier": 11, "hnet_pubkey":
"d1bc365f4997d17ce4374e72181431cbfeba9e1b98d7618f79d48561b144672a"}]} ),
]
def __init__(self, fid="4f07", sfid=0x07, name='EF.SUCI_Calc_Info', size=(2, None),
desc='SUCI Calc Info', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, **kwargs)
@ -558,6 +568,8 @@ class EF_LOCI(TransparentEF):
( '47d1264a62f21037211e00',
{ "tmsi": "47d1264a", "lai": { "mcc_mnc": "262f01", "lac": "3721" },
"rfu": 30, "lu_status": 0 } ),
( 'ffffffff62f2200000ff01',
{"tmsi": "ffffffff", "lai": {"mcc_mnc": "262f02", "lac": "0000"}, "rfu": 255, "lu_status": 1} ),
]
def __init__(self, fid='6f7e', sfid=0x0b, name='EF.LOCI', desc='Location information', size=(11, 11)):
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
@ -766,6 +778,7 @@ class EF_GBANL(LinFixedEF):
# TS 31.102 Section 4.2.85
class EF_EHPLMNPI(TransparentEF):
_test_de_encode = [
( '00', {"presentation_ind": "no_preference"} ),
( '02', { "presentation_ind": "display_all" } ),
]
def __init__(self, fid='6fdb', sfid=None, name='EF.EHPLMNPI', size=(1, 1),
@ -1488,6 +1501,7 @@ class ADF_USIM(CardADF):
EF_NCP_IP(service=80),
EF_EPSLOCI('6fe3', 0x1e, 'EF.EPSLOCI', desc='EPS location information', service=85),
EF_EPSNSC(service=85),
# EF.UFC Test data: 801e60c01e900080040000000000000000f0000000004000000000000080
TransparentEF('6fe6', None, 'EF.UFC', desc='USAT Facility Control', size=(1, 16)),
TransparentEF('6fe8', None, 'EF.NASCONFIG', desc='Non Access Stratum Configuration', service=96),
# UICC IARI (only in cards that have no ISIM) service=95

View File

@ -136,6 +136,10 @@ class EF_PCSCF(LinFixedEF):
_test_de_encode = [
( '802c0070637363662e696d732e6d6e633030302e6d63633733382e7075622e336770706e6574776f726b2e6f7267',
{'pcscf_address': { "address": "pcscf.ims.mnc000.mcc738.pub.3gppnetwork.org", "type_of_address": "FQDN" } } ),
( '800501c0a80c22',
{'pcscf_address': { "address": "192.168.12.34", "type_of_address": "IPv4" } } ),
( '801102fe800000000000000042d7fffe530335',
{'pcscf_address': { "address": "fe80::42:d7ff:fe53:335", "type_of_address": "IPv6" } } ),
]
class PcscfAddress(BER_TLV_IE, tag=0x80):
_construct = Struct('type_of_address'/Enum(Byte, FQDN=0, IPv4=1, IPv6=2),

View File

@ -135,7 +135,12 @@ class EF_ADN(LinFixedEF):
"unknown", "numbering_plan_id":
"isdn_e164" }, "dialing_nr":
"6082658001", "cap_conf_id": 255, "ext1_record_id": 255 }),
]
( '4B756E64656E626574726575756E67FFFFFF0791947112122721ffffffffffff',
{"alpha_id": "Kundenbetreuung", "len_of_bcd": 7, "ton_npi": {"ext": True, "type_of_number":
"international",
"numbering_plan_id": "isdn_e164"},
"dialing_nr": "491721217212", "cap_conf_id": 255, "ext1_record_id": 255} )
]
def __init__(self, fid='6f3a', sfid=None, name='EF.ADN', desc='Abbreviated Dialing Numbers', ext=1, **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(14, 30), **kwargs)
@ -730,6 +735,7 @@ class EF_xPLMNwAcT(TransRecEF):
_test_de_encode = [
( '62F2104000', { "mcc": "262", "mnc": "01", "act": [ "E-UTRAN NB-S1", "E-UTRAN WB-S1" ] } ),
( '62F2108000', { "mcc": "262", "mnc": "01", "act": [ "UTRAN" ] } ),
( '62F220488C', { "mcc": "262", "mnc": "02", "act": ['E-UTRAN NB-S1', 'E-UTRAN WB-S1', 'EC-GSM-IoT', 'GSM', 'NG-RAN'] } ),
]
def __init__(self, fid='1234', sfid=None, name=None, desc=None, size=(40, None), rec_len=5, **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len, **kwargs)
@ -859,6 +865,12 @@ class EF_MBI(LinFixedEF):
# TS 51.011 Section 10.3.45 + TS 31.102 4.2.63
class EF_MWIS(LinFixedEF):
_test_de_encode = [
( '0000000000',
{"mwi_status": {"voicemail": False, "fax": False, "email": False, "other": False, "videomail":
False}, "num_waiting_voicemail": 0, "num_waiting_fax": 0, "num_waiting_email": 0,
"num_waiting_other": 0, "num_waiting_videomail": None} ),
]
def __init__(self, fid='6fca', sfid=None, name='EF.MWIS', rec_len=(5, 6),
desc='Message Waiting Indication Status', **kwargs):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len, **kwargs)