📄 aci_ext_pers.h
字号:
/*
+-----------------------------------------------------------------------------
| Project :
| Modul : J:\g23m-aci\aci_ext\aci_ext_pers.h
+-----------------------------------------------------------------------------
| Copyright 2002 Texas Instruments Berlin, AG
| All rights reserved.
|
| This file is confidential and a trade secret of Texas
| Instruments Berlin, AG
| The receipt of or possession of this file does not convey
| any rights to reproduce or disclose its contents or to
| manufacture, use, or sell anything it may describe, in
| whole, or in part, without the specific written consent of
| Texas Instruments Berlin, AG.
+-----------------------------------------------------------------------------
| Purpose :
+-----------------------------------------------------------------------------
*/
#ifndef ACI_EXT_PERS_H
#define ACI_EXT_PERS_H
/* ACI extension definitions */
#define PERSONALISATION_MAX 15 /* maximal amount of personalisation variants per personalisation check */
/* Globals ------------------------------------------------------------------------------ */
typedef enum
{
SIMLOCK_FAIL = -1,
SIMLOCK_DISABLED, /* No SIM lock check has to be done */
SIMLOCK_ENABLED, /* A SIM lock check has to be executed*/
SIMLOCK_BLOCKED, /* The SIM is blocked, i.e. because of a (or to many) wrong PIN(s) */
SIMLOCK_LOCKED /* The ME is locked because of wrong SIM */
} T_SIMLOCK_STATUS;
typedef enum
{
SIMLOCK_NETWORK = 0, /* Network personalisation */
SIMLOCK_NETWORK_SUBSET, /* Network subset personalisation */
SIMLOCK_SERVICE_PROVIDER, /* Service provider personalisation */
SIMLOCK_CORPORATE, /* Corporate personalisation */
SIMLOCK_SIM, /* SIM personalisation */
SIMLOCK_FIRST_SIM /* ME is not personalized and will be personalisation to first
SIM inserted into the ME */
} T_SIMLOCK_TYPE;
#define NO_SP_DEFINED 255 /* If service provider (SP) code holds FF, no SP code is defined */
#define NO_CORP_DEFINED 255 /* If corporate code holds FF, no corporate code is defined */
/*
This is the global status record for all potential personalisation locks.
It is similair to the record decribed in the Condat document 8415_001: EFsimlck.
*/
typedef struct
{
UBYTE locks1; /* 4 lock stati: T_SIMLOCK_STATUS in two bytes per lock. From lower to higher: plock, nlock, nslock, splock*/
UBYTE locks2; /* 2 lock statu: T_SIMLOCK_STATUS in two bytes per lock. From lower to higher: clock, firstSIM, RESERVED, RESERVED*/
UBYTE cnt; /* lock counter */
UBYTE maxcnt; /* lock counter */
UBYTE PKey[8]; /* SIM control key */
UBYTE SPKey[8]; /* SP control key */
UBYTE NSKey[8]; /* NS control key */
UBYTE CKey[8]; /* corporate control key */
UBYTE NKey[8]; /* network control key */
UBYTE PUK[8]; /* Global PUK for all locks */
} T_ACI_PERS_STATUS;
#define T_ACI_PERS_STATUS_LEN 44
#define T_ACI_PERS_STATUS_PUK_LEN 52
/*
* locks1
*/
#define plock 0x00000003,0 /* mask and shiftvalue to get plock from locks1 */
#define plockm 0x00000003 /* mask to get plock from locks1 */
#define plocks 0 /* shiftvalue to get plock from locks1 */
#define nlock 0x0000000C,2
#define nlockm 0x0000000C
#define nlocks 2
#define nslock 0x00000030,4
#define nslockm 0x00000030
#define nslocks 4
#define splock 0x000000C0,6
#define splockm 0x000000C0
#define splocks 6
/*
* locks2
*/
#define clock 0x00000003,0
#define clockm 0x00000003
#define clocks 0
#define flock 0x0000000C,2
#define flockm 0x0000000C
#define flocks 2
/*
Personalisation data needed to be stored inside the ME to check a
network, network subnet or SIM personalisation lock.
*/
typedef struct
{ /* encoded IMSI: 15 digits in 9 bytes. Some digits might be ignored depending on the personalisation check */
UBYTE c_field; /* Octet 1: Length indicator */
UBYTE imsi[MAX_IMSI-1]; /* Octed 2...9: Parity and IMSI digit 1...15. Unused nibbles are set to 1111b */
} T_ACI_PERS_DATA_NW;
typedef struct
{
UBYTE count; /* count of personalisation variants saved in this array */
T_ACI_PERS_DATA_NW data[PERSONALISATION_MAX];
} T_ACI_PERS_DATAS_NW;
/*
Personalisation data needed to be stored inside the ME to check a
service provider personalisation lock.
*/
typedef struct
{
UBYTE c_field; /* length of imsi */
UBYTE imsi[MAX_IMSI-1]; /* encoded IMSI: 15 digits in 9 bytes. Some digits might be ignored depending on the personalisation check */
UBYTE gid1; /* Valid SP code. SP code is found in the first byte of the GID1 file (see GSM 11.11 [ETS 300 977]) */
} T_ACI_PERS_DATA_SP;
typedef struct
{
UBYTE count; /* count of personalisation variants saved in this array */
T_ACI_PERS_DATA_SP data[PERSONALISATION_MAX];
} T_ACI_PERS_DATAS_SP;
/*
Personalisation data needed to be stored inside the ME to check a
corporate personalisation lock.
*/
typedef struct
{
UBYTE c_field; /* length of imsi */
UBYTE imsi[MAX_IMSI-1]; /* encoded IMSI: 15 digits in 9 bytes. Some digits might be ignored depending on the personalisation check */
UBYTE gid1; /* Valid SP code. SP code is found in the first byte of the GID1 file (see GSM 11.11 [ETS 300 977]) */
UBYTE gid2; /* Valid corporate code. Corporate code is found in the first byte of the GID2 file (see GSM 11.11 [ETS 300 977]) */
} T_ACI_PERS_DATA_CP;
typedef struct
{
UBYTE count; /* count of personalisation variants saved in this array */
T_ACI_PERS_DATA_CP data[PERSONALISATION_MAX];
} T_ACI_PERS_DATAS_CP;
/*
In order to return personalisation data in a "generic" way, this union is defined.
*/
typedef union {
T_ACI_PERS_DATAS_NW nw;
T_ACI_PERS_DATAS_SP sp;
T_ACI_PERS_DATAS_CP cp;
} T_ACI_PERS_DATAS;
/* prototypes of the aci_personalisation functions.-------------------------------------- */
/*
Initialisation of this extension. Might be used to initialise variables, set temporary data to default values and so on.
This method will be called before any other public method of this extension.
*/
void aci_ext_personalisation_init( void );
/*
ACI extension method for retrieving the data for one single personalisation type.
This personalisation data is stored into a separate customer managed memory area
and the customer has to implement this extension method to return the actual data
of the questioned personalisation type.
*/
T_ACI_PERS_DATAS aci_ext_personalisation_get_data( T_SIMLOCK_TYPE personalisation_type );
/*
ACI extension method for retrieving the status of a single personalisation type.
The personalisation status is stored in a separate customer managed memory area
and the customer has to implement this extension method to return the actual status
of the questioned personalisation type.
*/
T_SIMLOCK_STATUS aci_ext_personalisation_get_status( T_SIMLOCK_TYPE personalisation_type );
/*
ACI extension method for retrieving the status of a single personalisation type.
The personalisation status is stored in a separate customer managed memory area
and the customer has to implement this extension method to return the actual status
of the questioned personalisation type.
*/
T_SIMLOCK_STATUS aci_ext_personalisation_set_status( T_SIMLOCK_TYPE personalisation_type,
T_SIMLOCK_STATUS lock, char* passwd);
/* If personalisation on first SIM is enabled, transport the given IMSI to the SIM personalisation area */
void aci_ext_personalisation_checkfirstsim( void );
#endif /* ACI_EXT_PERS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -