*gc dZddlZddlmZddlmZmZmZmZm Z m Z m Z m Z m Z ddlmZmZmZmZmZmZddlmZddlTddlTddlZddlmZmZmZmZmZdd lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&dd lm'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dd lm.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5dd lm6Z6m7Z7m8Z8m9Z9m:Z:m;Z;dd lmZ>ddlm?Z?ddl@TddlAmBZBmCZCddlDmEZEmFZFmGZGddlDmHZHmIZIddlJmKZKmLZLmMZMidddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4id5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVidWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxidydzd{d|d}d~ddddddddddddddddddddddddddddiddddddddddddddddddddddddddddddddddidddddd“ddēddƓddȓddʓdd̓ddΓddГddғddԓddFddדddٓddۓddݓiddߓddddddddddddddddddddddddddddddddidddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d, ZNd-d.d/d0d1d2ZOdddXd3ZPGd4d5eQd67ZRGd8d9eSZTGd:d;eUZVGd<d=eUZWGd>d?eXZYGd@dAeUZZGdBdCeUZ[GdDdEeCZ\GdFdGeSZ]GdHdIeUZ^GdJdKeUZ_GdLdMeUZ`GdNdOeaZbGdPdQeaZcGdRdSeaZdGdTdUeSZeGdVdWeCZfGdXdYeUZgGdZd[eUZhGd\d]eUZiGd^d_eXZjGd`daeXZkGdbdceUZlGdddeeSZmGdfdgeSZnGdhdieSZoGdjdkeUZpGdldmeSZqGdndoeSZrGdpdqeUZsGdrdseSZtGdtdueUZuGdvdweaZvGdxdyeUZwGdzd{eUZxGd|d}eUZyed~ez dez ZzGddeUZ{GddeUZ|GddeUZ}Gdde~ZGddeSZGddeSZGddeSZGddeSZGddeUZGddeUZGddeSZGddeUZGddeUZGddeUZGddeUZGddeUZGddeUZGddeUZGddeSZGdde~ZGddeCZGddeUZGddeUZGddeUZGddeUZGddeUZGddeUZGddeUZGdde~ZGddeUZGddeUZGdde~ZGddeUZGd„deUZGdĄdeUZGdƄdeUZGdȄde~ZGdʄde~ZGd̄de~ZGd΄de~ZGdЄde~ZGd҄deZdԐdՐd֐dאdؐdِdڜiZGdۄdeZGd݄deZdS(z/ Various constants from 3GPP TS 31.102 V17.9.0 N)Optional) Int32ubNibble GreedyRangeStruct FlagsEnumSwitchthisInt16ubPadding)BytewiseInt24ubInt24sb PaddedString PrefixedArrayIf) is_hexstr)*) EF_ACMmaxEF_AAeMEF_eMLPPEF_CMIEF_PNN)EF_MMSN EF_MMSICPEF_MMSUP EF_MMSUCPEF_VGCSEF_VGCSSEF_NIA)EF_SMSREF_DCKEF_EXTEF_CNLEF_OPLEF_MBIEF_MWIS)EF_CBMIDEF_CBMIREF_ADNEF_CFISEF_SMS EF_MSISDNEF_SMSPEF_SMSS)EF_IMSI EF_xPLMNwAcTEF_SPNEF_CBMIEF_ACC EF_PLMNsel)EF_Kc EF_CPBCCH EF_InvScan)EF_ARR) DF_PHONEBOOKEF_UServiceTable)EF_IMSConfigDataEF_XCAPConfigDataEF_MuDMiDConfigData) EF_AC_GBAUAPI EF_IMSDCI)SMS_TPDUDeviceIdentities SMSPPDownloadzLocal Phone BookzFixed Dialling Numbers (FDN)z Extension 2zService Dialling Numbers (SDN) Extension3zBarred Dialling Numbers (BDN) Extension4z'Outgoing Call Information (OCI and OCT) z'Incoming Call Information (ICI and ICT) zShort Message Storage (SMS) z#Short Message Status Reports (SMSR) z'Short Message Service Parameters (SMSP) zAdvice of Charge (AoC)z,Capability Configuration Parameters 2 (CCP2)z!Cell Broadcast Message Identifierz(Cell Broadcast Message Identifier RangesGroup Identifier Level 1Group Identifier Level 2zService Provider Namez4User controlled PLMN selector with Access TechnologyMSISDNz Image (IMG)z*Support of Localised Service Areas (SoLSA)z7Enhanced Multi-Level Precedence and Pre-emption ServicezAutomatic Answer for eMLPPRFU GSM AccesszData download via SMS-PPzData download via SMS-CBzCall Control by USIMzMO-SMS Control by USIM zRUN AT COMMAND command!zshall be set to 1"Enabled Services Table#zAPN Control List (ACL)$zDepersonalisation Control Keys%zCo-operative Network List&zGSM security context'zCPBCCH Information(zInvestigation Scan)MexE*z8Operator controlled PLMN selector with Access Technology+z%HPLMN selector with Access Technology,z Extension 5-zPLMN Network Name.zOperator PLMN List/Mailbox Dialling Numbers0z!Message Waiting Indication Status1z!Call Forwarding Indication Status2zReserved and shall be ignored3$Service Provider Display Information4z"Multimedia Messaging Service (MMS)5z Extension 86zCall control on GPRS by USIM7z MMS User Connectivity Parameters8z0Network's indication of alerting in the MS (NIA)9z/VGCS Group Identifier List (EFVGCS and EFVGCSS):z,VBS Group Identifier List (EFVBS and EFVBSS); Pseudonym<z/User Controlled PLMN selector for I-WLAN access=z3Operator Controlled PLMN selector for I-WLAN access>zUser controlled WSID list?zOperator controlled WSID list@z VGCS securityAz VBS securityBWLAN Reauthentication IdentityCzMultimedia Messages StorageDz(Generic Bootstrapping Architecture (GBA)Ez MBMS securityFz0Data download via USSD and USSD application modeGEquivalent HPLMNHz1Additional TERMINAL PROFILE after UICC activationI(Equivalent HPLMN Presentation IndicationJzLast RPLMN Selection IndicationKzOMA BCAST Smart Card ProfileLz+GBA-based Local Key Establishment MechanismMzTerminal ApplicationsNService Provider Name IconOPLMN Network Name IconPz/Connectivity Parameters for USIM IP connectionsQ$Home I-WLAN Specific Identifier ListR/I-WLAN Equivalent HPLMN Presentation IndicationS I-WLAN HPLMN Priority IndicationTI-WLAN Last Registered PLMNUz#EPS Mobility Management InformationVz/Allowed CSG Lists and corresponding indicationsWz*Call control on EPS PDN connection by USIMXzHPLMN Direct AccessYz eCall DataZz0Operator CSG Lists and corresponding indications[zSupport for SM-over-IP\zSupport of CSG Display Control]z%Communication Control for IMS by USIM^zExtended Terminal Applications_zSupport of UICC access to IMS`z(Non-Access Stratum configuration by USIMazPWS configuration by USIMbczURI support by UICCdzExtended EARFCN supporteProSefzUSAT Application PairinggzMedia Type supporthzIMS call disconnection causeiz(URI support for MO SHORT MESSAGE CONTROLjz&ePDG configuration Information supportkz)ePDG configuration Information configuredlz ACDC supportmMCPTTnzs@rrrs +++++ ++++:4GGGGG GGGGGGGGG GGGG     :4+0%+;=R+@+B    MW<;;;;;;;;;;rrceZdZGddedZGddedZGdd eeeg Z dfd ZxZ S) EF_5GAUTHKEYSc$eZdZeeZdS)EF_5GAUTHKEYS.K_AUSFNrrrrK_AUSFrEZ ,, rrFrrc$eZdZeeZdS)EF_5GAUTHKEYS.K_SEAFNrrrrK_SEAFrI rGrrJrceZdZdS)EF_5GAUTHKEYS.FiveGAuthKeysNr'rrr FiveGAuthKeysrL  rrMr,4f05rH EF.5GAUTHKEYSrN5G authentication keysc htj|f||||d|tj|_dSNr3r4r5size)r7r8rCrMr9r;r<r3r4rWr5r=r>s rr8zEF_5GAUTHKEYS.__init__s;S4dDSSFSSS!/ r)rPrHrQrRrS) rrrr?rFrJTLV_IE_CollectionrMr8r@rAs@rrCrCs------------------     )662B    JT.0000000000rrCceZdZdddddddddgddddd dgd fgZGd d ed ZGddedZGddedZGddedeegZGdde eegZ d,fd! Z d"Z e d#eed$eefd%Ze d#eed$eefd&Zd'Zd(Zd)Zd*Zd+ZxZS)-EF_SUCI_Calc_InfoڤA00401010000A14A80010A81204E858C4D49D1343E6181284C47CA721730C98742CB7C6182D2E8126E08088D3680010B8120D1BC365F4997D17CE4374E72181431CBFEBA9E1B98D7618F79D48561B144672ArrDpriority identifier key_indexrO@4e858c4d49d1343e6181284c47ca721730c98742cb7c6182d2e8126e08088d36)hnet_pubkey_identifier hnet_pubkeyrP@d1bc365f4997d17ce4374e72181431cbfeba9e1b98d7618f79d48561b144672aprot_scheme_id_listhnet_pubkey_listc ^eZdZeedeedddz dez ZdS)"EF_SUCI_Calc_Info.ProtSchemeIdListr_rrDrE)nullABr`N) rrrrrEnumByter rrrrProtSchemeIdListri!sO![ F<TQ! < < <P Q QSS rror*rceZdZeZdS)&EF_SUCI_Calc_Info.HnetPubkeyIdentifierNr rrrHnetPubkeyIdentifierrq's rrrrc$eZdZeeZdS)EF_SUCI_Calc_Info.HnetPubkeyNrrrr HnetPubkeyrt+Z ,, rrurceZdZdS) EF_SUCI_Calc_Info.HnetPubkeyListNr'rrrHnetPubkeyListrx/rNrryrr+ceZdZdS)EF_SUCI_Calc_Info.SUCI_CalcInfoNr'rrr SUCI_CalcInfor{3rNrr|rO4f07rKEF.SUCI_Calc_InforENSUCI Calc Infoc Ftj|f||||d|dSrUr7r8rXs rr8zEF_SUCI_Calc_Info.__init__6s3S4dDSSFSSSSSrcdg}|t|dzt|dD]8}||d||d9|S)Nr*rEc|dS)Nr^r)items rz?EF_SUCI_Calc_Info._encode_prot_scheme_id_list..?s tJ7Gr)keyr_r`)appendlensorted)r;in_list out_bytesschemes r_encode_prot_scheme_id_listz-EF_SUCI_Calc_Info._encode_prot_scheme_id_list:sF Wa(((W*G*GHHH 2 2F   VL1 2 2 2   VK0 1 1 1 1rlreturncg}t|rT|d}|d}i||}||t|T|S)zconversion method to generate list of {hnet_pubkey_identifier, hnet_pubkey} dicts from flat [{hnet_pubkey_identifier: }, {net_pubkey: }, ...] listr)rpopr)routabzs r_compact_pubkey_listz&EF_SUCI_Calc_Info._compact_pubkey_listEsh!ff aAaA1  A JJqMMM !ff   rcvg}|D]3}|D]\}}|||i4|S)zconversion method to generate flat [{hnet_pubkey_identifier: }, {net_pubkey: }, ...] list from compacted list of {hnet_pubkey_identifier, hnet_pubkey} dicts)itemsr)rrdkvs r_expand_pubkey_listz%EF_SUCI_Calc_Info._expand_pubkey_listQsV # #A  # #1 Aq6"""" # rc :||d}||d}t}|d|i||z }dd|DS)Nrfrgcg|]}d|zS)z%02Xr).0is r z1EF_SUCI_Calc_Info._encode_hex..bs666q 666r)rrr[ry from_dictto_tlvjoin)r;in_jsonr=rrhpkls r _encode_hexzEF_SUCI_Calc_Info._encode_hex[s44 ) *,,  $ $W-?%@ A A //11 *A.///T[[]]" ww66I666777rcg}d}|t|krE|dz||||dzd}|dz }|||t|kE|S)NrrErDr])rr)r;in_bytesrfpos prot_schemes r_decode_prot_scheme_id_listz-EF_SUCI_Calc_Info._decode_prot_scheme_id_listds} CMM!!!1f&sm&s1uoK 1HC  & &{ 3 3 3CMM!!#"rcF|t|SN) _decode_hexb2h)r;in_bins r _decode_binzEF_SUCI_Calc_Info._decode_binrsF ,,,rct|}d}||dkrtdiS|dz }||}|dz }|||||z}||z }t}|||d||d}||dS)Nrr*z9missing Protection Scheme Identifier List data object tagrDrgre)h2bprintrr[ryfrom_tlvrto_dict)r;in_hexrrprot_scheme_id_list_lenrfrrgs rrzEF_SUCI_Calc_Info._decode_hexusv;; C=D M N N NI q"*3- q">> S444 577 &&!//11 hsttn%%%44T\\^^DV5WXX$7#3   rc 8t|j|fi|Sr)rrr;rr=s r _encode_binzEF_SUCI_Calc_Info._encode_bins&#4#G66v66777r)r}rKr~rr)rrr_test_de_encoder?rorrruryrYr|r8r staticmethodListdictrrrrrrrr@rAs@rr[r[s q01QR#S#SbcdecdVfVf#g<>!c!e!e;=!c!e!e f g g i OSSSSS:4SSSS zt-----ZT----     7KZ6X         )3C^2T    NW&TTTTTT    T tDz   \ tDzd4j\888 # # #---   48888888rr[c0eZdZ d fd ZdZd ZxZS) EF_LI6f05NEF.LIrrELanguage IndicationcVt||||||dSNr3r4r5rWr6r)r;r<r3r4rWr6r5r>s rr8zEF_LI.__init__s/ 4dDRYZZZZZrc <|dkrdS|dSNsascii)decode)r;rr=s r_decode_record_binzEF_LI._decode_record_bins& [ 4==)) )rc 4|dS|dSr)encoders r_encode_record_binzEF_LI._encode_record_bins ?;>>'** *r)rNrrrEr)rrrr8rrr@rAs@rrrsgTU+[[[[[[***+++++++rrc$eZdZ dfd ZxZS)EF_Keys6f08rMEF.KeysrkrkCiphering and Integrity Keysc t|||||tdtz dt t dz dt t dz |_dS)NrVksickrUik)r7r8rr rrrr;r<r3r4rWr5r>s rr8zEF_Keys.__init__sn 4dDIII &L$z%))444d:eBii;P;P6PRRr)rrMrrrrrrr8r@rAs@rrrsMCK4RRRRRRRRRRrrc*eZdZdgZ dfd ZxZS) EF_HPPLMN)05rH6f31rX EF.HPPLMNrDrD"Higher Priority PLMN search periodclt|||||t|_dSrU)r7r8r rrs rr8zEF_HPPLMN.__init__s1 4dDIII r)rrXrrrrrrrr8r@rAs@rrrsJ#oOEK:!!!!!!!!!!rrc\eZdZfdZedGddeZxZS)EF_USTc tjddddddtd||xj|gz c_dS)N6f38rGzEF.USTzUSIM Service Table)rDrVr<r3r4r5rWtabler)r7r8 EF_UST_mapshell_commandsAddlShellCommandsr;r=r>s rr8zEF_UST.__init__sr CV$XDX_emw C C|B C C C  6 6 8 899rFile-Specific Commandsc eZdZdZdZdZdS)EF_UST.AddlShellCommandsc||jjj}||jt |ggdS)z Activate a service within EF.USTN_cmdlchan selected_file ust_updateintr;argrs rdo_ust_service_activatez0EF_UST.AddlShellCommands.do_ust_service_activate6 IO9M  $ $TYS B ? ? ? ? ?rc||jjj}||jgt |gdS)z"Deactivate a service within EF.USTNrrs rdo_ust_service_deactivatez2EF_UST.AddlShellCommands.do_ust_service_deactivate6 IO9M  $ $TYSXXJ ? ? ? ? ?rc|jjj}||j}||j}d|vr#d|vr|jd|dz }d|vr#d|vr|jd|dz }gd}|}d |vr+|D](}||vr"|jd |z|dz })|jd |zd S) aCheck consistency between services of this file and files present/activated. Many services determine if one or multiple files shall be present/activated or if they shall be absent/deactivated. This performs a consistency check to ensure that no services are activated for files that are not - and vice-versa, no files are activated for services that are not. Error messages are printed for every inconsistency found.rzryz7ERROR: Service 46 available, but it requires Service 45rDrrz:ERROR: Service 125 is ignored as Service 124 not available)rrrzADF.ISIMzGERROR: Service %u shall not be available as ISIM application is presentz/===> %u service / file inconsistencies detectedN) rrrust_service_checkget_active_servicesperrorget_mf get_app_namespoutput)r;_argr num_problemsactive_servicesnon_isim_services app_namesss rdo_ust_service_checkz-EF_UST.AddlShellCommands.do_ust_service_checks=!IO9M(::49EEL+?? JJO_$$R?-B-B   !Z[[[! o%%c_.D.D   !]^^^! - %,,..<<>>IY&&***AO++ (()ruv)vwww$) I  OR^^ _ _ _ _ _rN)rrrrrrrrrrrsL @ @ @  @ @ @  ` ` ` ` `rrrrrr8with_default_category CommandSetrr@rAs@rrrs::::: 344&`&`&`&`&`J&`&`54&`&`&`&`&`rrc eZdZdddddddddddfdddddddddddfgZdZeeed Ze e d d d d d ddZ e ee Z dfd ZdZdZxZS)EF_ECC19f1ff01911fTF)police ambulance fire_brigade marine_guardmountain_rescue manual_ecallautomatic_ecall call_codeservice_category19f3ff02913frFrDrErGrHrJrK6fb7EF.ECCEmergency Call CodescTt||||ddS)N)rGr[r2r)r;r<r3r4r5r>s rr8zEF_ECC.__init__s, 4dwOOOOOrc |dd}|dkrdS|dd}ttj|ttj|d}t |dkr'|dd}ttj||d<|S)NrFsrrGalpha_id)parse_constructr cc_constructcategory_constructralpha_construct)r;rr=code svc_categoryretr*s rrzEF_ECC._decode_record_binsbqbz ? " "4bcc{ +F,?FF#263Ll#[#[]] v;;??ad|H-f.DhOOC O rc |dStj|d}tj|d}d|vr&tj|d}nd}||z|zS)Nsr r!r*r)rr,buildr-r.)r;rr=r/r0r*s rrzEF_ECC._encode_record_bin s ?&&"(()=>>066w?Q7RSS  -33GJ4GHHHHHh--r)r$rDr%r&)rrrr _test_no_pad BcdAdapterRpadrr,rrnr-GsmOrUcs2Adapterrr.r8rrr@rAs@rrrsK V8<5bg>CX]>CX]-`-`bb d V8=Dbg>CX]>CX]-`-`bb d OL:dd5588nn--L"4QQ]^341VWYYY&&ttK'8'899O3;,PPPPPP    . . . . . . .rrcPeZdZddddddddfd d d d dd ddfgZdfd ZxZS)EF_LOCI47d1264a62f21037211e0047d1264a262-013721)mcc_mnclacrhr)tmsilairfu lu_statusffffffff62f2200000ff01ffffffffz262-020000rD6f7erPEF.LOCILocation informationrPrPc vt|||||tdtt dz dt t dz }tdt t dz d|z d t z d t z |_dS) NrVr>rFr?rEr@rGrArBrCr7r8r PlmnAdapterrrr r)r;r<r3r4r5rWLair>s rr8zEF_LOCI.__init__ s 4dDIIIY{588444eJuQxxs rr8zEF_AD.__init__;s 4dDIII# dEM)B)B C C C hyaef@APQ(S(S(STT T '!**  k!nn $ 8N#;#;<< <   r)rfrFrgrhri) rrrrr4enumIntEnumrer8r@rAs@rrQrQ&s XDIbg?DV[,^,^ QcDD F -MDHaf?DV[,^,^ QcDD F OL$,           rrQc eZdZdfd ZxZS) EF_PSLOCI6f73rQ EF.PSLOCIPS Location informationrSrSc @t|||||tdtt dz dtt dz dtt dz dt z |_dS) NrVptmsirG ptmsi_sigrFrairJ rau_status)r7r8rrrr rros rr8zEF_PSLOCI.__init__Js 4dDIII E!HH)=)=!={:V[\]V^V^K_K_?_!&z%((';';!;\&=PRRr)rtrQrurvrwrrAs@rrsrsIsGRRRRRRRRRRrrsc$eZdZ dfd ZxZS)EF_ICI6f80r[EF.ICIrfr}Incoming Call Informationc tjd|||||d|tdtt t jjdz z dtz dtz dtt dz dtz d tz d tt d z d tz d tz dtt dz |_ dS)Nr<r3r4r5r6r*rflen_of_bcd_contentston_npi call_numberrOcap_cfg2_record_idext5_record_id date_and_timerKdurationstatuslink_to_phonebookrFr) r7r8rrrr _ total_lenr r5rrnrr:s rr8zEF_ICI.__init__Qs]St$T7]]V\]]] JuTV=Mb=P7Q7Q,R,R!R!6v!=!*6!1!.z%))/D/D!D!5f!s rr8zEF_CCP2.__init__ws4`St$T:``Y_`````r)rr^rrrrAs@rrrvsGaaaaaaaaaarrc\eZdZfdZedGddeZxZS)EF_ESTc tjddddddtd||xj|gz c_dS)N6f56rHzEF.ESTrmrDNrr)r7r8 EF_EST_maprrrs rr8zEF_EST.__init__|sr IV$XD\cks} I IBH I I I  6 6 8 899rrceZdZdZdZdS)EF_EST.AddlShellCommandsc||jjj}||jt |ggdS)zEnable a service within EF.ESTNrrs rdo_est_service_enablez.EF_EST.AddlShellCommands.do_est_service_enablerrc||jjj}||jgt |gdS)zDisable a service within EF.ESTNrrs rdo_est_service_disablez/EF_EST.AddlShellCommands.do_est_service_disablerrN)rrrrrrrrrr: @ @ @  @ @ @ @ @rrrrAs@rrr{s::::: 344 @ @ @ @ @J @ @54 @ @ @ @ @rrc$eZdZ dfd ZxZS)EF_ACL6f57NEF.ACLrjNAccess Point Name Control Listc tj|f||||d|tdtz dt t z |_dS)NrV num_of_apnstlvs)r7r8rr rrrrXs rr8zEF_ACL.__init__sTS4dDSSFSSS v!5vj>U>U7UVVr)rNrrrrrAs@rrrsMBL6WWWWWWWWWWrrc4eZdZddddfgZ d fd ZxZS) EF_START_HFN f00000f00000i)start_csstart_ps6f5brT EF.START-HFNrJrJ+Initialisation values for Hyperframe numberc tj|f||||d|tdtz dtz |_dS)NrVrrrrXs rr8zEF_START_HFN.__init__sLS4dDSSFSSS G!3Z5GHHr)rrTrrrrrAs@rrrsh hHHJOIOCIIIIIIIIIIrrc2eZdZdddifgZ d fd ZxZS) EF_THRESHOLDf01000 max_starti6f5crU EF.THRESHOLDrMaximum value of STARTc ~tj|f||||d|tdtz |_dS)NrVrrrXs rr8zEF_THRESHOLD.__init__sES4dDSSFSSS W!455r)rrUrrrrrAs@rrrs[ k8-/OIO.6666666666rrc*eZdZ d fd ZdZxZS) EF_RPLMNAcT6f65N EF.RPLMNAcTDrErGrE!RPLMN Last used Access Technologyc Htj|f|||||d|dSrr r;r<r3r4rWr6r5r=r>s rr8zEF_RPLMNAcT.__init__s7d4dDRYdd]cdddddrc t|Sr)dec_act)r;rr=s r_decode_record_hexzEF_RPLMNAcT._decode_record_hexsvr)rNrrrEr)rrrr8rr@rAs@rrrsXXY9eeeeeerrc$eZdZ dfd ZxZS) EF_VGCSCA6fd4N EF.VGCSCArErrE,Voice Group Call Service Ciphering Algorithmc tj|f|||||d|tdtz dtz |_dS)Nr alg_v_ki_1 alg_v_ki_2r7r8rr rrs rr8zEF_VGCSCA.__init__sPd4dDRYdd]cddd f!4l66IJJr)rNrrrErrrAs@rrrsMWXDKKKKKKKKKKrrc$eZdZ dfd ZxZS)EF_GBABP6fd6NEF.GBABPrFrGBA Bootstrapping parametersc tj|f||||d|tdtz dtz dtz |_dS)NrVrandb_tid key_lifetime)r7r8rLVrrXs rr8zEF_GBABP.__init__sQS4dDSSFSSS GBJr8IJJr)rNrrrrrAs@rrrsMDK4KKKKKKKKKKrrc eZdZdfd ZxZS)EF_MSK6fd7NEF.MSKMBMS Service Key Listc "tjd ||||dd|tdtz dtz }tdt t dz dt z d|tjz |_ dS) N)r[Nrmsk_idtimestamp_counter key_domain_idrF num_msk_idmsk_idsr) r7r8rrrrr r rr)r;r<r3r4r5r= msk_ts_constrr>s rr8zEF_MSK.__init__s`St$T:``Y_```x/1DW1LMM  E!HH1E1E!E!-f!4!*=+I!IKKr)rNrrrrAs@rrrsGKKKKKKKKKKrrceZdZGddedZGddedZGdd ed eeg ZGd d edZGddeeegZ dfd Z xZ S)EF_MUKc$eZdZeeZdS)EF_MUK.MUK_IdrNrrrrMUK_IdrrrGrrrrc$eZdZeeZdS)EF_MUK.MUK_IdiNrrrrMUK_IdirrGrrrceZdZdS) EF_MUK.MUK_IDNr'rrrMUK_IDrrNrrr*r+ceZdZdS)EF_MUK.TimeStampCounterNr'rrrTimeStampCounterrrNrrrceZdZdS)EF_MUK.EF_MUK_CollectionNr'rrrEF_MUK_Collectionr rNrr rO6fd8NEF.MUK MBMS User Keyc htjd||||dd|tj|_dSNNNrr)r7r8rr r9rs rr8zEF_MUK.__init__s<bSt$T<bb[abbb, r)r Nr r) rrrr?rrrrrYr r8r@rAs@rrrs@-----*$---------*$----     w.@         :4         -v?O6P    ----------rrceZdZGddedZGddedZGdd eeeg Zdfd ZxZS)EF_GBANLc$eZdZeeZdS)EF_GBANL.NAF_IDNrrrrNAF_IDrrGrrrrc$eZdZeeZdS)EF_GBANL.B_TIDNrrrrB_TIDrrGrrrceZdZdS)EF_GBANL.EF_GBANL_CollectionNr'rrrEF_GBANL_CollectionrrNrrrO6fdaNEF.GBANL GBA NAF Listc htjd||||dd|tj|_dSr)r7r8rrr9rs rr8zEF_GBANL.__init__s<bSt$T<bb[abbb0 r)rNrr) rrrr?rrrr8r@rAs@rrrs-------------- ----     j&%    1111111111rrc<eZdZdddifdddifgZ d fd ZxZS) EF_EHPLMNPI00presentation_ind no_preference02 display_all6fdbN EF.EHPLMNPIrrc tj|f||||d|tdttdddz |_dS)NrVr$rrDrE)r%display_highest_prio_onlyr'r7r8rrmrnrrXs rr8zEF_EHPLMNPI.__init__scS4dDSSFSSS !3!%d!WXfg!h!h!h"ijjr)r(Nr)rrrrAs@rr"r"st #_57 $m57OHN@jjjjjjjjjjrr"cDeZdZGddedZ d fd ZxZS) EF_NAFKCAc$eZdZeeZdS)EF_NAFKCA.NAF_KeyCentreAddressNrrrrNAF_KeyCentreAddressr0rGrr1rr6fddN EF.NAFKCArNAF Key Centre Addressc htjd|||||d|tj|_dSNrr)r7r8r.r1r9r:s rr8zEF_NAFKCA.__init__<]St$T7]]V\]]]2 r)r2Nr3rr4)rrrr?r1r8r@rAs@rr.r.st-----zt----HT.3333333333rr.c eZdZGddedZGddedZGdd ed ZGd d ed ZGddedZGdde eeeegZ dfd Z xZ S) EF_NCP_IPcdeZdZedeeddz dez deez Z dS)EF_NCP_IP.DataDestAddrRangetype_of_addressrkr)IPv4IPv6 prefix_lengthprefixN) rrrrrmrnr rrrrrrDataDestAddrRanger;sRV-dd4d.N.N.NN+F2$ZZ %<%<<>> rrArrc$eZdZeeZdS)EF_NCP_IP.AccessPointNameNrrrrAccessPointNamerCrvrrDrc$eZdZeeZdS)EF_NCP_IP.LoginNrrrGsmStringAdapterrrrrrLoginrF %%k22 rrIrc$eZdZeeZdS)EF_NCP_IP.PasswordNrGrrrPasswordrLrJrrMrceZdZdS)EF_NCP_IP.BearerDescriptionNr'rrrBearerDescriptionrO rrPrceZdZdS)EF_NCP_IP.EF_NCP_IP_CollectionNr'rrrEF_NCP_IP_CollectionrSrQrrTrO6fe2N EF.NCP-IPr7Network Connectivity Parameters for USIM IP connectionsc htjd|||||d|tj|_dSr6)r7r8r9rTr9r:s rr8zEF_NCP_IP.__init__r7r)rUNrVrrW) rrrTLV_IErArDrIrMrPrYrTr8r@rAs@rr9r9sy>>>>>F>>>> -----&d----33333D3333333336t3333     F         0'6xIZ&[    IUO3333333333rr9c$eZdZ dfd ZxZS) EF_EPSLOCI6fe3rh EF.EPSLOCIEPS Location InformationrXrXc tj|f||||d|ttddd}t dt t dz dt t d z d |z |_dS) NrVrrDrEupdated not_updatedroaming_not_allowedgutirQlast_visited_registered_tairHeps_update_statusr7r8rmrnrrrr) r;r<r3r4r5rWr=upd_status_constrr>s rr8zEF_EPSLOCI.__init__!sS4dDSSFSSS !CCC  599(=(=!=!>z%PQ((?S?S!S!45F!FHHr)r\rhr]r^r_rrAs@rr[r[ sM3?7>HHHHHHHHHHrr[c eZdZGddedZGddedZGdd ed ZGd d ed ZGddedZGddedeeeeegZ dfd Z xZ S) EF_EPSNSCceZdZeZdS)EF_EPSNSC.KSI_ASMENr rrrKSI_ASMErm,r rrnrrc$eZdZeeZdS)EF_EPSNSC.K_ASMENrrrrK_ASMErp/rGrrqrceZdZeZdS)EF_EPSNSC.UplinkNASCountNrrrrrrs2rrrrceZdZeZdS)EF_EPSNSC.DownlinkNASCountNrrrrrru5rrrrc$eZdZeeZdS)EF_EPSNSC.IDofNASAlgorithmsNrrrrIDofNASAlgorithmsrw8rGrrxrceZdZdS)"EF_EPSNSC.EPS_NAS_Security_ContextNr'rrrEPS_NAS_Security_Contextrz;s rr{r*r+6fe4r` EF.EPSNSCrrEPS NAS Security Contextc htjd|||||d|tj|_dSr6)r7r8rkr{r9r:s rr8zEF_EPSNSC.__init__?s<]St$T7]]V\]]]6 r)r|r`r}r~r) rrrr?rnrqrrrxr{r8r@rAs@rrkrk+s:4---------:4-----JD----     :4+3V^M]+<+>    IR07777777777rrkc4eZdZdddddifgZd fd ZxZS) EF_PWSr#pws_configurationF"ignore_pws_in_hplmn_and_equivalentignore_pws_in_vplmn6fecNEF.PWSPublic Warning Systemrc tj|f||||d|ttdd}t d|z |_dS)NrVrDrErrr7r8rrnrr) r;r<r3r4r5rWr= pws_configr>s rr8zEF_PWS.__init__JsdS4dDSSFSSS QAOOO  !4Z!?@@r)rNrrrrrAs@rrrEsq %u@E(H(HJ LOAAAAAAAAAArrc$eZdZ dfd ZxZS)EF_IPS6ff1NEF.IPSrGrGIMEI(SV) Pairing Statusc tj|f||||d|tdtddz dtz dt z |_dS)Nr2rrErlink_to_ef_ipdrB)r7r8rrr rnrr:s rr8zEF_IPS.__init__RsdY4dwYYRXYYY ,q'*B*B!B!1&!8%*FFr)rNrrrrrAs@rrrQsMEK/FFFFFFFFFFrrcteZdZdddddifdddddifd dd d difgZGd d edZdfd ZxZS) EF_ePDGId&801100657064672e6f736d6f636f6d2e6f7267e_pdg_idFQDNzepdg.osmocom.org)type_of_ePDG_address ePDG_address800501c0a8a001r=z 192.168.160.1&80110220010db8000000000000000000000023r>z 2001:db8::23c eZdZedeedddz deeje e e e e e dz Z dS)EF_ePDGId.ePDGIdrrrDrE)rr=r>rN)rrrrrmrnr r r Utf8Adapterr Ipv4Adapter Ipv6AdapterrrrrePDGIdr_sV24411ST3U3U3UU*66$2K;F;{;S;S;F;{;S;S;F;{;S;S3U3U,V,VVWW rrrr6ff3N EF.ePDGIdHome ePDG Identifierc ftj|f|||d|tj|_dSNr3r4r5)r7r8rrr9rs rr8zEF_ePDGId.__init__fs9H4dHHHHH$ r)rNrr)rrrrr?rr8r@rAs@rrrYs 2ZZ`tFBHBH5J L Z&[j)l)lnp 2ZZ`tBBDBD5F HO WWWWWWWWW%%%%%%%%%%rrceZdZddddddgifdddd d dgifd dd d d dgifgZGd dedZdfd ZxZS)EF_ePDGSelection800600f110000100e_pdg_selectionz001-01rDoperator_identified)plmn epdg_priorityepdg_fqdn_format800600110000a001z001-001r*location_based800600011000a001z001-010c eZdZeedeedz dez dee ddz Z dS) EF_ePDGSelection.ePDGSelectionrrFrrrrD)rrN) rrrrrrNrr rmr rrrr ePDGSelectionrqsm [{{5588/D/D(D(7(?(:44\]no;p;p;p(p"r"rss rrrr6ff4NEF.ePDGSelectionePDG Selection Informationc ftj|f|||d|tj|_dSr)r7r8rrr9rs rr8zEF_ePDGSelection.__init__vs9H4dHHHHH$2 r)rNrr)rrrrr?rr8r@rAs@rrrks 0HWXoD4F4F3GI J 0IX[rB4D4D3EG H 0IX[rB4D4D3EG HO sssss ssss 3333333333rrc$eZdZ dfd ZxZS)EF_FromPreferred6ff7NEF.FromPreferredrrc tj|f||||d|tdtdz dtz |_dS)NrVrBrKfrom_preferredr7r8rrkFlagrrXs rr8zEF_FromPreferred.__init__|sSS4dDSSFSSS#E'!**$46Ft6KLLr)rNrrrrrAs@rrr{sMLR&MMMMMMMMMMrrlatitude longitudec eZdZddddiddddd d dd d dgigigfd dddiddddd d dd d dgiddddd d dd d ddddgigigfddddiddddd d dd d dgigidddiddddddddddgigigfgZGddedZGddedZGdd ed!eeg"ZGd#d$eeg%Z d,fd+ Z xZ S)- EF_EARFCNList8a01a8004000100008112000001100001000002100002000003100003earfcn_list_tlvearfcnigeographical_arearDi)rrrEirFila03480040001000081120000011000010000021000020000031000038118000001100001000002100002000003100003000004100004rGipa01a8004000100008112000001100001000002100002000003100003a01a8004000200008112000011100011000012100012000013100013irVirXirZiceZdZeZdS)EF_EARFCNList.EarfcnNrrrrEarfcnrrrrrrc$eZdZeeZdS)EF_EARFCNList.GeographicalAreaN)rrrrGadPointrrrrGeographicalArears [** rrrceZdZdS)EF_EARFCNList.EarfcnListTlvNr'rrr EarfcnListTlvrrNrrr*r+ceZdZdS)%EF_EARFCNList.EarfcnListTlvCollectionNr'rrrEarfcnListTlvCollectionrrNrrrO6ffdN EF.EARFCNListrhrrc ^tj|f||||d||j|_dSrU)r7r8rr9rXs rr8zEF_EARFCNList.__init__s;S4dDSSFSSS0 r)rNrrr) rrrrr?rrrrYrr8r@rAs@rrrs D %0 31SZ6[6[CDSZ6[6[CDSZ6[6[6] _` a b d x %0 31SZ6[6[CDSZ6[6[CDSZ6[6[6] _!41SZ6[6[CDSZ6[6[CDSZ6[6[CDSZ6[6[6] _ ! # $ & | %0 31SZ6[6[CDSZ6[6[CDSZ6[6[6] _` a &1 32T[6\6\CET[6\6\CET[6\6\6^ `a b  d e'O:+++++:4++++     f=M5N         "3]O    IR61111111111rrc$eZdZ dfd ZxZS)EF_eAKA6f01NEF.eAKArenhanced AKA supportc tj|f||||d|tdtdz dtz |_dS)NrVrBrK"enhanced_sqn_calculation_supportedrrXs rr8zEF_eAKA.__init__sTS4dDSSFSSS#E'!**$46Z[_6_``r)rNrrrrrAs@rrrsMCI,aaaaaaaaaarrc$eZdZ dfd ZxZS)EF_OCST6f02NEF.OCSTr:Operator controlled signal threshold per access technologyc tj|f||||d|tdttdz dt z |_dS)NrVsenserD) sense_enabledocst_tlv)r7r8rrrnrrrXs rr8zEF_OCST.__init__s^S4dDSSFSSS 4q)I)I)I!I!+K!799r)rNrrrrrAs@rrrsCCKR9999999999rrc eZdZdfd ZxZS) DF_GSM_ACCESS5F3B DF.GSM-ACCESSrec tjd|||dd|tdddtdddd d td d t dd g}||dS)Nrd)r<r4r5service4f20rD)r<r3r4f52rEz EF.KcGPRSzGPRS Ciphering key KcGPRS)r<r3r4r5r4f63rr)r<r4f64rsr)r7r8r6r7r8 add_filesr;r<r4r5r=filesr>s rr8zDF_GSM_ACCESS.__init__sMSt$MMfMMM f4 4 4 4 f4k@[eg h h h &" - - - 62 . . .   ur)rrrerrAs@rrrs=rrceZdZddddidddddid igifgZGd d ed ZGdded ZGddedeegZdfd ZxZ S)EF_ACSGLa00d800362f21081060000000002e0csg_listrr<csg_informationfrom_other_sourcesidr_csg_typehnb_name_indicationcsg_idc6eZdZeedZdS) EF_ACSGL.PlmnrFN)rrrrNrrrrrPlmnr% [q** rr rrc eZdZedeedz deedz dededz edz Z d S) EF_ACSGL.CsgInformationrr)rrrrrdrHN) rrrrrmr rrlr rrrrCsgInformationr sxVJttFq'I'I'II1$$vRS2T2T2TT$YYtKKOO/CWWQZZ%P%PPRR rr rceZdZdS)EF_ACSGL.CsgListNr'rrrCsgListrrNrrr*r+4f81rDEF.ACSGLAllowed CSG Listsrc jtjd|||||dd|tj|_dSNr)r<r3r4r5rr6r)r7r8rrr9r;r<r3r4r5rr=r>s rr8zEF_ACSGL.__init__s?pSt$T7\eppioppp$ r)rrDrrr) rrrrr?r r rr8r@rAs@rrrs( * **:NEY:> -G-GIK M OO+++++zt++++RRRRRRRRR     *$n/E    %%%%%%%%%%rrceZdZdddigfdddiddigfgZGdded ZGd d ed ZGdded ZGddeeeegZ dfd Z xZ S)EF_CSGT8906810300666f6f text_csg_typefoo48906810300666f6f801068747470733a2f2f666f6f2e6261722fgraphics_csg_type_urizhttps://foo.bar/c$eZdZeeZdS)EF_CSGT.TextCsgTypeNrrr Ucs2Adapterrrrrr TextCsgTyper [-- rr"rrc$eZdZeeZdS)EF_CSGT.GraphicsCsgTypeURINrrrrrrrrrGraphicsCsgTypeURIr%r#rr'rceZdZeZdS)EF_CSGT.GraphicsCsgTypeEfImgNr rrrGraphicsCsgTypeEfImgr)r rr*rceZdZdS)EF_CSGT.Csgt_TLV_CollectionNr'rrrCsgt_TLV_Collectionr,rQrr-rO4f82rEEF.CSGT CSG Typesrc jtjd|||||dd|tj|_dSr)r7r8rr-r9rs rr8zEF_CSGT.__init__s?pSt$T7\eppioppp/ r)r.rEr/r0r) rrrrr?r"r'r*rYr-r8r@rAs@rrrs@ %9:< @ e %)@BT'V W ZO .....jd.........ZT....zt     /&13EG[%\    0000000000rrcNeZdZdddifgZGddedZdfd ZxZS)EF_HNBN800b8108006d61686c7a656974hnb_namemahlzeitc$eZdZeeZdS)EF_HNBN.HnbNameNr rrrHnbNamer8r#rr9rr4f83rFEF.HNBNHome NodeB Namerc jtjd|||||dd|tj|_dSr)r7r8r3r9r9rs rr8zEF_HNBN.__init__s>pSt$T7\eppiopppO r)r:rFr;r<r)rrrrr?r9r8r@rAs@rr3r3s*j*,F GO.....*$....$$$$$$$$$$rr3c eZdZddddidddddid id d igifgZGd d edZGddedejejegZ dfd Z xZ S)EF_OCSGL$a010800362f21081060000000002e0820100operator_csg_listrr<rrrr_rcsg_display_indicatorall_available_csg_idsc*eZdZeeddZdS)EF_OCSGL.CsgDisplayIndicatorrrD)rConly_ocsgl_csg_idsN)rrrrmr rrrrCsgDisplayIndicatorrEs$T&aPPP rrGrrceZdZdS)EF_OCSGL.OperatorCsgListNr'rrrOperatorCsgListrIrNrrJr*r+4f84rGEF.OCSGLOperator CSG Listsrc jtjd|||||dd|tj|_dSr)r7r8r?rJr9rs rr8zEF_OCSGL.__init__s?pSt$T7\eppioppp, r)rKrGrLrMr) rrrrr?rGrr r rJr8r@rAs@rr?r? s  0 &(!3"3CWEY:> 6G6G"I#:;R!T !W Y [OQQQQQjdQQQQ     *$ xG^`s7t    ----------rr?c$eZdZ dfd ZxZS)EF_5GS3GPPLOCI4f01rDEF.5GS3GPPLOCIr[r[5S 3GP location informationc tj|f||||d|ttddd}t dt t dz dt t d z d |z |_dS) NrVrrDrEra5g_gutirR"last_visited_registered_tai_in_5gsrJ5gs_update_statusrh) r;r<r3r4rWr5r=rir>s rr8zEF_5GS3GPPLOCI.__init__$sS4dDSSFSSS !CCC :eBii+@+@!@!EjQVWXQYQYFZFZ!Z!45F!FHHr)rQrDrRrSrTrrAs@rrPrP#sMJR3HHHHHHHHHHrrPc8eZdZdddddifgZ d fd ZxZS) EF_UAC_AIC03uac_access_id_configTmultimedia_priority_servicemission_critical_service4f06rJ EF.UAC_AICr#UAC Access Identities Configurationc tj|f||||d|ttdd}t d|z |_dS)NrVrDrEr]r\r) r;r<r3r4rWr5r= cfg_constrr>s rr8zEF_UAC_AIC.__init__3saS4dDSSFSSSt89;;;  !7 !BCCr)r`rJrarrbrrAs@rrZrZ.s{ (4HL+O+OQ SOGM;DDDDDDDDDDrrZc eZdZdfd ZxZS)EF_OPL5G4f08rMEF.OPL5Grc Vtjd ||||dd|tdtt dz dt t dz dt t dz }td|z dt z |_dS) N)rONrr>rFtac_mintac_maxtai pnn_record_idrrM)r;r<r3r4r5r=Tair>s rr8zEF_OPL5G.__init__<s`St$T:``Y_```Y{588444i 5QR88@T@T6Tz%((33355 sOF,BCCr)rgrMrhrrrAs@rrfrf;sGDDDDDDDDDDrrfceZdZGddedZGddedZGdd ed ZGd d eeeeg Z dfd Z xZ S) EF_SUPI_NAIc$eZdZeeZdS)%EF_SUPI_NAI.NetworkSpecificIdentifierNr&rrrNetworkSpecificIdentifierrrD [-- rrsrrc$eZdZeeZdS) EF_SUPI_NAI.GlobalLineIdentifierNr&rrrGlobalLineIdentifierrvHrtrrwrc$eZdZeeZdS)!EF_SUPI_NAI.GlobalCableIdentifierNr&rrrGlobalCableIdentifierryLrtrrzrceZdZdS)EF_SUPI_NAI.NAI_TLV_CollectionNr'rrrNAI_TLV_Collectionr|PrQrr}rO4f09rN EF.SUPI_NAI!SUPI as Network Access Identifierc ftj|f|||d|tj|_dSr)r7r8rpr}r9rs rr8zEF_SUPI_NAI.__init__Ss9H4dHHHHH2 r)r~rNrr) rrrrYrsrwrzrYr}r8r@rAs@rrprpCs.....F.........v4.........D....     .%>@TVk$l    4A93333333333rrpc eZdZdfd ZxZS)EF_Routing_Indicator4f0arOEF.Routing_IndicatorRouting Indicatorc tj|f|||d|tdtt t dddz dt t dz |_dS)Nrrouting_indicatorrEfrB)r7r8rr6r5rrrrs rr8zEF_Routing_Indicator.__init__Zs|H4dHHHHH !!4T*U1XX:N:NPSUV5W5W!W!&z%((';';!;==r)rrOrrrrAs@rrrYs===========rrcDeZdZGddedZ d fd ZxZS) EF_TN3GPPSNNc$eZdZeeZdS)EF_TN3GPPSNN.ServingNetworkNameNr&rrrServingNetworkNamerfr#rrrr4f0crQ EF.TN3GPPSNN+Trusted non-3GPP Serving network names listc ftj|f|||d|tj|_dSr)r7r8rrr9rs rr8zEF_TN3GPPSNN.__init__hs9H4dHHHHH 3 r)rrQrr)rrrr?rr8r@rAs@rrrest.....ZT....3AC4444444444rrc$eZdZ dfd ZxZS)EF_CAG4f0drREF.CAG&Pre-configured CAG information list EFc vtj|f|||d|tt|_dSrr7r8rrrrs rr8zEF_CAG.__init__o>H4dHHHHH$[11r)rrRrrrrAs@rrrnsC3;>2222222222rrc$eZdZ dfd ZxZS) EF_SOR_CMCI4f0erS EF.SOR-CMCI8Steering Of Roaming - Connected Mode Control Informationc vtj|f|||d|tt|_dSrrrs rr8zEF_SOR_CMCI.__init__vrr)rrSrrrrAs@rrrusC3@P2222222222rrc$eZdZ dfd ZxZS)EF_DRI4f0frTEF.DRIDisaster roaming information EFc Ttj|f|||d|tdtz dt tdddz dt t dz d t t dz d t tz |_dS) Nrdisaster_roaming_enabledparameters_indicator_statusrDrErF)roaming_wait_rangereturn_wait_rangeapplicability_indicatorrrr)r7r8rrnrrrrrs rr8zEF_DRI.__init__}sH4dHHHHH !;D!@!>ybc[\ab@d@d@d"d"6jq6J6J!J!4Za5I5I!I!::d;K;K!K MMr)rrTrrrrAs@rrr|sM3;7 M M M M M M M M M Mrrc$eZdZ dfd ZxZS) EF_PWS_SNPNrQrD EF.PWS_SNPNPublic Warning System in SNPNsc tj|f|||d|tdttddz |_dS)Nrpws_config_in_snpnsrDrE)ignore_all_pws_in_subscribed ignore_all_pws_in_non_subscribed)r7r8rrrnrrs rr8zEF_PWS_SNPN.__init__sgH4dHHHHH !6ydebc8e8e8e"effr)rQrDrrrrAs@rrrsM3@6ffffffffffrrc$eZdZ dfd ZxZS)EF_NID4f02rEEF.NIDNetwork Identifier for SNPNc tj|f|||dd|tdttdddz dt t d z |_dS) Nrr2assignment_moderrDrE)coordinated_ass_opt1self_asscoordinated_ass_opt2network_identifierrH)r7r8rrmrnrrrrs rr8zEF_NID.__init__sW4duWWPVWWW !24STGHST4V4V4V"V"6jq6J6J!JLLr)rrErrrrAs@rrrsM3;3LLLLLLLLLLrrc eZdZdfd ZxZS)DF_SNPN5fe0DF.SNPNFiles for SNPN purposec tjd|||d|tdtdg}||dS)Nr<r4r5rrrr)r7r8rrrrs rr8zDF_SNPN.__init__sfASt$AA&AAA  $ $ $ 3     ur)rrrrrAs@rrr=rrc\eZdZfdZedGddeZxZS)EF_5G_PROSE_STc tjddddddtd||xj|gz c_dS)NrQrDzEF.5G_PROSE_STz5G ProSe Service Table)rDrErr)r7r8EF_5G_PROSE_ST_maprrrs rr8zEF_5G_PROSE_ST.__init__sp hV$5E6UJ\ h h`f h h h  6 6 8 899rrceZdZdZdZdS) EF_5G_PROSE_ST.AddlShellCommandsc||jjj}||jt |ggdS)z(Activate a service within EF.5G_PROSE_STNrrs rdo_prose_service_activatez:EF_5G_PROSE_ST.AddlShellCommands.do_prose_service_activaterrc||jjj}||jgt |gdS)z*Deactivate a service within EF.5G_PROSE_STNrrs rdo_prose_service_deactivatez-J-S-;-I->-U->-K->-[-]     4DA>>>>>>>>>>rr#c eZdZGddedZGddedZGdd ed ZGd d ed ZGddedej eeeegZ dfd Z xZ S)EF_5G_PROSE_UIRceZdZdS) EF_5G_PROSE_UIR.CollectionPeriodNr'rrrCollectionPeriodr2)rNrr3rceZdZdS)EF_5G_PROSE_UIR.ReportingWindowNr'rrrReportingWindowr6+rNrr7ceZdZdS)#EF_5G_PROSE_UIR.ReportingIndicatorsNr'rrrReportingIndicatorsr:-rNrr;ceZdZdS)-EF_5G_PROSE_UIR.FiveGDdnmfCtfAddrForUploadingNr'rrrFiveGDdnmfCtfAddrForUploadingr>/rNrr?ceZdZdS)4EF_5G_PROSE_UIR.ProSeConfigDataForUeToNetworkRelayUENr'rrr$ProSeConfigDataForUeToNetworkRelayUErB1rrrCr*r+r`rJEF.5G_PROSE_UIRrc ftj|f|||d|tj|_dSr)r7r8r0rCr9rs rr8zEF_5G_PROSE_UIR.__init__7s9H4dHHHHH#H r)r`rJrDr) rrrr?r3r7r;r?rrrCr8r@rAs@rr0r0(s\     :4         *$         jd                  zt7E7S7G7J7T7V    4ESIIIIIIIIIIrr0c 4eZdZGddedZGddedZGdd ed ZGd d ed ZGddedZGddedZ GddedZ Gddedeeeeee e gZ d fd Z xZ S)!EF_5G_PROSE_U2URUc$eZdZedZdS)EF_5G_PROSE_U2URU.ValidityTimerrHN)rrrrrrrrrrI?sU1XX rrrrceZdZeZdS)EF_5G_PROSE_U2URU.ServedByNGRANNrrrrrrrr ServedByNGRANrKA rrMrceZdZeZdS)"EF_5G_PROSE_U2URU.NotServedByNGRANNrLrrrNotServedByNGRANrPCrNrrQrceZdZeZdS)*EF_5G_PROSE_U2URU.DefaultDstL2IdsForRxDiscNrLrrrDefaultDstL2IdsForRxDiscrSErNrrTceZdZeZdS))EF_5G_PROSE_U2URU.UserInforIdForDiscoveryNrLrrrUserInforIdForDiscoveryrWGrNrrXrceZdZeZdS)EF_5G_PROSE_U2URU.RSCInfoListNrLrrr RSCInfoListrZIrNrr[rceZdZeZdS).EF_5G_PROSE_U2URU.DefaultDstL2IdsForTxRxDirectNrLrrrDefaultDstL2IdsForTxRxDirectr]KrNrr^ceZdZdS).EF_5G_PROSE_U2URU.ProSeConfigDataForU2URelayUENr'rrrProSeConfigDataForU2URelayUEraMr)rrbr*r+r}rKEF.5G_PROSE_U2URU15G ProSe configuration data for UE-to-UE relay UEc ftj|f|||d|tj|_dSr)r7r8rGrbr9rs rr8zEF_5G_PROSE_U2URU.__init__Rs9H4dHHHHH%B r)r}rKrcrd)rrrr?rrMrQrTrXr[r^rbr8r@rAs@rrGrG>s !!!!! !!!!!!!!!:4!!!!!!!!!:4!!!!!!!!!*$!!!!!!!!!jd!!!!!!!!!zt!!!!     zt/;;;;;;;;;;rrgc eZdZdfd ZxZS) DF_5G_ProSe5ff0 DF.5G_ProSeFiles for 5G ProSe purposec \tjd |||d|ttdt dt dt dtdtdtd g}| |dS) NrrDrrErFrGrHrJrKr) r7r8rrrrr#r0rGrgrrs rr8zDF_5G_ProSe.__init__qsASt$AA&AAA    1 % % % 1 % % % a ( ( ( 1 % % % A & & & a ( ( ( 1 % % %   ur)r|r}r~rrAs@rr{r{ps=          rr{c eZdZGddedZGddedZGdd ed ZGd d ed ZGddedZGddedeegZ Gddedeeee gZ dfd Z xZ S)EF_5MBSUECONFIGc zeZdZedeedz deedz ZdS)EF_5MBSUECONFIG.PlmnrrFnidrJN)rrrrrNrrmrrrrr rsRVF;;uuQxx#8#88!))EE!HH"5"5577 rr rrc eZdZededz deedz deeddz Ze eZ dS) EF_5MBSUECONFIG.TmgitmgirJusd_fidrE service_typerD)mbs_service_announcementmbs_user_serviceN) rrrrrrrrn TmgiEntryrrrrrTmgirsuF6%%((?$ZZa%9%99)))DSTgh*i*i*iikk ![++ rrrc6eZdZeedZdS)EF_5MBSUECONFIG.NrArfcnListrGN)rrrrrrrrr NrArfcnListrr rrrceZdZeZdS)EF_5MBSUECONFIG.DNNNrLrrrDNNrrNrrrceZdZeZdS)EF_5MBSUECONFIG.SNSSAINrLrrrSNSSAIrrNrrrceZdZdS)EF_5MBSUECONFIG.PduInfoListNr'rrr PduInfoListrrNrrrr+ceZdZdS)(EF_5MBSUECONFIG.Plmn5mbsPreconfigurationNr'rrrPlmn5mbsPreconfigurationrrQrrr*rQNEF.5MBSUECONFIG5MBS UE pre-configurationc ftj|f|||d|tj|_dSr)r7r8rrr9rs rr8zEF_5MBSUECONFIG.__init__s9H4dHHHHH#< r)rQNrr) rrrr?r rrrrrrr8r@rAs@rrrs77777zt7777,,,,,zt,,,, +++++jd++++!!!!!jd!!!!!!!!!!!!!     jdC=         :4+/{K*P    4E1==========rrcHeZdZdZGddedZ d fd ZxZS) EF_5MBSUSDzThere can be any number of these files with undefined FID; the FIDs are contained in EF.5BMSUECONFIG. FID range is 4f08...4fffceZdZeZdS)EF_5MBSUSD.USDNrLrrrUSDrrNrrrrN EF.5MBSUSD5MBS User Service Descriptionc \tj|f|||d|t|_dSr)r7r8rr9rs rr8zEF_5MBSUSD.__init__s6H4dHHHHH r)Nrr)rrr__doc__r?rr8r@rAs@rrrs~44!!!!!jd!!!!,85rrc eZdZdfd ZxZS)DF_5MBSUECONFIG5ff1DF.5MBSUECONFIGrc tjd|||d|tg}||dS)Nrr)r7r8rrrs rr8zDF_5MBSUECONFIG.__init__sSASt$AA&AAA     ur)rrrrrAs@rrrrrrc$eZdZ dfd ZxZS) EF_5GSEDRX4f10rU EF.5GSEDRX5GS eDRX Parametersc tj|f|||d|tdttddz dt z |_dS)Nr 5gs_rat_typerDrE)ng_ran sat_ng_ranedrx_cycle_length)r7r8rrrnr rrs rr8zEF_5GSEDRX.__init__s_H4dHHHHH  $qUV0W0W0W!W!4V!;==r)rrUrrrrAs@rrrsC3?+==========rrc$eZdZ dfd ZxZS)EF_5GNSWO_CONF4f11rVEF.5GNSWO_CONF*5G Non-Seamless WLAN Offload configurationc tj|f|||d|tdttddz |_dS)Nr5g_nswo_usage_indrrD)disabledenabledr,rs rr8zEF_5GNSWO_CONF.__init__sTH4dHHHHH !4T$TU5V5V5V!VWWr)rrVrrrrAs@rrrsM3CBXXXXXXXXXXrrc$eZdZ dfd ZxZS) EF_MCHPPLMN4f15r\ EF.MCHPPLMN6Multiplier Coefficient for Higher Priority PLMN searchc |tj|f|||d|tdtz |_dS)Nrmultiplier_coefficientrrs rr8zEF_MCHPPLMN.__init__sDH4dHHHHH !9&!@AAr)rr\rrrrAs@rrrsM3@NBBBBBBBBBBrrc$eZdZ dfd ZxZS)EF_KAUSF_DERIVATION4f16r^EF.KAUSF_DERIVATIONrc tj|f|||d|tdttdz dt t z |_dS)Nrk_ausf_deriv_cfgrD)use_mskrB)r7r8rrrnrrrrs rr8zEF_KAUSF_DERIVATION.__init__scH4dHHHHH !3IdA4N4N4N!NPUV`alVmVmPmnnr)rr^rrrrAs@rrrsM3H7oooooooooorrc eZdZdfd ZxZS)DF_WLAN5f40DF.WLANFiles for WLAN purposec tjd:|||d|tdddddtdd d d d td ddddtdddddtdddddtddddd td!d"d#d$d%td&d'd(d)d*td+d,d-d.d/td0d1d2d3d4td5d6d7d8d9g }||dS);Nr4f41rDz EF.Pseudorrr4f42rEz EF.UPLMNWLANz/User controlled PLMN selector for I-WLAN Accessr4f43rFz EF.OPLMNWLANz3Operator controlled PLMN selector for I-WLAN Accessr4f44rGz EF.UWSIDLz-User controlled WLAN Specific Identifier Listr4f45rHz EF.OWSIDLz1Operator controlled WLAN Specific Identifier Listr4f46rJzEF.WRIrr4f47rKz EF.HWSIDLrr4f48rMz EF.WEHPLMNPIrr4f49rNzEF.WHPIrr4f4arOz EF.WLRPLMNrr4f4brPz EF.HPLMNDAIzHPLMN Direct Access Indicatorrr)r7r8 TransparentEF LinFixedEFrrs rr8zDF_WLAN.__init__sASt$AA&AAA &$ [" M M M &$KUW Y Y Y &$OY[ ] ] ] vt[FPR T T T vt[JTV X X X &$:B H H H vt[=r K K K &$KUW Y Y Y &$  >/ 4 ur)rrrrrAs@rrr=rrc eZdZdfd ZxZS) DF_USIM_5GS5FC0DF.5GS5GS related filesc tjd|||d|tdtdddddtdtd d d d dt d t dt dtdtdtdtdddddtdtdtdtdtdt!dt#dt%dg}||dS) NrrrrrEzEF.5GSN3GPPLOCIz!5GS non-3GPP location informationr5rrrGzEF.5GSN3GPPNSCz(5GS non-3GPP Access NAS Security Contextrrrrr4F0BrPzEF.URSPz#UE Route Selector Policies per PLMNrrrrrrrrrr)r7r8rPrrCrZr[rfrprrrrrrrrrrrrs rr8zDF_USIM_5GS.__init__sASt$AA&AAA 3 ' ' ' 64): CS R R R # & & & &$(8ISV X X X # & & & s # # # c * * * S ! ! !  $ $ $  - - - &$ Dc S S S  % % % 3     $ $ $ 3    s # # # 3 ' ' '  $ $ $  , , ,1 4 ur)rrrrrAs@rrrrrrc$eZdZdZdfd ZxZS)DF_SAIPzThis is not really TS 31.102 but part of the eUICC Profile Package: Interoperable Format Technical Specification as released by TCA (formerly SIMalliance)5FD0DF.SAIP!SIMalliance Interoperable Profilec tjd|||d|tdg}||dS)NrrQ)r<r)r7r8r[rrs rr8zDF_SAIP.__init__>sZASt$AA&AAA & ) ) )  ur)rrr)rrrrr8r@rAs@rrr;sG??rrcheZdZ d fd ZdZedGd d eZxZS) ADF_USIMa0000000871002TADF.USIMNUSIM Applicationc t|||||||xj|gz c_gt dt t ddddt d d d d d ttdttddddddtdddddtdddddtdtddd d!d"d#td$td%td&dd'd(d)*t!t#t%d+d,-t't)d.t+t-d/dd0d1dd2gd3t/d4dd t1d5t3d6t5d t-d7dd8d9d:d2gd;3t7dd;t7d?dd@dAdBt9dCt;dt=dDt?dt?dEddFdGdDt7dHddIdJdKtAd+tCdLtEdMt-dNddOdPd%d:3t7dQddRdSdTtGd%tIgdUtKdVtMdWtOdXtQtSt dYddZd d[t d\dd]d^d_tUd`datWtdbddcddtYdedMdft[dgt-dhddidjdkd%3t7dlddmdnt]dkt_dotadpdTqt7drddsdttduddvdwdxtcdyt7dzdd{d|d}tedytgdytid~tkddtmdtodtmdddddtodddddtqdtqdddddtsdtudtwdtydtdd,ddd)d#t{dt}dtdddddtdddddtdtdddddtdtddddd*tdddddtdtdddddtdddddtdddddttdtdtdddddtdddddtd¬tdìtdĬtdŬtdƬttdǬtdtdȬtttgdɢtddgtd̬tgd͢tddgtdЬttdѬ}|r#|ZtdT|\|dS)N)aidhas_fsr<r3r4r5rE)r36f09rNz EF.KeysPSz*Ciphering and Integrity Keys for PS domain)r56f60rOz EF.PLMNwAcTz4User controlled PLMN Selector with Access Technologyr[rrRr6f39zEF.ACMzAccumulated call meterr)r5r6r6f3ezEF.GID1rWrV6f3fzEF.GID2rYrXrZ6f41zEF.PUCTz!Price per unit and currency table)rHrH)r5rWrrTrJ6f7bzEF.FPLMNzForbidden PLMNs)rQN)r5rWrSrg)r3rrU6f3bzEF.FDNzFixed Dialling Numbersr)r5rext6f3cr\rQ6f49zEF.SDNzService Dialling NumbersrGrF6f4bzEF.EXT2zExtension2 (FDN)6f4czEF.EXT3zExtension2 (SDN)rHrPrM6f83zEF.OCTzOutgoing Call Timer6f4ezEF.EXT5zExtension5 (ICI/OCI/MSISDN)rxr`ra6f4dzEF.BDNzBarred Dialling Numbers6f55zEF.EXT4zExtension4 (BDN/SSC)rK)rErJrlrnrnrorp6f61z EF.OPLMNwAcTrv6f62z EF.HPLMNwAcTz%HPLMN Selector with Access Technologyrw6f06r_6fc4z EF.NETPARzNetwork Parameters6fc5ryrz6fc7zEF.MBDNr|r{6fc8zEF.EXT6zExtension6 (MBDN)r}r~)rr6fcczEF.EXT7zExtension7 (CFIS)6fcdzEF.SPDIrrr6fcfzEF.EXT8zExtension8 (MMSN)r)rrr6fd3)rr<r6fb3zEF.VBSzVoice Broadcast Servicer6fb4zEF.VBSSzVoice Broadcast Service Statusr6fd5zEF.VBSCAz+Voice Broadcast Service Ciphering Algorithmrrr6fd9z EF.EHPLMNrr)rr)rr6fdezEF.SPNIrr6fdfzEF.PNNIrrrr\rhr]zEPS location informationr6fe6zEF.UFCzUSAT Facility Control)rDrU6fe8z EF.NASCONFIGz Non Access Stratum Configurationrr6fedz EF.FDNURIzFixed Dialling Numbers URI)rEr6feez EF.BDNURIzBarred Dialling Numbers URI)rJr6fefz EF.SDNURIzService Dialling Numbers URI)rGr)rr6ff5z EF.ePDGIdEmzEmergency ePDG Identifier)rr6ff6zEF.ePDGSelectionEmz1ePDG Selection Information for Emergency Servicesrrrrrr4r<) rrrrrrrrrrrrrr)rrrrrrrrrrrr)]r7r8rrrrr1rrrCyclicEFrr2r3r4r5r9rQr(rr)rsr*r,r-r.r/r#r!r~rrrrrrrrr"r$rrr9rrr%r&r'r+rrrrr rrrrrrrr"r.rr9r[rkrrrrrr<r=rr>rrr?r@r:rrrrrrr{rrrr0r) r;rr r4r<r3r5has_imsirr>s rr8zADF_USIM.__init__Hs  SSt$UYZZZ  6 6 8 899D t   D IID  FD+E G G GD }T^` b b b D  KKD  b ! ! !D  HHD  VT82FB P P PD  &$ 8R\^ _ _ _D  &$ 8R\^ _ _ _D  2   D  &$ BY[ ] ] ]D " B   #D $    %D & vtZ6Gj Y Y Y'D ( II)D * GG+D , $ + + +-D . HH/D 0 R 1D 2 KK3D 4 640HSTVXRY_` a a a5D 6 64 , , ,7D 8 b ! ! !9D : B   ;D < B   =D > 640JUVXZT[ab c c c?D @ 641CQ O O OAD B 641CQ O O OCD D B   ED F 1   GD H 1   ID J 1   KD L 640Eq Q Q QMD N 641NXZ [ [ [OD P B   QD R R SD T B   UD X 640ISTZ[ \ \ \YD Z 641GQR S S S[D \ 1   ]D ^ >>> * * *_D ` 2   aD b 2   cD d 2   eD f NNgD h NNiD j ~ > > > >rPAYLOADz(Hexstring of encoded payload to ENVELOPEc|jjj|j\}}|jd|d|dS)zSend an ENVELOPE command to the card. This is how a variety of information is communicated from the terminal (modem/phone) to the card, particularly in the context of SIM Toolkit, Proactive SIM and OTA.rKrLN)rrrBenveloperQr rNs r do_envelopez&ADF_USIM.AddlShellCommands.do_envelopesN ,55dlCCJT2 I   BBB= > > > > >rTPDUzHexstring of encoded SMS TPDUct}|t|jt ddd}t ||g}|jjj t| \}}|j d|d|dS) a?Send an ENVELOPE(SMS-PP-Download) command to the card. This emulates a terminal (modem/phone) having received a SMS with a PID of 'SMS for the SIM card'. You can use this command in the context of testing OTA related features without a modem/phone or a cellular network.networkuicc) source_dev_id dest_dev_id)decoded)childrenrKrLN) rA from_bytesrrUrBrCrrrBrSrrr )r;rEtpdu_iedev_idssms_dlrFrOs rdo_envelope_smsz*ADF_USIM.AddlShellCommands.do_envelope_smssjjG   s49~~ . . .&*3FKKMMMG"Wg,>???F,55c&--//6J6JKKJT2 I   BBB= > > > > >rz--nswo-context store_truez-use SUCI 5G Non-Seamless WLAN Offload context)actionr?c8d}|jrd}|jjj|\}}t }|t||}|j d|dzdS)zSend a GET IDENTITY command to the card. This is part of the procedure for "SUCI calculation performed on USIM" supported by USIM with support for both EF.UST service 124 and 125.rDrEzSUCI TLV Data Object: %ssuci__tlv_data_objectN) nswo_contextrrrB get_identityrrrrr )r;rEcontextrFrGdodo_ds rdo_get_identityz*ADF_USIM.AddlShellCommands.do_get_identitys G  )/-::7CCKT3#%%B KKD " " "::<s rr8zCardApplicationUSIM.__init__5s, XZZG<<<<s rr8z#CardApplicationUSIMnonIMSI.__init__:sK+2EPUPRRR cg>>>>>rrrAs@rrr9s8?????????rr)rrp constructrrmrrrrrr r r r r rrrrr osmocom.utilsr osmocom.tlvosmocom.constructpySim.ts_102_221r6pySim.ts_51_011rrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9pySim.filesystempySim.ts_31_102_telecomr:r;pySim.ts_31_103_sharedr<r=r>r?r@ pySim.catrArBrCrrrr?rrrrrCr[ TransRecEFrrrrrr9rQrsr3r~rrrrrrrrrrrrrr"r.r9r[rkrrrrrrrrrCardDFrrrr3r?rPrZrfrprrrrrrrrrrrrr#r0rGrgr{rrrrrrrrrrrrCardADFrrCardApplicationr|rrrrrs, ++++++eeeeeeeeeeeeeeeeeeeeeeQQQQQQQQQQQQQQQQ######HHHHHHHHHHHHHH^^^^^^^^^^^^^^^^^^TTTTTTTTTTTTTTTTTTddddddddddddddddddddVVVVVVVVVVVVVVVV8888888888######BBBBBBBB[[[[[[[[[[;;;;;;;;??????????SS%S}S' S | S & S|S0S0S%S-S1S S6S+S 2!S""#SS$"%S&'S(>)S*+S, -S.4/S0A1S2$3S45S6 7S8"9S:";S<=S> ?S@ ASBCSD ESSSF GSH(ISJ#KSLMSNOSPQSRSSTBUSV/WSX YSZ[S\]S^"_S`+aSb+cSd'eSf.gSSSh,iSj kSl&mSn*oSp;qSr9sSt6uSv wSx9ySz={S|#}S~'S@ASBCSD(ESF%GSH2ISSSJKSL:MSNOSP;QSR2SST)USV&WSX5YSZ[S\$]S^ _S`9aSb.cSd9eSf*gSh%iSj-kSSSl9mSn4oSpqSr sSt:uSv wSx(ySz/{S|(}S~'S@2ASB#CSDESFGSH "ISJKSL #MSSSN OSP 'QSR 3SST 1USV 4WSXYSZ[S\ G]S^ J_S` aSb LcSd eSf !gSh iSj kSl (mSnoSSSp "qSr )sSt .uSv !wSx 2ySz '{S| (}S~ jS@ .ASB !CSD 5ESF ;GSH #ISJ *KSL )MSN ?OSP aQSSR / #  : )  - ] * ,eSSS l:=?2D && )))))))));;;;;J;;;B 0 0 0 0 0M 0 0 0 {8{8{8{8{8 {8{8{8|+++++J+++(RRRRRmRRR!!!!! !!!-`-`-`-`-` -`-`-`b-.-.-.-.-.Z-.-.-.b k k k k km k k k      M    FRRRRR RRR K K K K KX K K K K K K K KX K K KCCCCCXCCCaaaaajaaa @@@@@ @@@&WWWWW]WWWIIIII=III66666=666*KKKKK KKKKKKKK}KKKKKKKKZKKK-----Z---* 1 1 1 1 1z 1 1 1 j j j j j- j j j33333 33333333 333>HHHHHHHH77777 7774 A A A A A] A A AFFFFFXFFF%%%%% %%%$ 3 3 3 3 3} 3 3 3 MMMMM}MMM 6*W$k'&9 : :*1*1*1*1*1M*1*1*1Zaaaaamaaa99999m999     F   "%%%%%z%%%*00000j000*$$$$$j$$$-----z---0HHHHH]HHH D D D D D D D DDDDDDzDDD33333-333, = = = = == = = =44444=44422222]22222222-222 M M M M M] M M Mfffff-fffLLLLLZLLLf@@@@@%@@@(AAAAA]AAA<EEEEE]EEE0KKKKK KKKD>>>>>]>>>.IIIIImIII,CCCCC CCC4;;;;;];;;0&"=====m===6f========XXXXX]XXXBBBBB-BBBooooo-ooof:     V   v@&@     f   ^Z^Z^Z^Z^Zw^Z^Z^ZF5F'AK  =====/=== ??????????r