securitydialogs/simlockui/inc/SimLockISAServerDefinitions.h
changeset 1 d5423fbb4f29
equal deleted inserted replaced
0:164170e6151a 1:d5423fbb4f29
       
     1 /*
       
     2 * ============================================================================
       
     3 *  Name         : SimLockISAServerDefinitions.h
       
     4 *  Part of      : Sim Lock UI Application
       
     5 *  Description  : Definitions for Sim Lock ISA Server
       
     6 *  Version      : 
       
     7 *  
       
     8 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     9 * All rights reserved.
       
    10 * This component and the accompanying materials are made available
       
    11 * under the terms of "Eclipse Public License v1.0"
       
    12 * which accompanies this distribution, and is available
       
    13 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    14 *
       
    15 * Initial Contributors:
       
    16 * Nokia Corporation - initial contribution.
       
    17 *
       
    18 * Contributors:
       
    19 *
       
    20 * Description:   Build info file for Ado domain appinstall 
       
    21 * ============================================================================
       
    22 */
       
    23 
       
    24 #ifndef SimLockISAServerDefinitions_H
       
    25 #define SimLockISAServerDefinitions_H
       
    26 
       
    27 // INCLUDES
       
    28 #include <e32base.h>
       
    29 
       
    30 // =============================================    
       
    31 // Convert to little endian
       
    32 // =============================================    
       
    33 
       
    34 // Macro to convert big endian to native type
       
    35 // EPOC ARM is little endian
       
    36 #define BE2INT16( x )     ( ( ( ( x ) & 0xFF00 ) >> 8 ) |( ( ( x ) & 0x00FF ) << 8 ) )
       
    37 
       
    38 
       
    39 // =============================================    
       
    40 // From Simlock_lock.h in cellmo: ISA server
       
    41 // =============================================
       
    42 
       
    43 // MACROS
       
    44 
       
    45 #define SIMLOCK_PROFILE_SIZE 8
       
    46 #define SIMLOCK_CONFIG_SIZE  8      
       
    47 
       
    48 /* Block status */
       
    49 typedef TUint8 SL_BLOCK_STATUS;
       
    50 #define SL_BLOCK_NOT_DISCARD     0x00
       
    51 #define SL_BLOCK_DISCARD         0x01
       
    52 #define SL_BLOCK_PERMANENT       0x02
       
    53 #define SL_BLOCK_MANDATORY       0x03 
       
    54 
       
    55 /* Requirement status */
       
    56 typedef TUint8 SL_LOCKTYPE;
       
    57 #define SL_LOCKTYPE_AUTO   0x01
       
    58 #define SL_LOCKTYPE_CLOSED 0x02
       
    59 #define SL_LOCKTYPE_OPEN   0x03 
       
    60 
       
    61 
       
    62 /* Criteria */
       
    63 typedef TUint8 SL_OPERATOR;
       
    64 #define SL_OP_BYTEWISE_DISTINCT_EQ    0x01
       
    65 #define SL_OP_BYTEWISE_DISTINCT_GTE   0x02
       
    66 #define SL_OP_BYTEWISE_DISTINCT_LTE   0x03
       
    67 #define SL_OP_BYTEWISE_DISTINCT_NEQ   0x04
       
    68 #define SL_OP_NIBBLEWISE_DISTINCT_EQ  0x05
       
    69 #define SL_OP_NIBBLEWISE_DISTINCT_GTE 0x06
       
    70 #define SL_OP_NIBBLEWISE_DISTINCT_LTE 0x07
       
    71 #define SL_OP_NIBBLEWISE_DISTINCT_NEQ 0x08
       
    72 #define SL_OP_BITWISE_DISTINCT_NEQ    0x09
       
    73 #define SL_OP_BYTEWISE_UNIFIED_GTE    0x0A
       
    74 #define SL_OP_BYTEWISE_UNIFIED_LTE    0x0B
       
    75 #define SL_OP_BYTEWISE_UNIFIED_NEQ    0x0C   
       
    76 #define SL_OP_NIBBLEWISE_UNIFIED_GTE  0x0D
       
    77 #define SL_OP_NIBBLEWISE_UNIFIED_LTE  0x0E
       
    78 #define SL_OP_NIBBLEWISE_UNIFIED_NEQ  0x0F
       
    79 #define SL_OP_BITWISE_DISTINCT_EQ     0x10
       
    80 #define CRITERIA_MAXIMUM 0x10 
       
    81 
       
    82 
       
    83 /* No mask( all data counts ) */
       
    84 #define SIMLOCK_MASK_NOT_DEF 0x0000
       
    85 
       
    86 // DATA TYPES
       
    87 
       
    88 // Sim Lock data structures 
       
    89 struct TSimLockConfigStr
       
    90     {
       
    91     TUint8 Byte[SIMLOCK_CONFIG_SIZE];
       
    92     };
       
    93 
       
    94 struct TSimLockProfileStr
       
    95     {
       
    96     TUint8 Byte[SIMLOCK_PROFILE_SIZE];
       
    97     };
       
    98 
       
    99 /* An aboslute path on SIM card */
       
   100 struct TSimPathStr
       
   101     {
       
   102     TUint8 ah;
       
   103     TUint8 al;
       
   104     TUint8 bh;
       
   105     TUint8 bl;
       
   106     TUint8 ch;
       
   107     TUint8 cl;
       
   108     TUint8 dh;
       
   109     TUint8 dl;
       
   110     }; /* sizeof( SIM_PATH_STR ) = 8 */
       
   111     
       
   112 #define SIM_PATH_SIZE sizeof( TSimPathStr )
       
   113 
       
   114 /* A match requirement */
       
   115 struct TSimLockMRStr
       
   116     {
       
   117     TUint32      ReadSpec;
       
   118     TSimPathStr FileId;
       
   119     TUint16      Mask; 
       
   120     TUint16      Offset; 
       
   121     TUint8        DataSize; 
       
   122     TUint8        UnitLength;
       
   123     SL_OPERATOR Criterion;
       
   124     SL_LOCKTYPE LockType;
       
   125     }; /* sizeof( SL_MR_STR ) = 20  */
       
   126     
       
   127 #define SL_MR_STR_SIZE sizeof( TSimLockMRStr )
       
   128 
       
   129 /* A match block */
       
   130 struct TSimLockMBStr
       
   131     {
       
   132     TUint16 Offset; 
       
   133     TUint8  AccessClass;
       
   134     SL_BLOCK_STATUS mbStatus;
       
   135     TUint8  mrCount;
       
   136     TUint8 Reserved1;
       
   137     TUint8 Reserved2;
       
   138     TUint8 Reserved3;
       
   139     }; /* sizeof( SL_MB_STR ) = 8            */
       
   140     
       
   141 #define SL_MB_STR_SIZE sizeof( TSimLockMBStr )
       
   142 
       
   143 /* Sim Lock header */
       
   144 struct TSimLockHeadStr
       
   145     {
       
   146     // Use BB5 Head Str
       
   147     TSimLockProfileStr Profile;             //  !!!! 8 TUint8s
       
   148     TSimLockConfigStr ConfigData;           //  !!!! 8 TUint8s
       
   149  
       
   150     TUint16 Offset;  
       
   151     TUint8 mbCount;
       
   152     TUint8 UnlockCount;
       
   153     TUint8 Reserved1;
       
   154     TUint8 Reserved2;
       
   155     
       
   156     TUint8  Reserved3;
       
   157     TUint8  Reserved4; 
       
   158     }; /* sizeof( SL_HEAD_STR ) = 8 or 24 */
       
   159     
       
   160 #define SL_HEAD_STR_SIZE  ( ( TInt )sizeof( TSimLockHeadStr ) )
       
   161 
       
   162 // CONSTANTS
       
   163 
       
   164 extern TInt KSimLockUnlockAttemptsAvailable;
       
   165 
       
   166 // FUNCTION PROTOTYPES
       
   167 
       
   168 // FORWARD DECLARATIONS
       
   169 
       
   170 
       
   171 #endif // SimLockISAServerDefinitions_H
       
   172 
       
   173 // End of File