commsfwtools/preparedefaultcommsdatabase/src/CommsDatSchema.cpp
changeset 0 dfb7c4ff071f
child 1 21d2ab05f085
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Comms Data Schema Definitions (version 1.1)
       
    15 // Definitions of Symbian OS Comms Database Schema for Version 1.1.
       
    16 // This gives details of the value and value types in each field.
       
    17 // This information is used to validate data entered into the database.
       
    18 // The data schema is version controlled.  New versions may be introduced from time to time.
       
    19 // Then older versions are marked as deprecated and given a planned removal date.
       
    20 // This version (1.1) was introduced with Release 9.1
       
    21 // 
       
    22 //
       
    23 
       
    24 /**
       
    25  @file
       
    26 */
       
    27 
       
    28 
       
    29 
       
    30 // Internal headers
       
    31 #include <e32def.h>
       
    32 #include <metadatabase.h>
       
    33 #include <commsdattypeinfov1_1.h>
       
    34 #include <commsdattypesv1_1.h>
       
    35 
       
    36 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    37 #include <commsdat_internal.h>
       
    38 #include <commsdat_partner.h>
       
    39 #endif
       
    40 
       
    41 #include "Commsdat_Log.h"
       
    42 #include "CommsDatInternalDefs.h"
       
    43 
       
    44 #include <comms-infras/commsdatschema.h>
       
    45 
       
    46 
       
    47 
       
    48 using namespace CommsDat;
       
    49 
       
    50 
       
    51 /********************************************************************************************
       
    52 CONTENTS OF THIS FILE
       
    53 
       
    54   1/ Schema of field info for each table
       
    55 		Linking field name, field value type and constraints for the value
       
    56 
       
    57   2/ Utilities to validate meaning of element ids
       
    58 
       
    59   3/ Type Validation Functions
       
    60 		Lookup for type by id and
       
    61 		Function to check container type matches data type
       
    62 */
       
    63 
       
    64 
       
    65 
       
    66 
       
    67 /*********************************************************************************************
       
    68 1/ Schema of type info for each field in each table
       
    69 *****************************************************
       
    70 
       
    71 See MetaDatabase.h for this definition:
       
    72 
       
    73 enum TFieldTypeAttributes
       
    74 **
       
    75 To express type information for all MetaDatabase fields
       
    76 @publishedAll
       
    77 @released
       
    78 **
       
    79 	{
       
    80 	ENoAttrs,
       
    81 	ENotNull,
       
    82 	};
       
    83 
       
    84 typedef struct
       
    85 **
       
    86 To express type information for all MetaDatabase fields
       
    87 @publishedAll
       
    88 @released
       
    89 **
       
    90 	{
       
    91 		const TMDBElementId	        iTypeId;
       
    92 		const TInt                  iValType;
       
    93 	    const TFieldTypeAttributes	iTypeAttr;
       
    94         const TText * const         iTypeName;
       
    95 
       
    96 	} SRecordTypeInfo;
       
    97 
       
    98 
       
    99 */
       
   100 
       
   101 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   102 	const SRecordTypeInfo CommsDatSchemaV1_1::iParamsRecordBaseInfo[] = {
       
   103     	{ KCDTIdParamsSTypeId,		EInt,	ENotNull,     KCDTypeNameParamsSTypeId },
       
   104 		{ 0, 0, ENoAttrs, KCDNull }
       
   105 	};
       
   106 #endif
       
   107 
       
   108 	const SRecordTypeInfo CommsDatSchemaV1_1::iServiceRecordBaseInfo[] = {
       
   109     	// CCDRecordBase class
       
   110     	{ KCDTIdRecordTag,	            EInt,   ENoAttrs,   KCDTypeNameRecordTag },
       
   111 		{ KCDTIdRecordName,	            EText,	ENotNull,   KCDTypeNameRecordName },
       
   112 		// this class
       
   113         { KCDTIdServiceEnableLlmnr,     EBool,  ENoAttrs,   KCDTypeNameServiceEnableLlmnr },
       
   114 		{ 0, 0, ENoAttrs, KCDNull }
       
   115 	};
       
   116 
       
   117 
       
   118 	const SRecordTypeInfo CommsDatSchemaV1_1::iBearerRecordBaseInfo[] = {
       
   119     	// CCDRecordBase class
       
   120     	{ KCDTIdRecordTag,	    EInt,	ENoAttrs,   KCDTypeNameRecordTag },
       
   121 		{ KCDTIdRecordName,	    EText,	ENotNull,   KCDTypeNameRecordName },
       
   122 		// this class
       
   123         {KCDTIdBearerAgent,     EText,	ENotNull,     KCDTypeNameBearerAgent },
       
   124 		{ 0, 0, ENoAttrs, KCDNull }
       
   125 	};
       
   126 
       
   127 
       
   128     // 02/  Connection Prefs Record
       
   129     const SRecordTypeInfo CommsDatSchemaV1_1::iConnectionPrefsRecordInfo[] =
       
   130     {
       
   131     	// CCDRecordBase class
       
   132     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   133 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   134 		// this class
       
   135 		{ KCDTIdRanking,	EUint32,	        ENoAttrs,   KCDTypeNameRanking },
       
   136 		{ KCDTIdDirection,	EInt,		        ENoAttrs,   KCDTypeNameDirection },
       
   137 		{ KCDTIdBearerSet,	EUint32,	        ENoAttrs,   KCDTypeNameBearerSet },
       
   138 		{ KCDTIdDialogPref, EUint32,	        ENoAttrs,   KCDTypeNameDialogPref },
       
   139 		{ KCDTIdIAPLink, 	ELinkIAPRecord,  	ENoAttrs,   KCDTypeNameIAP },
       
   140 	     { 0, 0, ENoAttrs, KCDNull }
       
   141     };
       
   142 
       
   143 
       
   144     // 03  Global Settings
       
   145 	const SRecordTypeInfo CommsDatSchemaV1_1::iGlobalSettingsRecordInfo[] =
       
   146     {
       
   147     	// CCDRecordBase class
       
   148     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   149 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   150 		// this class
       
   151 		{ KCDTIdGlobalWapAcessPoint,   		ELinkWAPAPRecord,       ENoAttrs,   KCDTypeNameWAPAccessPoint },
       
   152 		{ KCDTIdMaxConnectionAttempts,	    EInt,	                ENoAttrs,   KCDTypeNameMaxConnectionAttempts },
       
   153 		{ KCDTIdMaxRedialAttempts,		    EInt,	                ENoAttrs,   KCDTypeNameMaxRedialAttempts },
       
   154 		{ KCDTIdSMSBearer,			        EInt,	                ENoAttrs,   KCDTypeNameSMSBearer },
       
   155 		{ KCDTIdSMSReceiveMode,		        EInt,	                ENoAttrs,   KCDTypeNameSMSReceiveMode },
       
   156 		{ KCDTIdGPRSAttachMode,	        	EInt,	                ENoAttrs,   KCDTypeNameGPRSAttachMode },
       
   157 		{ KCDTIdAcceptIncomingGPRS,	        EInt,	                ENoAttrs,   KCDTypeNameAcceptIncomingGPRS },
       
   158 		{ KCDTIdGPRSClassCBearer,	        EInt,	                ENoAttrs,   KCDTypeNameGPRSClassCBearer },
       
   159 		{ KCDTIdModemDataFax,	        	ELinkModemBearerRecord,	ENoAttrs,   KCDTypeNameModemDataFax },
       
   160 		{ KCDTIdModemPhoneServicesSMS,	    ELinkModemBearerRecord,	ENoAttrs,   KCDTypeNameModemPhoneServicesSMS },
       
   161 		{ KCDTIdLocationDataFax,	        ELinkLocationRecord,	ENoAttrs,   KCDTypeNameLocationDataFax },
       
   162 		{ KCDTIdLocationPhoneServicesSMS,	ELinkLocationRecord,	ENoAttrs,   KCDTypeNameLocationPhoneServicesSMS },
       
   163 		{ KCDTIdMaxMBufHeap,	            EInt,	                ENoAttrs,   KCDTypeNameMaxMBufHeap },
       
   164 		{ KCDTIdDefaultAgent,	 	        ELinkAgentLookupRecord,	ENoAttrs,   KCDTypeNameDefaultAgent },
       
   165 		{ KCDTIdDefaultNetwork,	     	    ELinkNetworkRecord,	    ENoAttrs,   KCDTypeNameDefaultNetwork },
       
   166 		{ KCDTIdBearerAvailabilityCheckTSY, EText,                  ENoAttrs,   KCDTypeNameBearerAvailabilityCheckTSY },
       
   167 		{ KCDTIdDefaultSnap,				ELinkAPRecord,	        ENoAttrs,   KCDTypeNameDefaultSnap },
       
   168  		//Name is env dependendent... :((
       
   169 		{ KCDTIdPromptForSnap,				EBool,	                ENoAttrs,   KCDTypeNamePromptForSnap },
       
   170 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   171 		{ KCDTIdDefaultTier,				ELinkTierRecord,	    ENoAttrs,   KCDTypeNameDefaultTier },
       
   172 #endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   173 		{ KCDTIdRegulatoryDomain,			EInt,					ENoAttrs,   KCDTypeNameRegulatoryDomain },
       
   174 		{ KCDTIdWmmEnabled,					EBool,	ENoAttrs,   KCDTypeNameWmmEnabled },
       
   175 		{ KCDTIdEnableCountryCode,			EBool,	ENoAttrs,   KCDTypeNameEnableCountryCode },
       
   176 		{ KCDTIdDefaultRegulatoryDomain,	EInt,	ENoAttrs,   KCDTypeNameDefaultRegulatoryDomain },
       
   177         { 0, 0, ENoAttrs, KCDNull }
       
   178     };
       
   179 
       
   180 
       
   181     // 04/  Network Record
       
   182     const SRecordTypeInfo CommsDatSchemaV1_1::iNetworkRecordInfo[] =
       
   183     {
       
   184     	// CCDRecordBase class
       
   185     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   186 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   187 		// this class
       
   188 		{ KCDTIdHostName,	EText,	ENoAttrs,   KCDTypeNameHostName },
       
   189 	    { 0, 0, ENoAttrs, KCDNull }
       
   190     };
       
   191 
       
   192 
       
   193     // 05/  Location record
       
   194     const SRecordTypeInfo CommsDatSchemaV1_1::iLocationRecordInfo[] =
       
   195     {
       
   196     	// CCDRecordBase class
       
   197 		{ KCDTIdRecordTag,	            EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   198 	    { KCDTIdRecordName,	            EText,		ENotNull,   KCDTypeNameRecordName },
       
   199 		// this class
       
   200 		{ KCDTIdIntlPrefixCode, 		EText,		ENoAttrs,   KCDTypeNameIntlPrefixCode },
       
   201 	    { KCDTIdNatPrefixCode, 			EText,		ENoAttrs,   KCDTypeNameNatPrefixCode },
       
   202     	{ KCDTIdNatCode, 				EText,		ENoAttrs,   KCDTypeNameNatCode },
       
   203     	{ KCDTIdAreaCode, 				EText,		ENoAttrs,   KCDTypeNameAreaCode },
       
   204     	{ KCDTIdDialOutCode, 			EText,		ENoAttrs,   KCDTypeNameDialOutCode },
       
   205     	{ KCDTIdDisableCallWaitingCode, EText,		ENoAttrs,   KCDTypeNameDisableCallWaitingCode },
       
   206     	{ KCDTIdMobile, 				EBool,		ENotNull,   KCDTypeNameMobile },
       
   207     	{ KCDTIdUsePulseDial, 			EBool,		ENotNull,   KCDTypeNameUsePulseDial },
       
   208     	{ KCDTIdWaitForDialTone, 		EBool,		ENotNull,   KCDTypeNameWaitForDialTone },
       
   209     	{ KCDTIdPauseAfterDialOut, 		EUint32,	ENotNull,   KCDTypeNamePauseAfterDialOut },
       
   210         { 0, 0, ENoAttrs, KCDNull }
       
   211     };
       
   212 
       
   213 
       
   214     // 06/  IAP Record
       
   215 	const SRecordTypeInfo CommsDatSchemaV1_1::iIAPRecordInfo[] =
       
   216     {
       
   217     	// CCDRecordBase class
       
   218     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   219 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   220 		// this class
       
   221         { KCDTIdIAPServiceType, 		EText,		        ENotNull,   KCDTypeNameServiceType },
       
   222 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   223     	{ KCDTIdIAPService, 			ELink,		        ENotNull,   KCDTypeNameService },
       
   224 #else
       
   225         { KCDTIdIAPService, 			EInt,		        ENotNull,   KCDTypeNameService },
       
   226 #endif //SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   227     	{ KCDTIdIAPBearerType, 			EText,		        ENotNull,   KCDTypeNameBearerType },
       
   228 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   229     	{ KCDTIdIAPBearer, 				ELink,		        ENotNull,   KCDTypeNameBearer },
       
   230 #else
       
   231         { KCDTIdIAPBearer, 				EInt,		        ENotNull,   KCDTypeNameBearer },
       
   232 #endif //SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   233     	{ KCDTIdIAPNetwork, 			ELinkNetworkRecord,	ENotNull,   KCDTypeNameIAPNetwork },
       
   234     	{ KCDTIdIAPNetworkWeighting,	EUint32,	        ENotNull,   KCDTypeNameNetworkWeighting },
       
   235     	{ KCDTIdIAPLocation, 			ELinkLocationRecord,ENotNull,   KCDTypeNameLocation },
       
   236 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   237      	{ KCDTIdIAPAppSid,	            EUint32,	        ENotNull,   KCDTypeNameAppSid },
       
   238 #endif
       
   239 	    { 0, 0, ENoAttrs, KCDNull }
       
   240     };
       
   241 
       
   242 
       
   243   	const SRecordTypeInfo CommsDatSchemaV1_1::iWAPAccessPointRecordInfo[] =
       
   244   	{
       
   245     	// CCDRecordBase class
       
   246 		{ KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   247   		{ KCDTIdRecordName,     	EText,		ENotNull,   KCDTypeNameRecordName },
       
   248 		// this class
       
   249 		{ KCDTIdWAPCurrentBearer,	EText,		ENotNull,   KCDTypeNameWAPCurrentBearer },
       
   250 		{ KCDTIdWAPStartPage,	    ELongText,  ENoAttrs,   KCDTypeNameWAPStartPage },
       
   251   		{ 0, 0, ENoAttrs, KCDNull }
       
   252   	};
       
   253 
       
   254   	const SRecordTypeInfo CommsDatSchemaV1_1::iDialOutISPRecordInfo[] =
       
   255   	{
       
   256     	// CCDRecordBase class
       
   257 		{ KCDTIdRecordTag,	        	EInt,		ENoAttrs,    KCDTypeNameRecordTag },
       
   258   		{ KCDTIdRecordName,     		EText,		ENotNull,    KCDTypeNameRecordName },
       
   259 		// this class
       
   260 		{ KCDTIdDescription,	 		EText,		ENoAttrs,    KCDTypeNameDescription },
       
   261 		{ KCDTIdType,	 				EInt,		ENoAttrs,    KCDTypeNameType },
       
   262 		{ KCDTIdDefaultTelNum,	 		EText,		ENoAttrs,    KCDTypeNameDefaultTelNum },
       
   263 		{ KCDTIdDialResolution,	 		EBool,		ENotNull,    KCDTypeNameDialResolution },
       
   264 		{ KCDTIdChargecard,	 			ELinkChargecardRecord,		ENoAttrs,    KCDTypeNameChargecard },
       
   265 		{ KCDTIdUseLoginScript,	 		EBool,		ENotNull,    KCDTypeNameUseLoginScript },
       
   266 		{ KCDTIdLoginScript,	 		ELongText,  ENoAttrs,    KCDTypeNameLoginScript },
       
   267 		{ KCDTIdPromptForLogin,	 		EBool,		ENotNull,    KCDTypeNamePromptForLogin },
       
   268 		{ KCDTIdLoginName,	 			EMedText,		ENoAttrs,    KCDTypeNameLoginName },
       
   269 		{ KCDTIdLoginPass,	       		EMedText,		ENoAttrs,    KCDTypeNameLoginPass },
       
   270 		{ KCDTIdDisplayPct,	        	EBool,		ENoAttrs,    KCDTypeNameDisplayPct },
       
   271 		{ KCDTIdIfParams,	 			EText,		ENoAttrs,    KCDTypeNameIfParams },
       
   272 		{ KCDTIdIfNetworks,	 			EText,		ENoAttrs,    KCDTypeNameIfNetworks },
       
   273 		{ KCDTIdIfPromptForAuth,		EBool,		ENotNull,    KCDTypeNameIfPromptForAuth },
       
   274 		{ KCDTIdIfAuthName,	 			EMedText,		ENoAttrs,    KCDTypeNameIfAuthName },
       
   275 		{ KCDTIdIfAuthPass,	 			EMedText,		ENoAttrs,    KCDTypeNameIfAuthPass },
       
   276 		{ KCDTIdIfAuthRetries,	 		EInt,		ENoAttrs,    KCDTypeNameIfAuthRetries },
       
   277 		{ KCDTIdIfCallbackEnabled,		EBool,		ENoAttrs,    KCDTypeNameIfCallbackEnabled },
       
   278 		{ KCDTIdIfCallbackType,	 		EInt,		ENoAttrs,    KCDTypeNameIfCallbackType },
       
   279 		{ KCDTIdIfCallbackInfo,	 		EDesC8,		ENoAttrs,    KCDTypeNameIfCallbackInfo },
       
   280 		{ KCDTIdCallbackTimeout,		EInt,		ENoAttrs,    KCDTypeNameCallbackTimeout },
       
   281 		{ KCDTIdIfServerMode,	 		EBool,		ENoAttrs,    KCDTypeNameIfServerMode },
       
   282 		{ KCDTIdIpAddrFromServer,		EBool,		ENotNull,    KCDTypeNameIpAddrFromServer },
       
   283 		{ KCDTIdIpAddr,	 				EText,		ENoAttrs,    KCDTypeNameIpAddr },
       
   284 		{ KCDTIdIpNetMask,	 			EText,		ENoAttrs,    KCDTypeNameIpNetMask },
       
   285 		{ KCDTIdIpGateway,	 			EText,		ENoAttrs,    KCDTypeNameIpGateway },
       
   286 		{ KCDTIdIpDNSAddrFromServer,	EBool,		ENotNull,    KCDTypeNameIpDNSAddrFromServer },
       
   287 		{ KCDTIdIpNameServer1,	 		EText,		ENoAttrs,    KCDTypeNameIpNameServer1 },
       
   288 		{ KCDTIdIpNameServer2,	 		EText,		ENoAttrs,    KCDTypeNameIpNameServer2 },
       
   289 		{ KCDTIdIp6DNSAddrFromServer,	EBool,		ENoAttrs,    KCDTypeNameIp6DNSAddrFromServer },
       
   290 		{ KCDTIdIp6NameServer1,	 		EText,		ENoAttrs,    KCDTypeNameIp6NameServer1 },
       
   291 		{ KCDTIdIp6NameServer2,	 		EText,		ENoAttrs,    KCDTypeNameIp6NameServer2 },
       
   292 		{ KCDTIdIpAddrLeaseValidFrom,	EText,		ENoAttrs,    KCDTypeNameIpAddrLeaseValidFrom },
       
   293 		{ KCDTIdIpAddrLeaseValidTo,	 	EText,		ENoAttrs,    KCDTypeNameIpAddrLeaseValidTo },
       
   294 		{ KCDTIdConfigDaemonManagerName,EText,		ENoAttrs,    KCDTypeNameConfigDaemonManagerName },
       
   295 		{ KCDTIdConfigDaemonName,	 	EText,		ENoAttrs,    KCDTypeNameConfigDaemonName },
       
   296 		{ KCDTIdEnableIpHeaderComp,	 	EBool,		ENoAttrs,    KCDTypeNameEnableIpHeaderComp },
       
   297 		{ KCDTIdEnableLCPExtension,		EBool,		ENoAttrs,    KCDTypeNameEnableLcpExtensions  },
       
   298 		{ KCDTIdDisablePlainTextAuth,   EBool,		ENoAttrs,    KCDTypeNameDisablePlainTextAuth },
       
   299 		{ KCDTIdEnableSwComp,	 		EBool,		ENoAttrs,    KCDTypeNameEnableSwComp },
       
   300 		{ KCDTIdBearerName,	 			EInt,		ENoAttrs,    KCDTypeNameBearerName },
       
   301 		{ KCDTIdBearerSpeed,	 		EInt,		ENoAttrs,    KCDTypeNameBearerSpeed },
       
   302 		{ KCDTIdBearerCe,	 			EInt,		ENoAttrs,    KCDTypeNameBearerCe },
       
   303 		{ KCDTIdInitString,	 			EDesC8,		ENoAttrs,    KCDTypeNameInitString },
       
   304 		{ KCDTIdBearerType,	 			EInt,		ENoAttrs,    KCDTypeNameISPBearerType },
       
   305 		{ KCDTIdChannelCoding,	 		EInt,		ENoAttrs,    KCDTypeNameChannelCoding },
       
   306 		{ KCDTIdAiur,	 				EInt,		ENoAttrs,    KCDTypeNameAiur },
       
   307 		{ KCDTIdRequestedTimeSlots,	 	EInt,		ENoAttrs,    KCDTypeNameRequestedTimeSlots },
       
   308 		{ KCDTIdMaximumTimeSlots,	 	EInt,		ENoAttrs,    KCDTypeNameMaximumTimeSlots },
       
   309 		{ KCDTIdBearerService,	 		EInt,		ENoAttrs,    KCDTypeNameBearerService },
       
   310 		{ KCDTIdBearerProtocol,	 		EInt,		ENoAttrs,    KCDTypeNameBearerProtocol },
       
   311 		{ KCDTIdRlpVersion,	 			EInt,		ENoAttrs,    KCDTypeNameRlpVersion },
       
   312 		{ KCDTIdIwfToMs,	 			EInt,		ENoAttrs,    KCDTypeNameIwfToMs },
       
   313 		{ KCDTIdMsToIwf,	 			EInt,		ENoAttrs,    KCDTypeNameMsToIwf },
       
   314 		{ KCDTIdAckTimer,	 			EInt,		ENoAttrs,    KCDTypeNameAckTimer },
       
   315 		{ KCDTIdRetransmissionAttempts,	EInt,		ENoAttrs,    KCDTypeNameRetransmissionAttempts },
       
   316 		{ KCDTIdResequencePeriod,	 	EInt,		ENoAttrs,    KCDTypeNameResequencePeriod },
       
   317 		{ KCDTIdV42Compression,	 		EInt,		ENoAttrs,    KCDTypeNameV42Compression },
       
   318 		{ KCDTIdV42Codewords,	 		EInt,		ENoAttrs,    KCDTypeNameV42Codewords },
       
   319 		{ KCDTIdV42MaxLength,	 		EInt,		ENoAttrs,    KCDTypeNameV42MaxLength },
       
   320 		{ KCDTIdAsymmetry,	 			EInt,		ENoAttrs,    KCDTypeNameAsymmetry },
       
   321 		{ KCDTIdUserInitUpgrade,	 	EBool,		ENoAttrs,    KCDTypeNameUserInitUpgrade },
       
   322 		{ KCDTIdUseEdge,	 			EBool,		ENoAttrs,    KCDTypeNameUseEdge },
       
   323 		/**** add new fields above this comment ****/
       
   324         // service base class
       
   325 		{ KCDTIdServiceEnableLlmnr,     EBool,      ENoAttrs,    KCDTypeNameServiceEnableLlmnr },
       
   326   		{ 0, 0, ENoAttrs, KCDNull }
       
   327   	};
       
   328 
       
   329 
       
   330     // 09/  DIAL IN ISP RECORD
       
   331 
       
   332   	const SRecordTypeInfo CommsDatSchemaV1_1::iDialInISPRecordInfo[] =
       
   333   	{
       
   334     	// CCDRecordBase class
       
   335 		{ KCDTIdRecordTag,	        	    EInt,		ENoAttrs,    KCDTypeNameRecordTag },
       
   336   		{ KCDTIdRecordName,     		    EText,		ENotNull,    KCDTypeNameRecordName },
       
   337 		// this class
       
   338 		{ KCDTIdDINDescription,	 		    EText,		ENoAttrs,    KCDTypeNameDescription },
       
   339 		{ KCDTIdDINType,	 				EInt,		ENoAttrs,    KCDTypeNameType },
       
   340 		{ KCDTIdDINUseLoginScript,	 		EBool,		ENoAttrs,    KCDTypeNameUseLoginScript },
       
   341 		{ KCDTIdDINLoginScript,	 		    ELongText,	ENoAttrs,    KCDTypeNameLoginScript },
       
   342 		{ KCDTIdDINAuthentication,	 		EInt,		ENoAttrs,    KCDTypeNameAuthentication },
       
   343 		{ KCDTIdDINIfAuthRetries,	 		EInt,		ENoAttrs,    KCDTypeNameIfAuthRetries },
       
   344 		{ KCDTIdDINIfParams,	 			EText,		ENoAttrs,    KCDTypeNameIfParams },
       
   345 		{ KCDTIdDINIfNetworks,	 			EText,		ENoAttrs,    KCDTypeNameIfNetworks },
       
   346 		{ KCDTIdDINIpAddrFromServer,		EBool,		ENotNull,    KCDTypeNameIpAddrFromServer },
       
   347 		{ KCDTIdDINIpAddr,	 				EText,		ENoAttrs,    KCDTypeNameIpAddr },
       
   348 		{ KCDTIdDINIpNetMask,				EText,		ENoAttrs,    KCDTypeNameIpNetMask },
       
   349 		{ KCDTIdDINIpGateway,	 			EText,		ENoAttrs,    KCDTypeNameIpGateway },
       
   350 		{ KCDTIdDINIpDNSAddrFromServer,	    EBool,		ENotNull,    KCDTypeNameIpDNSAddrFromServer },
       
   351 		{ KCDTIdDINIpNameServer1,	 		EText,		ENoAttrs,    KCDTypeNameIpNameServer1 },
       
   352 		{ KCDTIdDINIpNameServer2,	 		EText,		ENoAttrs,    KCDTypeNameIpNameServer2 },
       
   353 		{ KCDTIdDINIp6DNSAddrFromServer,	EBool,		ENoAttrs,    KCDTypeNameIp6DNSAddrFromServer },
       
   354 		{ KCDTIdDINIp6NameServer1,		 	EText,		ENoAttrs,    KCDTypeNameIp6NameServer1 },
       
   355 		{ KCDTIdDINIp6NameServer2,	 		EText,		ENoAttrs,    KCDTypeNameIp6NameServer2 },
       
   356 		{ KCDTIdDINEnableIpHeaderComp,	 	EBool,		ENoAttrs,    KCDTypeNameEnableIpHeaderComp },
       
   357 		{ KCDTIdDINEnableLCPExtensions,		EBool,		ENoAttrs,    KCDTypeNameEnableLcpExtensions },
       
   358 		{ KCDTIdDINDisablePlainTextAuth,	EBool,		ENoAttrs,    KCDTypeNameDisablePlainTextAuth },
       
   359 		{ KCDTIdDINEnableSwComp,	 		EBool,		ENoAttrs,    KCDTypeNameEnableSwComp },
       
   360 		{ KCDTIdDINBearerName,	 			EInt,		ENoAttrs,    KCDTypeNameBearerName },
       
   361 		{ KCDTIdDINBearerSpeed,	 		    EInt,		ENoAttrs,    KCDTypeNameBearerSpeed },
       
   362 		{ KCDTIdDINBearerCe,	 			EInt,		ENoAttrs,    KCDTypeNameBearerCe },
       
   363 		{ KCDTIdDINInitString,	 			EDesC8,		ENoAttrs,    KCDTypeNameInitString },
       
   364 		{ KCDTIdDINUseEdge,	 			    EBool,		ENoAttrs,    KCDTypeNameUseEdge },
       
   365         /**** add new fields above this comment ****/
       
   366         // service base class
       
   367         { KCDTIdServiceEnableLlmnr,         EBool,      ENoAttrs,    KCDTypeNameServiceEnableLlmnr },
       
   368   		{ 0, 0, ENoAttrs, KCDNull }
       
   369   	};
       
   370 
       
   371 
       
   372     //  0A/  LAN Service Record
       
   373 
       
   374   	const SRecordTypeInfo CommsDatSchemaV1_1::iLANServiceRecordInfo[] =
       
   375   	{
       
   376     	// CCDRecordBase class
       
   377 		{ KCDTIdRecordTag,	        			    EInt,     ENoAttrs,    KCDTypeNameRecordTag },
       
   378   		{ KCDTIdRecordName,     				    EText,    ENotNull,    KCDTypeNameRecordName },
       
   379 		// this class
       
   380 		{ KCDTIdLANIfNetworks,	 					EText,    ENoAttrs,    KCDTypeNameIfNetworks },
       
   381 		{ KCDTIdLANIpNetMask,	 					EText,    ENoAttrs,    KCDTypeNameIpNetMask },
       
   382 		{ KCDTIdLANIpGateway,	 					EText,    ENoAttrs,    KCDTypeNameIpGateway },
       
   383 		{ KCDTIdLANIpAddrFromServer,	 			EBool,    ENotNull,    KCDTypeNameIpAddrFromServer },
       
   384 		{ KCDTIdLANIpAddr,	 						EText,    ENoAttrs,    KCDTypeNameIpAddr },
       
   385 		{ KCDTIdLANIpDNSAddrFromServer,	 		    EBool,    ENotNull,    KCDTypeNameIpDNSAddrFromServer },
       
   386 		{ KCDTIdLANIpNameServer1,	 				EText,    ENoAttrs,    KCDTypeNameIpNameServer1 },
       
   387 		{ KCDTIdLANIpNameServer2,	 				EText,    ENoAttrs,    KCDTypeNameIpNameServer2 },
       
   388 		{ KCDTIdLANIp6DNSAddrFromServer,	 		EBool,    ENoAttrs,    KCDTypeNameIp6DNSAddrFromServer },
       
   389 		{ KCDTIdLANIp6NameServer1,	 				EText,    ENoAttrs,    KCDTypeNameIp6NameServer1 },
       
   390 		{ KCDTIdLANIp6NameServer2,	 				EText,    ENoAttrs,    KCDTypeNameIp6NameServer2 },
       
   391 		{ KCDTIdLANIpAddrLeaseValidFrom,	 		EText,    ENoAttrs,    KCDTypeNameIpAddrLeaseValidFrom },
       
   392 		{ KCDTIdLANIpAddrLeaseValidTo,	 			EText,    ENoAttrs,    KCDTypeNameIpAddrLeaseValidTo },
       
   393 		{ KCDTIdLANConfigDaemonManagerName,		    EText,    ENoAttrs,    KCDTypeNameConfigDaemonManagerName },
       
   394 		{ KCDTIdLANConfigDaemonName,	 			EText,    ENoAttrs,    KCDTypeNameConfigDaemonName },
       
   395 		{ KCDTIdLANServiceExtensionTableName,		EText,    ENoAttrs,    KCDTypeNameServiceExtensionTableName },
       
   396 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   397 		{ KCDTIdLANServiceExtensionTableRecordId,	ELink,    ENoAttrs,    KCDTypeNameServiceExtensionTableRecordId },
       
   398 #else
       
   399         { KCDTIdLANServiceExtensionTableRecordId,	EInt,    ENoAttrs,    KCDTypeNameServiceExtensionTableRecordId },
       
   400 #endif //SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   401         /**** add new fields above this comment ****/
       
   402         // service base class
       
   403         { KCDTIdServiceEnableLlmnr,                 EBool,    ENoAttrs,    KCDTypeNameServiceEnableLlmnr },
       
   404   		{ 0, 0, ENoAttrs, KCDNull }
       
   405   	};
       
   406 
       
   407   	const SRecordTypeInfo CommsDatSchemaV1_1::iWLANServiceExtRecordInfo[] =
       
   408   	{
       
   409     	// CCDRecordBase class
       
   410   		{ KCDTIdRecordTag,	        		EInt,   ENoAttrs,   KCDTypeNameRecordTag },
       
   411   		{ KCDTIdRecordName,     			EText,  ENotNull,   KCDTypeNameRecordName },
       
   412 		// This class
       
   413 		{ KCDTIdWLANProfile, 				EText,	ENotNull,	KCDTypeNameWLANProfile },
       
   414 		{ KCDTIdWLANSSID,					EText,	ENotNull,	KCDTypeNameWLANSSID },
       
   415 		{ KCDTIdWLANEncryptionStatus,		EInt,	ENoAttrs,	KCDTypeNameWLANEncryptionStatus },
       
   416 		{ KCDTIdWLANEncryptionType,			EInt,	ENoAttrs,	KCDTypeNameWLANEncryptionType },
       
   417 		{ KCDTIdWLANDefaultWepKey ,			EInt,	ENoAttrs,	KCDTypeNameWLANDefaultWepKey   },
       
   418 		{ KCDTIdWLANEncryptKey1Valid,		EInt,	ENoAttrs,	KCDTypeNameWLANEncryptKey1Valid },
       
   419 		{ KCDTIdWLANWepKey1,				EText,	ENoAttrs,	KCDTypeNameWLANWepKey1 },
       
   420 		{ KCDTIdWLANEncryptKey2Valid, 		EInt,	ENoAttrs,	KCDTypeNameWLANEncryptKey2Valid },
       
   421 		{ KCDTIdWLANWepKey2,				EText,	ENoAttrs,	KCDTypeNameWLANWepKey2 },
       
   422 		{ KCDTIdWLANEncryptKey3Valid,		EInt,	ENoAttrs,	KCDTypeNameWLANEncryptKey3Valid },
       
   423 		{ KCDTIdWLANWepKey3,				EText,	ENoAttrs,	KCDTypeNameWLANWepKey3 },
       
   424 		{ KCDTIdWLANEncryptKey4Valid,		EInt,	ENoAttrs,	KCDTypeNameWLANEncryptKey4Valid },
       
   425 		{ KCDTIdWLANWepKey4,				EText,	ENoAttrs,	KCDTypeNameWLANWepKey4 },
       
   426 		{ KCDTIdWLANRanking,				EInt,	ENoAttrs,	KCDTypeNameWLANRanking  },
       
   427 		{ KCDTIdWLANDialogPref,				EInt,	ENoAttrs,	KCDTypeNameWLANDialogPref },
       
   428 		{ KCDTIdWLANNetworkType,			EInt,	ENoAttrs,	KCDTypeNameWLANNetworkType },
       
   429 		{ KCDTIdWLANFragThres,				EInt,	ENoAttrs,	KCDTypeNameWLANFragThres },
       
   430 		{ KCDTIdWLANRTSThres, 				EInt,	ENoAttrs,	KCDTypeNameWLANRTSThres },
       
   431 		{ KCDTIdWLANDesTransRate,			EInt,	ENoAttrs,	KCDTypeNameWLANDesTransRate },
       
   432 		{ KCDTIdWLANBeaconInt,				EInt,	ENoAttrs,	KCDTypeNameWLANBeaconInt },
       
   433 		{ KCDTIdWLANChannelId,				EInt,	ENoAttrs,	KCDTypeNameWLANChannelId },
       
   434 		{ KCDTIdWLANAuthenticationMode,		EInt,	ENoAttrs,	KCDTypeNameWLANAuthenticationMode },
       
   435 		{ KCDTIdWLANPowerSaveMode,			EInt,	ENoAttrs,	KCDTypeNameWLANPowerSaveMode },
       
   436 		{ KCDTIdWLANAllowUnencryptMode,		EInt,	ENoAttrs,	KCDTypeNameWLANAllowUnencryptMode },
       
   437 		{ KCDTIdWLANAllowShortPre,			EInt,	ENoAttrs,	KCDTypeNameWLANAllowShortPre },
       
   438 		{ KCDTIdWLANPreambleType,			EInt,	ENoAttrs,	KCDTypeNameWLANPreambleType },
       
   439 		{ KCDTIdWLANTxPowerLevel,			EInt,	ENoAttrs,	KCDTypeNameWLANTxPowerLevel },
       
   440 		{ KCDTIdWLANEapPresharedKey,		EMedText,	ENoAttrs,	KCDTypeNameWLANEapPresharedKey },
       
   441 		{ KCDTIdWLANRegDomain,				EInt,	ENoAttrs,	KCDTypeNameWLANRegDomain },
       
   442 		{ KCDTIdWLANSecData,				ELinkEAPSecRecord,	ENoAttrs,	KCDTypeNameWLANSecData },
       
   443 		{ 0, 0, ENoAttrs, KCDNull }
       
   444   	};
       
   445 
       
   446   	const SRecordTypeInfo CommsDatSchemaV1_1::iVPNServiceRecordInfo[] =
       
   447   	{
       
   448     	// CCDRecordBase class
       
   449     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   450 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   451 		// This class
       
   452 		{ KCDTIdVPNPolicyName,	 	EText,              ENotNull,    KCDTypeNameVPNPolicyName },
       
   453 		{ KCDTIdVPNIAPRecord, 		ELinkIAPRecord,	    ENoAttrs,    KCDTypeNameVPNIAPRecord },
       
   454 		{ KCDTIdVPNNetwork,	  		ELinkNetworkRecord, ENoAttrs,    KCDTypeNameVPNNetwork },
       
   455 		/**** add new fields above this comment ****/
       
   456         // service base class
       
   457 		{ KCDTIdServiceEnableLlmnr,	EBool,  ENoAttrs,    KCDTypeNameServiceEnableLlmnr },
       
   458   		{ 0, 0, ENoAttrs, KCDNull }
       
   459   	};
       
   460 
       
   461   
       
   462   	const SRecordTypeInfo CommsDatSchemaV1_1::iUmtsR99QoSAndOnTableRecordInfo[] =
       
   463 	{
       
   464     	// CCDRecordBase class
       
   465 		{ KCDTIdRecordTag,						 EInt,	  ENoAttrs,     KCDTypeNameRecordTag },
       
   466 		{ KCDTIdRecordName,						 EText,   ENotNull,     KCDTypeNameRecordName },
       
   467 		// this class
       
   468 		{ KCDTIdWCDMAReqTrafficClass, 			 EUint32, ENoAttrs,     KCDTypeNameGPRSReqTrafficClass },
       
   469 		{ KCDTIdWCDMAMinTrafficClass, 			 EUint32, ENoAttrs,     KCDTypeNameGPRSMinTrafficClass },
       
   470 		{ KCDTIdWCDMAReqDeliveryOrder, 			 EUint32, ENoAttrs,	    KCDTypeNameGPRSReqDeliveryOrder },
       
   471 		{ KCDTIdWCDMAMinDeliveryOrder	, 		 EUint32, ENoAttrs,	    KCDTypeNameGPRSMinDeliveryOrder },
       
   472 		{ KCDTIdWCDMAReqDeliverErroneousSDU,	 EUint32, ENoAttrs,	    KCDTypeNameGPRSReqDeliverErroneousSDU },
       
   473 		{ KCDTIdWCDMAMinDeliverErroneousSDU,	 EUint32, ENoAttrs,	    KCDTypeNameGPRSMinDeliverErroneousSDU },
       
   474 		{ KCDTIdWCDMAReqMaxSDUSize, 			 EInt,    ENoAttrs,	    KCDTypeNameGPRSReqMaxSDUSize },
       
   475 		{ KCDTIdWCDMAMinAcceptableMaxSDUSize,	 EInt,    ENoAttrs,	    KCDTypeNameGPRSMinAcceptableMaxSDUSize },
       
   476 		{ KCDTIdWCDMAReqMaxUplinkRate, 			 EInt,    ENoAttrs,     KCDTypeNameGPRSReqMaxUplinkRate },
       
   477 		{ KCDTIdWCDMAReqMinUplinkRate, 			 EInt,    ENoAttrs,	    KCDTypeNameGPRSReqMinUplinkRate },
       
   478 		{ KCDTIdWCDMAReqMaxDownlinkRate, 		 EInt,    ENoAttrs,	    KCDTypeNameGPRSReqMaxDownlinkRate },
       
   479 		{ KCDTIdWCDMAReqMinDownlinkRate, 		 EInt,    ENoAttrs,	    KCDTypeNameGPRSReqMinDownlinkRate },
       
   480 		{ KCDTIdWCDMAReqBER, 					 EUint32, ENoAttrs,	    KCDTypeNameGPRSReqBER },
       
   481 		{ KCDTIdWCDMAMaxBER, 					 EUint32, ENoAttrs,	    KCDTypeNameGPRSMaxBER },
       
   482 		{ KCDTIdWCDMAReqSDUErrorRatio, 			 EUint32, ENoAttrs,	    KCDTypeNameGPRSReqSDUErrorRatio },
       
   483 		{ KCDTIdWCDMAMaxSDUErrorRatio, 			 EUint32, ENoAttrs,	    KCDTypeNameGPRSMaxSDUErrorRatio },
       
   484 		{ KCDTIdWCDMAReqTrafficHandlingPriority, EUint32, ENoAttrs,	    KCDTypeNameGPRSReqTrafficHandlingPriority },
       
   485 		{ KCDTIdWCDMAMinTrafficHandlingPriority, EUint32, ENoAttrs,	    KCDTypeNameGPRSMinTrafficHandlingPriority },
       
   486 		{ KCDTIdWCDMAReqTransferDelay, 			 EInt,    ENoAttrs,     KCDTypeNameGPRSReqTransferDelay },
       
   487 		{ KCDTIdWCDMAMaxTransferDelay, 			 EInt,    ENoAttrs,	    KCDTypeNameGPRSMaxTransferDelay },
       
   488 		{ KCDTIdWCDMAReqGuaranteedUplinkRate, 	 EInt,    ENoAttrs,	    KCDTypeNameGPRSReqGuaranteedUplinkRate },
       
   489 		{ KCDTIdWCDMAMinGuaranteedUplinkRate, 	 EInt,    ENoAttrs,	    KCDTypeNameGPRSMinGuaranteedUplinkRate },
       
   490 		{ KCDTIdWCDMAReqGuaranteedDownlinkRate,  EInt,    ENoAttrs,	    KCDTypeNameGPRSReqGuaranteedDownlinkRate },
       
   491 		{ KCDTIdWCDMAMinGuaranteedDownlinkRate,  EInt,    ENoAttrs,	    KCDTypeNameGPRSMinGuaranteedDownlinkRate },
       
   492 		{ KCDTIdWCDMASignallingIndication,		 EBool,   ENoAttrs,	    KCDTypeNameGPRSSignallingIndication },
       
   493 		{ KCDTIdWCDMAImCmSignallingIndication,	 EBool,   ENoAttrs,	    KCDTypeNameGPRSImCnSignallingIndication },
       
   494 		{ KCDTIdWCDMASourceStatisticsDescriptor, EUint32, ENoAttrs,	    KCDTypeNameGPRSSourceStatisticsDescriptor },
       
   495 		{ 0, 0, ENoAttrs, KCDNull }
       
   496 
       
   497 	};
       
   498 
       
   499 
       
   500   	const SRecordTypeInfo CommsDatSchemaV1_1::iWCDMAPacketServiceRecordInfo[] =
       
   501     {
       
   502     	// CCDRecordBase class
       
   503 		{ KCDTIdRecordTag,						EInt,		ENoAttrs,    KCDTypeNameRecordTag },
       
   504 		{ KCDTIdRecordName,						EText,      ENotNull,    KCDTypeNameRecordName },
       
   505 		// This class
       
   506 		{ KCDTIdAPN,	 							EMedText,   ENoAttrs,    KCDTypeNameGPRSAPN },
       
   507 		{ KCDTIdWCDMPDPType,					EInt,		ENoAttrs,    KCDTypeNameGPRSPDPType },
       
   508 		{ KCDTIdWCDMAPDPAddress,				EText,      ENoAttrs,    KCDTypeNameGPRSPDPAddress },
       
   509 		{ KCDTIdReqPrecedence,	 				EInt,		ENoAttrs,    KCDTypeNameGPRSReqPrecedence },
       
   510 		{ KCDTIdReqDelay,	 						EInt,		ENoAttrs,    KCDTypeNameGPRSReqDelay },
       
   511 		{ KCDTIdReqReliability,	 					EInt,		ENoAttrs,    KCDTypeNameGPRSReqReliability  },
       
   512 		{ KCDTIdReqPeakThroughput,				EInt,		ENoAttrs,    KCDTypeNameGPRSReqPeakThroughput },
       
   513 		{ KCDTIdReqMeanThroughput,				EInt,		ENoAttrs,    KCDTypeNameGPRSReqMeanThroughput },
       
   514 		{ KCDTIdMinPrecedence,	 				EInt,		ENoAttrs,    KCDTypeNameGPRSMinPrecedence },
       
   515 		{ KCDTIdMinDelay,	 						EInt,		ENoAttrs,    KCDTypeNameGPRSMinDelay },
       
   516 		{ KCDTIdMinReliability,	 					EInt,		ENoAttrs,    KCDTypeNameGPRSMinReliability },
       
   517 		{ KCDTIdMinPeakThroughput,  				EInt,		ENoAttrs,    KCDTypeNameGPRSMinPeakThroughput },
       
   518 		{ KCDTIdMinMeanThroughput,  				EInt,		ENoAttrs,    KCDTypeNameGPRSMinMeanThroughput },
       
   519 		{ KCDTIdWCDMADataCompression, 			EBool,      ENoAttrs,    KCDTypeNameGPRSDataCompression },
       
   520 		{ KCDTIdWCDMAHeaderCompression,			EBool,      ENoAttrs,    KCDTypeNameGPRSHeaderCompression },
       
   521 		{ KCDTIdWCDMAUseEdge,	 				EBool,      ENoAttrs,    KCDTypeNameGPRSUseEdge },
       
   522 		{ KCDTIdWCDMAAnonymousAccess,			EBool,      ENoAttrs,    KCDTypeNameGPRSAnonymousAccess },
       
   523 		{ KCDTIdWCDMAIfParams,					EText,      ENoAttrs,    KCDTypeNameGPRSIfParams },
       
   524 		{ KCDTIdWCDMAIfNetworks,	 				EText,      ENoAttrs,    KCDTypeNameIfNetworks },
       
   525 		{ KCDTIdWCDMAIfPromptForAuth,			EBool,      ENoAttrs,    KCDTypeNameGPRSIfPromptForAuth },
       
   526 		{ KCDTIdWCDMAIfAuthName,	 			EText,      ENoAttrs,    KCDTypeNameGPRSIfAuthName },
       
   527 		{ KCDTIdWCDMAIfAuthPass,	 			EText,      ENoAttrs,    KCDTypeNameGPRSIfAuthPass },
       
   528 		{ KCDTIdWCDMAIfAuthRetries,	 			EInt,       ENoAttrs,    KCDTypeNameGPRSIfAuthRetries },
       
   529 		{ KCDTIdWCDMAIPNetMask,					EText,      ENoAttrs,    KCDTypeNameGPRSIPNetMask },
       
   530 		{ KCDTIdWCDMAIPGateway,	 				EText,      ENoAttrs,    KCDTypeNameGPRSIPGateway },
       
   531 		{ KCDTIdWCDMAIPAddrFromServer,			EBool,      ENoAttrs,    KCDTypeNameGPRSIPAddrFromServer },
       
   532 		{ KCDTIdWCDMAIPAddr,	 				EText,      ENoAttrs,    KCDTypeNameGPRSIPAddr },
       
   533 		{ KCDTIdWCDMAIPDNSAddrFromServer,		EBool,      ENoAttrs,    KCDTypeNameGPRSIPDNSAddrFromServer  },
       
   534 		{ KCDTIdWCDMAIPNameServer1,	 			EText,      ENoAttrs,    KCDTypeNameGPRSIPNameServer1 },
       
   535 		{ KCDTIdWCDMAIPNameServer2,	 			EText,      ENoAttrs,    KCDTypeNameGPRSIPNameServer2 },
       
   536 		{ KCDTIdWCDMAIP6DNSAddrFromServer,		EBool,      ENoAttrs,    KCDTypeNameGPRSIP6DNSAddrFromServer },
       
   537 		{ KCDTIdWCDMAIP6NameServer1,	 		EText,      ENoAttrs,    KCDTypeNameGPRSIP6NameServer1 },
       
   538 		{ KCDTIdWCDMAIP6NameServer2,	 		EText,      ENoAttrs,    KCDTypeNameGPRSIP6NameServer2 },
       
   539 		{ KCDTIdWCDMAIPAddrLeaseValidFrom,		EText,      ENoAttrs,    KCDTypeNameGPRSIPAddrLeaseValidFrom },
       
   540 		{ KCDTIdWCDMAIPAddrLeaseValidTo,			EText,      ENoAttrs,    KCDTypeNameGPRSIPAddrLeaseValidTo },
       
   541 		{ KCDTIdWCDMAConfigDaemonManagerName,   	EText,      ENoAttrs,    KCDTypeNameGPRSConfigDaemonManagerName },
       
   542 		{ KCDTIdWCDMAConfigDaemonName,		    	EText,      ENoAttrs,    KCDTypeNameGPRSConfigDaemonName },
       
   543 		{ KCDTIdWCDMAEnableLCPExtensions,	    		EBool,      ENoAttrs,    KCDTypeNameGPRSEnableLCPExtensions  },
       
   544 		{ KCDTIdWCDMADisablePlainTextAuth,	    		EBool,      ENoAttrs,    KCDTypeNameGPRSDisablePlainTextAuth },
       
   545 		{ KCDTIdAPType,	 				        	EInt,       ENoAttrs,    KCDTypeNameGPRSAPType },
       
   546 		{ KCDTIdQOSWarningTimeOut,		        	EInt,       ENoAttrs,    KCDTypeNameGPRSQOSWarningTimeOut },
       
   547 		{ KCDTIdUmtsR99QoSAndOn, 				ELinkUMTSR99QoSRecord,	    ENoAttrs,    KCDTypeNameUmtsR99QoSAndOn },
       
   548         /**** add new fields above this comment ****/
       
   549         // service base class
       
   550 		{ KCDTIdServiceEnableLlmnr,		        	EBool,      ENoAttrs,    KCDTypeNameServiceEnableLlmnr },
       
   551 		{ KCDTIdR5DataCompression,	 		   	EInt,       ENoAttrs,    KCDTypeNameR5DataCompression },
       
   552 		{ KCDTIdR5HeaderCompression,	 	   	        EInt,       ENoAttrs,    KCDTypeNameR5HeaderCompression },
       
   553 		{ KCDTIdPacketFlowIdentifier,	 	   	        EInt,       ENoAttrs,    KCDTypeNamePacketFlowIdentifier },
       
   554 		{ KCDTIdUmtsGprsRelease,	 		   	EInt,       ENoAttrs,    KCDTypeNameUmtsGprsRelease },
       
   555 
       
   556 
       
   557 		{ 0, 0, ENoAttrs, KCDNull }
       
   558     };
       
   559 
       
   560 
       
   561     //
       
   562     const SRecordTypeInfo CommsDatSchemaV1_1::iDefaultWCDMARecordInfo[] =
       
   563     {
       
   564 		// CCDRecordBase class
       
   565 		{  KCDTIdRecordTag,						EInt,		ENoAttrs,    KCDTypeNameRecordTag },
       
   566     	{  KCDTIdRecordName,					EText,		ENotNull,    KCDTypeNameRecordName },
       
   567 		// This class
       
   568     	{  KCDTIdDefaultGPRSUsage,     			EUint32,    ENoAttrs,    KCDTypeNameUsage },
       
   569 		{  KCDTIdDefaultGPRSAPN,     			EMedText,	ENoAttrs,    KCDTypeNameAPN },
       
   570 		{  KCDTIdDefaultGPRSPDPType,    		EUint32,	ENotNull,    KCDTypeNamePDPType },
       
   571 		{  KCDTIdDefaultGPRSPDPAddress,    		EText,		ENoAttrs,    KCDTypeNamePDPAddress },
       
   572 		{  KCDTIdDefaultGPRSPrecedence,			EUint32,	ENoAttrs,    KCDTypeNamePrecedence },
       
   573 		{  KCDTIdDefaultGPRSDelay,     			EUint32,	ENoAttrs,    KCDTypeNameDelay },
       
   574 		{  KCDTIdDefaultGPRSReliability, 		EUint32,	ENoAttrs,    KCDTypeNameReliability },
       
   575 		{  KCDTIdDefaultGPRSPeakThroughput,		EUint32,	ENoAttrs,    KCDTypeNamePeakThroughput },
       
   576 		{  KCDTIdDefaultGPRSMeanThroughput,		EUint32,	ENoAttrs,    KCDTypeNameMeanThroughput },
       
   577 		{  KCDTIdDefaultGPRSMinPrecedence,		EUint32,	ENoAttrs,    KCDTypeNameMinPrecedence },
       
   578 		{  KCDTIdDefaultGPRSMinDelay,     		EUint32,	ENoAttrs,    KCDTypeNameMinDelay },
       
   579 		{  KCDTIdDefaultGPRSMinReliability,		EUint32,	ENoAttrs,    KCDTypeNameMinReliability },
       
   580 		{  KCDTIdDefaultGPRSMinPeakThroughput,	EUint32,	ENoAttrs,    KCDTypeNameMinPeakThroughput },
       
   581 		{  KCDTIdDefaultGPRSMinMeanThroughput,	EUint32,	ENoAttrs,    KCDTypeNameMinMeanThroughput },
       
   582 		{  KCDTIdDefaultGPRSDataCompression,	EBool,		ENoAttrs,    KCDTypeNameDataCompression },
       
   583 		{  KCDTIdDefaultGPRSHeaderCompression,	EBool,		ENoAttrs,    KCDTypeNameHeaderCompression },
       
   584 		{  KCDTIdDefaultGPRSUseEdge,            EBool,      ENoAttrs,    KCDTypeNameGPRSUseEdge },
       
   585 		{  KCDTIdDefaultGPRSAnonymousAccess,	EBool,		ENoAttrs,    KCDTypeNameAnonymousAccess },
       
   586 		{ 0, 0, ENoAttrs, KCDNull }
       
   587     };
       
   588 
       
   589 	
       
   590 	const SRecordTypeInfo CommsDatSchemaV1_1::iModemBearerRecordInfo[] = {
       
   591 		// CCDRecordBase class
       
   592 		{ KCDTIdRecordTag,					EInt,	ENoAttrs,    KCDTypeNameRecordTag },
       
   593 		{ KCDTIdRecordName,					EText,  ENotNull,    KCDTypeNameRecordName },
       
   594 		// This class
       
   595 		{ KCDTIdNifName,					EText,  ENoAttrs,    KCDTypeNameNifName },
       
   596 		{ KCDTIdPortName,					EText,  ENoAttrs,    KCDTypeNamePortName },
       
   597 		{ KCDTIdTsyName,					EText,  ENoAttrs,    KCDTypeNameTsyName },
       
   598 		{ KCDTIdCsyName,					EText,  ENoAttrs,    KCDTypeNameCsyName },
       
   599 		{ KCDTIdLastSocketActivityTimeout,	EInt,	ENoAttrs,    KCDTypeNameLastSocketActivityTimeout },
       
   600 		{ KCDTIdLastSessionClosedTimeout,	EInt,	ENoAttrs,    KCDTypeNameLastSessionClosedTimeout },
       
   601 		{ KCDTIdLastSocketClosedTimeout,	EInt,	ENoAttrs,    KCDTypeNameLastSocketClosedTimeout },
       
   602 		{ KCDTIdDataBits,					EInt,	ENoAttrs,    KCDTypeNameDataBits },
       
   603 		{ KCDTIdStopBits,					EInt,	ENoAttrs,    KCDTypeNameStopBits },
       
   604 		{ KCDTIdParity,						EInt,	ENoAttrs,    KCDTypeNameParity },
       
   605 		{ KCDTIdRate,						EInt,	ENoAttrs,    KCDTypeNameRate },
       
   606 		{ KCDTIdHandshaking,				EInt,	ENoAttrs,    KCDTypeNameHandShaking },
       
   607 		{ KCDTIdSpecialRate,				EInt,	ENoAttrs,    KCDTypeNameSpecialRate },
       
   608 		{ KCDTIdXonChar,					EInt,	ENoAttrs,    KCDTypeNameXonChar },
       
   609 		{ KCDTIdXoffChar,					EInt,	ENoAttrs,    KCDTypeNameXoffChar },
       
   610 		{ KCDTIdFaxClassPref,				EInt,	ENoAttrs,    KCDTypeNameFaxClassPref },
       
   611 		{ KCDTIdSpeakerPref,				EInt,	ENoAttrs,    KCDTypeNameSpeakerPref },
       
   612 		{ KCDTIdSpeakerVolPref,				EInt,	ENoAttrs,    KCDTypeNameSpeakerVolPref },
       
   613 		{ KCDTIdModemInitString,			EDesC8,  ENoAttrs,    KCDTypeNameModemInitString },
       
   614 		{ KCDTIdDataInitString,				EDesC8,  ENoAttrs,    KCDTypeNameDataInitString },
       
   615 		{ KCDTIdFaxInitString,				EDesC8,  ENoAttrs,    KCDTypeNameFaxInitString },
       
   616 		{ KCDTIdIspInitString,				EDesC8,  ENoAttrs,    KCDTypeNameIspInitString },
       
   617 		{ KCDTIdDialPauseLength,			EText,  ENoAttrs,    KCDTypeNameDialPauseLength },
       
   618 		{ KCDTIdCarrierTimeOut,				EText,  ENoAttrs,    KCDTypeNameCarrierTimeout },
       
   619 		{ KCDTIdAutoAnswerRingCount,		EText,  ENoAttrs,    KCDTypeNameAutoAnswerRingCount },
       
   620 		{ KCDTIdSpeakerVolControlLow,		EText,  ENoAttrs,    KCDTypeNameSpeakerVolControlLow },
       
   621 		{ KCDTIdSpeakerVolControlMedium,	EText,  ENoAttrs,    KCDTypeNameSpeakerVolControlMedium },
       
   622 		{ KCDTIdSpeakerVolControlHigh,		EText,  ENoAttrs,    KCDTypeNameSpeakerVolControlHigh },
       
   623 		{ KCDTIdSpeakerAlwaysOff,			EText,  ENoAttrs,    KCDTypeNameSpeakerAlwaysOff },
       
   624 		{ KCDTIdSpeakerOnUntilCarrier,		EText,  ENoAttrs,    KCDTypeNameSpeakerOnUntilCarrier },
       
   625 		{ KCDTIdSpeakerAlwaysOn,			EText,  ENoAttrs,    KCDTypeNameSpeakerAlwaysOn },
       
   626 		{ KCDTIdSpeakerOnAfterUntilCarrier,	 EText,  ENoAttrs,    KCDTypeNameSpeakerOnAfterUntilCarrier },
       
   627 		{ KCDTIdDialToneWaitModifier,		EText,  ENoAttrs,    KCDTypeNameDialToneWaitModifier },
       
   628 		{ KCDTIdCallProgress1,				EText,  ENoAttrs,    KCDTypeNameCallProgress1 },
       
   629 		{ KCDTIdCallProgress2,				EText,  ENoAttrs,    KCDTypeNameCallProgress2 },
       
   630 		{ KCDTIdCallProgress3,				EText,  ENoAttrs,    KCDTypeNameCallProgress3 },
       
   631 		{ KCDTIdCallProgress4,				EText,  ENoAttrs,    KCDTypeNameCallProgress4 },
       
   632 		{ KCDTIdEchoOff,					EText,  ENoAttrs,    KCDTypeNameEchoOff },
       
   633 		{ KCDTIdVerboseText,				EText,  ENoAttrs,    KCDTypeNameVerboseText },
       
   634 		{ KCDTIdQuietOff,					EText,  ENoAttrs,    KCDTypeNameQuietOff },
       
   635 		{ KCDTIdQuietOn,					EText,  ENoAttrs,    KCDTypeNameQuietOn },
       
   636 		{ KCDTIdDialCommandStateModifier,	EText,  ENoAttrs,    KCDTypeNameDialCommandStateModifier },
       
   637 		{ KCDTIdOnLine,						EText,  ENoAttrs,    KCDTypeNameOnLine },
       
   638 		{ KCDTIdResetConfiguration,			EText,  ENoAttrs,    KCDTypeNameResetConfiguration },
       
   639 		{ KCDTIdReturnToFactoryDefs,		EText,  ENoAttrs,    KCDTypeNameReturnToFactoryDefs },
       
   640 		{ KCDTIdDcdOnDuringLink,			EText,  ENoAttrs,    KCDTypeNameDcdOnDuringLink },
       
   641 		{ KCDTIdDtrHangUp,					EText,  ENoAttrs,    KCDTypeNameDtrHangUp },
       
   642 		{ KCDTIdDsrAlwaysOn,				EText,  ENoAttrs,    KCDTypeNameDsrAlwaysOn },
       
   643 		{ KCDTIdRtsCtsHandshake,			EText,  ENoAttrs,    KCDTypeNameRtsCtsHandshake },
       
   644 		{ KCDTIdXonXoffHandshake,			EText,  ENoAttrs,    KCDTypeNameXonXoffHandshake },
       
   645 		{ KCDTIdEscapeCharacter,			EText,  ENoAttrs,    KCDTypeNameEscapeCharacter },
       
   646 		{ KCDTIdEscapeGuardPeriod,			EText,  ENoAttrs,    KCDTypeNameEscapeGuardPeriod },
       
   647 		{ KCDTIdFaxClassInterrogate,		EText,  ENoAttrs,    KCDTypeNameFaxClassInterrogate },
       
   648 		{ KCDTIdFaxClass,					EText,  ENoAttrs,    KCDTypeNameFaxClass },
       
   649 		{ KCDTIdNoDialTone,					EText,  ENoAttrs,    KCDTypeNameNoDialTone },
       
   650 		{ KCDTIdBusy,						EText,  ENoAttrs,    KCDTypeNameBusy },
       
   651 		{ KCDTIdNoAnswer,					EText,  ENoAttrs,    KCDTypeNameNoAnswer },
       
   652 		{ KCDTIdCarrier,					EText,  ENoAttrs,    KCDTypeNameCarrier },
       
   653 		{ KCDTIdConnect,					EText,  ENoAttrs,    KCDTypeNameConnect },
       
   654 		{ KCDTIdCompressionClass5,			EText,  ENoAttrs,    KCDTypeNameCompressionClass5 },
       
   655 		{ KCDTIdCompressionV42bis,			EText,  ENoAttrs,    KCDTypeNameCompressionClassV42bis },
       
   656 		{ KCDTIdCompressionNone,			EText,  ENoAttrs,    KCDTypeNameCompressionNone },
       
   657 		{ KCDTIdProtocolLapd,				EText,	ENoAttrs,    KCDTypeNameProtocolLapd  },
       
   658 		{ KCDTIdProtocolAlt,				EText,	ENoAttrs,    KCDTypeNameProtocolAlt },
       
   659 		{ KCDTIdProtocolAltcellular,		EText,	ENoAttrs,    KCDTypeNameProtocolAltcellular },
       
   660 		{ KCDTIdProtocolNone,				EText,	ENoAttrs,    KCDTypeNameProtocolNone },
       
   661 		{ KCDTIdMessageCentreNumber,		EText,	ENoAttrs,    KCDTypeNameMessageCentreNumber },
       
   662 		{ KCDTIdMessageValidityPeriod,		EInt,	ENoAttrs,    KCDTypeNameMessageValidityPeriod },
       
   663 		{ KCDTIdMessageDeliveryReport,		EBool,	ENoAttrs,    KCDTypeNameMessageDeliveryReport },
       
   664 		{ KCDTIdMinSignalLevel,				EInt,	ENoAttrs,    KCDTypeNameMinSignalLevel },
       
   665 		{ KCDTIdCommRole,					EInt,	ENoAttrs,    KCDTypeNameCommRole },
       
   666 		{ KCDTIdControlChannelPortName,		EText,	ENoAttrs,    KCDTypeNameControlChannelPortName  },
       
   667 		{ KCDTIdSirSettings,				EInt,	ENoAttrs,    KCDTypeNameSirSettings },
       
   668 		{ KCDTIdBCAStack,					EText,  ENoAttrs,    KCDTypeNameBCAStack },
       
   669 		{ KCDTIdBearerTechnology,			EInt,	ENoAttrs,    KCDTypeNameBearerTechnology	},
       
   670 		/**** add new fields above this comment ****/
       
   671         // bearer base class
       
   672         { KCDTIdBearerAgent,				EText,  ENoAttrs,    KCDTypeNameBearerAgent },
       
   673 		{ 0, 0, ENoAttrs, KCDNull }
       
   674 
       
   675 	};
       
   676 
       
   677 
       
   678     const SRecordTypeInfo CommsDatSchemaV1_1::iLANBearerRecordInfo[] = {
       
   679 		// CCDRecordBase class
       
   680     	{ KCDTIdRecordTag,					    EInt,	ENoAttrs,    KCDTypeNameRecordTag },
       
   681 		{ KCDTIdRecordName,					    EText,	ENotNull,    KCDTypeNameRecordName },
       
   682 		// This class
       
   683 		{ KCDTIdLANBearerNifName,			    EText,	ENotNull,    KCDTypeNameNifName },
       
   684 		{ KCDTIdLANBearerLddFilename,		    EText,	ENoAttrs,    KCDTypeNameLanBearerLddFilename },
       
   685 		{ KCDTIdLANBearerLddName,			    EText,	ENotNull,    KCDTypeNameLanBearerLddName },
       
   686 		{ KCDTIdLANBearerPddFilename,		    EText,	ENoAttrs,    KCDTypeNameLanBearerPddFilename },
       
   687 		{ KCDTIdLANBearerPddName,			    EText,	ENotNull,    KCDTypeNameLanBearerPddName },
       
   688 		{ KCDTIdLANBearerPacketDriverName,	    EText,	ENoAttrs,    KCDTypeNameLanBearerPacketDriverName },
       
   689 		{ KCDTIdLANLastSocketActivityTimeout,	EInt,	ENoAttrs,    KCDTypeNameLastSocketActivityTimeout },
       
   690 		{ KCDTIdLANLastSessionClosedTimeout,	EInt,	ENoAttrs,    KCDTypeNameLastSessionClosedTimeout },
       
   691 		{ KCDTIdLANLastSocketClosedTimeout,	    EInt,	ENoAttrs,    KCDTypeNameLastSocketClosedTimeout },
       
   692 		{ KCDTIdBearerTechnology,				EInt,	ENoAttrs,    KCDTypeNameBearerTechnology	},
       
   693         /**** add new fields above this comment ****/
       
   694         // bearer base class
       
   695         { KCDTIdBearerAgent,				    EText,	ENotNull,    KCDTypeNameBearerAgent },
       
   696 	    { 0, 0, ENoAttrs, KCDNull }
       
   697 	};
       
   698 
       
   699 
       
   700     const SRecordTypeInfo CommsDatSchemaV1_1::iVirtualBearerRecordInfo[] = {
       
   701 		// CCDRecordBase class
       
   702     	{KCDTIdRecordTag,	                EInt,	ENoAttrs,    KCDTypeNameRecordTag },
       
   703 		{KCDTIdRecordName,	                EText,	ENotNull,    KCDTypeNameRecordName },
       
   704 		// This class
       
   705 		{KCDTIdVirtualBearerNifName,        EText,	ENotNull,    KCDTypeNameNifName },
       
   706     	{KCDTIdVBLastSocketActivityTimeout, EInt,	ENoAttrs,    KCDTypeNameLastSocketActivityTimeout },
       
   707      	{KCDTIdVBLastSessionClosedTimeout,  EInt,	ENoAttrs,    KCDTypeNameLastSessionClosedTimeout },
       
   708         {KCDTIdVBLastSocketClosedTimeout,	EInt,	ENoAttrs,    KCDTypeNameLastSocketClosedTimeout },
       
   709         {KCDTIdBearerTechnology,			EInt,	ENoAttrs,    KCDTypeNameBearerTechnology	},
       
   710     	/**** add new fields above this comment ****/
       
   711         // bearer base class
       
   712         {KCDTIdBearerAgent,                 EText,	ENotNull,    KCDTypeNameBearerAgent },
       
   713     	{ 0, 0, ENoAttrs, KCDNull }
       
   714 	};
       
   715 
       
   716 
       
   717 	const SRecordTypeInfo CommsDatSchemaV1_1::iWAPSMSBearerRecordInfo[] =
       
   718     {
       
   719 		// CCDRecordBase class
       
   720 		{ KCDTIdRecordTag,	                EInt,	ENoAttrs,    KCDTypeNameRecordTag },
       
   721 		{ KCDTIdRecordName,         	    EText,	ENotNull,    KCDTypeNameRecordName },
       
   722 		// This class
       
   723 		{ KCDTIdWAPSMSAccessPointId,	    ELinkWAPAPRecord,	ENotNull,    KCDTypeNameWAPAccessPointId },
       
   724 		{ KCDTIdWAPSMSGatewayAddress,	    EText,  ENoAttrs,    KCDTypeNameWAPGatewayAddress },
       
   725 		{ KCDTIdWAPSMSServiceCentreAddress,	EText,	ENoAttrs,    KCDTypeNameWAPServiceCentreAddress },
       
   726 		{ KCDTIdWAPSMSWSPOption,	        EInt,	ENoAttrs,    KCDTypeNameWAPWSPOption },
       
   727 		{ KCDTIdWAPSMSSecurity,	            EBool,	ENoAttrs,    KCDTypeNameWAPSecurity },
       
   728 		{ 0, 0, ENoAttrs, KCDNull }
       
   729     };
       
   730 
       
   731     const SRecordTypeInfo CommsDatSchemaV1_1::iWAPIPBearerRecordInfo[] = {
       
   732 		// CCDRecordBase class
       
   733     	{ KCDTIdRecordTag,	         EInt,  ENoAttrs,    KCDTypeNameRecordTag },
       
   734 		{ KCDTIdRecordName,	         EText, ENotNull,    KCDTypeNameRecordName },
       
   735 		// This class
       
   736     	{ KCDTIdWAPAccessPointId,	 ELinkWAPAPRecord,	ENotNull,    KCDTypeNameWAPAccessPointId },
       
   737 		{ KCDTIdWAPGatewayAddress,	 EText,             ENoAttrs,    KCDTypeNameWAPGatewayAddress },
       
   738 		{ KCDTIdWAPIAP,	 			 ELinkIAPRecord,	ENoAttrs,    KCDTypeNameWAPIAP },
       
   739 		{ KCDTIdWAPWSPOption,	     EInt,	            ENoAttrs,    KCDTypeNameWAPWSPOption },
       
   740 		{ KCDTIdWAPSecurity,	     EBool,             ENoAttrs,    KCDTypeNameWAPSecurity },
       
   741 		{ KCDTIdWAPProxyPort,	 	 EInt,	            ENotNull,    KCDTypeNameWAPProxyPort },
       
   742 		{ KCDTIdWAPProxyLoginName,	 EText,	            ENoAttrs,    KCDTypeNameWAPProxyLoginName },
       
   743 		{ KCDTIdWAPProxyLoginPass,	 EText,             ENoAttrs,    KCDTypeNameWAPProxyLoginPass },
       
   744 		{ 0, 0, ENoAttrs, KCDNull }
       
   745 	};
       
   746 
       
   747 
       
   748     const SRecordTypeInfo CommsDatSchemaV1_1::iChargecardRecordInfo[] = {
       
   749 		// CCDRecordBase class
       
   750 		{ KCDTIdRecordTag,		EInt,	ENoAttrs,    KCDTypeNameRecordTag },
       
   751 		{ KCDTIdRecordName,		EText,	ENotNull,    KCDTypeNameRecordName },
       
   752 		// This class
       
   753 		{ KCDTIdAccountNo,		EText,	ENoAttrs,    KCDTypeNameAccountNo },
       
   754 		{ KCDTIdPin,			EText,	ENoAttrs,    KCDTypeNamePin },
       
   755 		{ KCDTIdLocalRule,		EText,	ENoAttrs,    KCDTypeNameLocalRule },
       
   756 		{ KCDTIdNatRule,		EText,  ENoAttrs,    KCDTypeNameNatRule },
       
   757 		{ KCDTIdIntlRule,		EText,  ENoAttrs,    KCDTypeNameIntlRule },
       
   758         { 0, 0, ENoAttrs, KCDNull }
       
   759 	};
       
   760 
       
   761     const SRecordTypeInfo CommsDatSchemaV1_1::iProxiesRecordInfo[] = {
       
   762 		// CCDRecordBase class
       
   763     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   764 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   765 		// This class
       
   766 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   767     	{ KCDTIdISP,				ELink,		ENoAttrs,    KCDTypeNameProxyISP },
       
   768 #else
       
   769         { KCDTIdISP,				EInt,		ENoAttrs,    KCDTypeNameProxyISP },
       
   770 #endif //SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   771 		{ KCDTIdProxyServiceType,	EText,		ENoAttrs,    KCDTypeNameProxyServiceType },
       
   772 		{ KCDTIdUseProxyServer,		EBool,		ENotNull,    KCDTypeNameUseProxyServer },
       
   773 		{ KCDTIdServerName,			ELongText,	ENoAttrs,    KCDTypeNameServerName },
       
   774 		{ KCDTIdProtocolName,		EText,		ENotNull,    KCDTypeNameProtocolName },
       
   775 		{ KCDTIdPortNumber,			EInt,		ENoAttrs,    KCDTypeNamePortNumber },
       
   776 		{ KCDTIdExceptions,			ELongText,  ENoAttrs,    KCDTypeNameExceptions },
       
   777 	    { 0, 0, ENoAttrs, KCDNull }
       
   778 	};
       
   779 
       
   780 	const SRecordTypeInfo CommsDatSchemaV1_1::iSecureSocketRecordInfo[] = {
       
   781 		// CCDRecordBase class
       
   782     	{ KCDTIdRecordTag,	     EInt,	    ENoAttrs,    KCDTypeNameRecordTag },
       
   783 		{ KCDTIdRecordName,	     EText,	    ENotNull,    KCDTypeNameRecordName },
       
   784 		// This class
       
   785 		{ KCDTIdSSProtoName,     EText,	    ENotNull,    KCDTypeNameSSProtoName },
       
   786 	    { KCDTIdSSProtoLibrary,  EText,	    ENotNull,    KCDTypeNameSSProtoLibrary },
       
   787 	    { 0, 0, ENoAttrs, KCDNull }
       
   788 	};
       
   789 
       
   790 
       
   791     const SRecordTypeInfo CommsDatSchemaV1_1::iAgentLookupRecordInfo[] = {
       
   792 		// CCDRecordBase class
       
   793     	{ KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   794 		{ KCDTIdRecordName,	        EText,		ENotNull,   KCDTypeNameRecordName },
       
   795 		// This class
       
   796 		{ KCDTIdAgentFriendlyName,  EText,		ENotNull,   KCDTypeNameAgentFriendlyName },
       
   797     	{ KCDTIdAgentFileName,      EText,		ENotNull,   KCDTypeNameAgentFileName },
       
   798 		{ 0, 0, ENoAttrs, KCDNull }
       
   799 	};
       
   800 
       
   801     const SRecordTypeInfo CommsDatSchemaV1_1::iPANServiceExtRecordInfo[] = {
       
   802 		// CCDRecordBase class
       
   803     	{ KCDTIdRecordTag,	        	EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   804 		{ KCDTIdRecordName,	        	EText,		ENotNull,   KCDTypeNameRecordName },
       
   805 		// This class
       
   806     	{ KCDTIdLocalRole,	        	EInt,		ENotNull,   KCDTypeNameLocalRole },
       
   807 		{ KCDTIdPeerRole,	        	EInt,		ENotNull,   KCDTypeNamePeerRole },
       
   808 		{ KCDTIdPeerMACAddresses,  		EText,		ENotNull,   KCDTypeNamePeerMACAddresses },
       
   809     	{ KCDTIdPromptForRemoteDevices,	EBool,		ENotNull,   KCDTypeNamePromptForRemoteDevices },
       
   810     	{ KCDTIdDisableSdpQuery,		EBool,		ENotNull,   KCDTypeNameDisableSdpQuery },
       
   811 		{ KCDTIdAllowIncoming,			EBool,		ENotNull,   KCDTypeNameAllowIncoming },
       
   812     	{ KCDTIdPromptIfMACListFails,	EBool,		ENotNull,   KCDTypeNamePromptIfMACListFails },
       
   813 #ifdef SYMBIAN_NETWORKING_DHCPSERVER
       
   814 		{ KCDTIdNapServiceEnabled,			EBool,		ENotNull,   KCDTypeNameNapServiceEnabled },
       
   815 #endif // SYMBIAN_NETWORKING_DHCPSERVER    	
       
   816 		/**** add new fields above this comment ****/
       
   817         // service base class [BTW it is not correct that this inherits from Service Record base]
       
   818         { KCDTIdServiceEnableLlmnr,		        EBool,      ENoAttrs,    KCDTypeNameServiceEnableLlmnr },
       
   819 		{ 0, 0, ENoAttrs, KCDNull }
       
   820 	};
       
   821 
       
   822     const SRecordTypeInfo CommsDatSchemaV1_1::iAccessPointRecordInfo[] = {
       
   823 		// CCDRecordBase class
       
   824     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   825 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   826 		// This class
       
   827    		{ KCDTIdAccessPointGID,	    EInt,		            ENotNull,   KCDTypeNameAccessPointGID },
       
   828 		{ KCDTIdSelectionPolicy,    ELink,		            ENotNull,   KCDTypeNameSelectionPolicy },
       
   829 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   830     	{ KCDTIdTier,                   ELinkTierRecord,		ENotNull,   KCDTypeNameTier },
       
   831 		{ KCDTIdMCpr,                   ELinkMCprRecord,		ENotNull,   KCDTypeNameMCpr },
       
   832 		{ KCDTIdCpr,                    ELinkCprRecord,		    ENotNull,   KCDTypeNameCpr },
       
   833 		{ KCDTIdSCpr,                   ELinkSCprRecord,		ENotNull,   KCDTypeNameSCpr },
       
   834 		{ KCDTIdProtocol,               ELinkProtocolRecord,    ENotNull,   KCDTypeNameProtocol },
       
   835 		{ KCDTIdCprConfig,              EInt,		            ENotNull,   KCDTypeNameCprConfig },
       
   836 		{ KCDTIdAppSID,                 EInt,		            ENoAttrs,   KCDTypeNameAppSID },
       
   837 		{ KCDTIdConfigAPIdList,         EText,                  ENoAttrs,   KCDTypeNameConfigAPIdList },
       
   838 		{ KCDTIdCustomSelectionPolicy,  EInt,		            ENoAttrs,   KCDTypeNameCustomSelectionPolicy },
       
   839 		{ KCDTIdAccessPointPriority,    EUint32,		ENoAttrs,	KCDTypeNameAccessPointPriority },
       
   840 #endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   841 	    { 0, 0, ENoAttrs, KCDNull }
       
   842 	};
       
   843 
       
   844 	const SRecordTypeInfo CommsDatSchemaV1_1::iIAPPrioritySelectionPolicyRecordInfo[] = {
       
   845 		// CCDRecordBase class
       
   846    		{ KCDTIdRecordTag,	EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   847 		{ KCDTIdRecordName,	EText,		ENotNull,   KCDTypeNameRecordName },
       
   848 		// This class
       
   849    		{ KCDTIdIap1,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap1Name },
       
   850 		{ KCDTIdIap2,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap2Name },
       
   851 		{ KCDTIdIap3,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap3Name },
       
   852 		{ KCDTIdIap4,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap4Name },
       
   853 		{ KCDTIdIap5,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap5Name },
       
   854 		{ KCDTIdIap6,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap6Name },
       
   855 		{ KCDTIdIap7,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap7Name },
       
   856 		{ KCDTIdIap8,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap8Name },
       
   857 		{ KCDTIdIap9,       ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap9Name },
       
   858 		{ KCDTIdIap10,      ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap10Name },
       
   859 		{ KCDTIdIap11,      ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap11Name },
       
   860 		{ KCDTIdIap12,      ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap12Name },
       
   861 		{ KCDTIdIap13,      ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap13Name },
       
   862 		{ KCDTIdIap14,      ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap14Name },
       
   863 		{ KCDTIdIap15,      ELinkIAPRecord,		ENoAttrs,   KCDTypeNameIap15Name },
       
   864 		{ KCDTIdIapCount,   EInt,		ENoAttrs,   KCDTypeNameIapCountName },
       
   865 		{ 0, 0, ENoAttrs, KCDNull }
       
   866 	};
       
   867     
       
   868     
       
   869 	const SRecordTypeInfo CommsDatSchemaV1_1::iEAPSecRecordInfo[] = {
       
   870 		// CCDRecordBase class
       
   871 	  	{ KCDTIdRecordTag,	        	EInt,   ENoAttrs,   KCDTypeNameRecordTag },
       
   872   		{ KCDTIdRecordName,     		EText,  ENotNull,   KCDTypeNameRecordName },
       
   873 		// This class
       
   874 		{ KCDTIdEAPSecOuterEAPType,		EInt,	ENoAttrs,	KCDTypeNameEAPSecOuterEAPType },
       
   875 		{ KCDTIdEAPSecId,				EMedText,	ENoAttrs,	KCDTypeNameEapId },
       
   876 		{ KCDTIdEAPSecPassword,			EMedText,	ENoAttrs,	KCDTypeNameEAPSecPassword },	
       
   877 		{ KCDTIdEAPSecConfigId,			EUint32,ENoAttrs,	KCDTypeNameEAPSecConfigId },
       
   878 		{ KCDTIdEAPSecData,				EInt,	ENoAttrs,	KCDTypeNameEAPSecData },
       
   879         { KCDTIdEAPSecVendorId,			EText,  ENoAttrs,	KCDTypeNameEAPSecVendorId },
       
   880         { KCDTIdEAPSecVendorType,		EUint32,ENoAttrs,	KCDTypeNameEAPSecVendorType },
       
   881 		{ 0, 0, ENoAttrs, KCDNull }
       
   882   	};
       
   883 
       
   884 	const SRecordTypeInfo CommsDatSchemaV1_1::iTunEAPRecordInfo[] = {
       
   885 		// CCDRecordBase class
       
   886 	  	{ KCDTIdRecordTag,	       		EInt,   ENoAttrs,   KCDTypeNameRecordTag },
       
   887   		{ KCDTIdRecordName,    			EText,  ENotNull,   KCDTypeNameRecordName },
       
   888 		// This class
       
   889 		{ KCDTIdTUNEAPInnerType,		EInt,	ENoAttrs,	KCDTypeNameTUNEAPInnerType },
       
   890 		{ KCDTIdTUNEAPData,				EInt,	ENoAttrs,	KCDTypeNameTUNEAPData },
       
   891 		{ 0, 0, ENoAttrs, KCDNull }
       
   892   	};
       
   893 
       
   894 	const SRecordTypeInfo CommsDatSchemaV1_1::iEAPTLSRecordInfo[] = {
       
   895 		// CCDRecordBase class
       
   896 	  	{ KCDTIdRecordTag,	       		EInt,   ENoAttrs,   KCDTypeNameRecordTag },
       
   897   		{ KCDTIdRecordName,    			EText,  ENotNull,   KCDTypeNameRecordName },
       
   898 		// This class
       
   899 		{ KCDTIdEAPTLSClientCertName,	EText,	ENotNull,	KCDTypeNameEAPTLSClientCertName },
       
   900 		{ 0, 0, ENoAttrs, KCDNull }
       
   901   	};
       
   902 
       
   903 	const SRecordTypeInfo CommsDatSchemaV1_1::iLEAPRecordInfo[] = {
       
   904 		// CCDRecordBase class
       
   905 	  	{ KCDTIdRecordTag,	       		EInt,   ENoAttrs,   KCDTypeNameRecordTag },
       
   906   		{ KCDTIdRecordName,    			EText,  ENotNull,   KCDTypeNameRecordName },
       
   907 		// This class
       
   908 		{ KCDTIdLEAPTimeout,			EInt,	ENoAttrs,	KCDTypeNameLEAPTimeout },
       
   909 		{ 0, 0, ENoAttrs, KCDNull }
       
   910   	};
       
   911 
       
   912 	 const SRecordTypeInfo CommsDatSchemaV1_1::iEAPSIMRecordInfo[] = {
       
   913  		// CCDRecordBase class
       
   914  		{ KCDTIdRecordTag, EInt, ENoAttrs, KCDTypeNameRecordTag },
       
   915    		{ KCDTIdRecordName, EText, ENotNull, KCDTypeNameRecordName },
       
   916 		// This class
       
   917    		{ KCDTIdEapSimProtocolId, EInt, ENotNull, KCDTypeNameEapSimProtocolId },
       
   918    		{ KCDTIdEapSimPseudonym, EDesC8, ENotNull, KCDTypeNameEapSimPseudonym },
       
   919 		{ KCDTIdEapSimUseNaiRealm, EBool, ENotNull, KCDTypeNameEapSimUseNaiRealm },
       
   920 		{ KCDTIdEapSimNaiRealm, EDesC8, ENotNull, KCDTypeNameEapSimNaiRealm },
       
   921 		{ KCDTIdEapSimMinRands, EInt, ENotNull, KCDTypeNameEapSimMinRands },
       
   922 		{ 0, 0, ENoAttrs, KCDNull }
       
   923 	};
       
   924 	
       
   925     const SRecordTypeInfo CommsDatSchemaV1_1::iEAPAKARecordInfo[] = {
       
   926 		// CCDRecordBase class
       
   927     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   928 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   929 		// This class
       
   930  		{ KCDTIdEapAkaProtocolId,           EInt,   ENotNull, KCDTypeNameEapAkaProtocolId },
       
   931    		{ KCDTIdEapAkaPseudonym,            EDesC8, ENotNull, KCDTypeNameEapAkaPseudonym },
       
   932 		{ KCDTIdEapAkaUseNaiRealm,          EBool,  ENotNull, KCDTypeNameEapAkaUseNaiRealm },
       
   933 		{ KCDTIdEapAkaNaiRealm,             EDesC8, ENotNull, KCDTypeNameEapAkaNaiRealm },
       
   934 	    { 0, 0, ENoAttrs, KCDNull }
       
   935     };
       
   936 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   937     const SRecordTypeInfo CommsDatSchemaV1_1::iAPPrioritySelectionPolicyRecordInfo[] = {
       
   938 		// CCDRecordBase class
       
   939     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
   940 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
   941 		// This class
       
   942    		{ KCDTIdAp1,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp1Name },
       
   943 		{ KCDTIdAp2,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp2Name },
       
   944 		{ KCDTIdAp3,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp3Name },
       
   945 		{ KCDTIdAp4,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp4Name },
       
   946 		{ KCDTIdAp5,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp5Name },
       
   947 		{ KCDTIdAp6,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp6Name },
       
   948 		{ KCDTIdAp7,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp7Name },
       
   949 		{ KCDTIdAp8,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp8Name },
       
   950 		{ KCDTIdAp9,        ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp9Name },
       
   951 		{ KCDTIdAp10,       ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp10Name },
       
   952 		{ KCDTIdAp11,       ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp11Name },
       
   953 		{ KCDTIdAp12,       ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp12Name },
       
   954 		{ KCDTIdAp13,       ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp13Name },
       
   955 		{ KCDTIdAp14,       ELinkAPRecord,	    ENoAttrs,   KCDTypeNameAp14Name },
       
   956 		{ KCDTIdAp15,       ELinkAPRecord,		ENoAttrs,   KCDTypeNameAp15Name },
       
   957 		{ KCDTIdApCount,   EInt,		ENoAttrs,   KCDTypeNameApCountName },
       
   958 		{ 0, 0, ENoAttrs, KCDNull }
       
   959 	};
       
   960 
       
   961     const SRecordTypeInfo CommsDatSchemaV1_1::iTierRecordInfo[] = {
       
   962 		// CCDRecordBase class
       
   963    		{ KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   964 		{ KCDTIdRecordName,	        EText,		ENotNull,   KCDTypeNameRecordName },
       
   965 		// This class
       
   966 		{ KCDTIdTierImplUid,		EInt,		ENotNull,   KCDTypeNameTierImplUid },
       
   967     	{ KCDTIdTierThreadName,     EText,		ENotNull,   KCDTypeNameTierThreadName },
       
   968     	{ KCDTIdTierManagerName,    EText,		ENotNull,   KCDTypeNameTierManagerName },
       
   969     	{ KCDTIdDefaultAccessPoint, ELinkAPRecord,	ENotNull,   KCDTypeNameDefaultAccessPoint },
       
   970     	{ KCDTIdPromptUser,         EInt,		ENotNull,   KCDTypeNamePromptUser },
       
   971 		{ 0, 0, ENoAttrs, KCDNull }
       
   972 	};
       
   973 
       
   974     const SRecordTypeInfo CommsDatSchemaV1_1::iMCprRecordInfo[] = {
       
   975 		// CCDRecordBase class
       
   976    		{ KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   977    		{ KCDTIdRecordName,	        EText,		ENotNull,   KCDTypeNameRecordName },
       
   978 		// This class
       
   979    		{ KCDTIdMCprUid,            EInt,		ENotNull,   KCDTypeNameMCprUid },
       
   980 		{ 0, 0, ENoAttrs, KCDNull }
       
   981 	};
       
   982 
       
   983     const SRecordTypeInfo CommsDatSchemaV1_1::iCprRecordInfo[] = {
       
   984 		// CCDRecordBase class
       
   985    		{ KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   986    		{ KCDTIdRecordName,	        EText,		ENotNull,   KCDTypeNameRecordName },
       
   987 		// This class
       
   988    		{ KCDTIdCprUid,             EInt,		ENotNull,   KCDTypeNameCprUid },
       
   989 		{ 0, 0, ENoAttrs, KCDNull }
       
   990 	};
       
   991 
       
   992     const SRecordTypeInfo CommsDatSchemaV1_1::iSCprRecordInfo[] = {
       
   993 		// CCDRecordBase class
       
   994    		{ KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
   995    		{ KCDTIdRecordName,	        EText,		ENotNull,   KCDTypeNameRecordName },
       
   996 		// This class
       
   997    		{ KCDTIdSCprUid,            EInt,		ENotNull,   KCDTypeNameSCprUid },
       
   998 		{ 0, 0, ENoAttrs, KCDNull }
       
   999 	};
       
  1000 
       
  1001     const SRecordTypeInfo CommsDatSchemaV1_1::iProtocolRecordInfo[] = {
       
  1002 		// CCDRecordBase class
       
  1003    		{ KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
  1004    		{ KCDTIdRecordName,	        EText,		ENotNull,   KCDTypeNameRecordName },
       
  1005 		// This class
       
  1006    		{ KCDTIdProtocolUid,        EInt,		ENotNull,   KCDTypeNameProtocolUid },
       
  1007    		{ KCDTIdProtocolConfigLoaderUid, EInt,          ENoAttrs,   KCDTypeNameProtocolConfigLoaderUid },
       
  1008 		{ 0, 0, ENoAttrs, KCDNull }
       
  1009 	};
       
  1010 
       
  1011     const SRecordTypeInfo CommsDatSchemaV1_1::iBearerTypeRecordInfo[] = {
       
  1012 		// CCDRecordBase class
       
  1013     	{ KCDTIdRecordTag,	EInt,		        ENoAttrs,   KCDTypeNameRecordTag },
       
  1014 		{ KCDTIdRecordName,	EText,		        ENotNull,   KCDTypeNameRecordName },
       
  1015 		// This class
       
  1016    		{ KCDTIdBearerTypeTier,     ELinkTierRecord,	    ENotNull,   KCDTypeNameTier },
       
  1017 		{ KCDTIdBearerTypeMCpr,     ELinkMCprRecord,        ENotNull,   KCDTypeNameMCpr },
       
  1018 		{ KCDTIdBearerTypeCpr,      ELinkCprRecord,         ENotNull,   KCDTypeNameCpr  },
       
  1019 		{ KCDTIdBearerTypeSCpr,     ELinkSCprRecord,	    ENotNull,   KCDTypeNameSCpr },
       
  1020 		{ KCDTIdBearerTypeProtocol, ELinkProtocolRecord,    ENotNull,   KCDTypeNameProtocol },
       
  1021 	    { 0, 0, ENoAttrs, KCDNull }
       
  1022 	};
       
  1023 		
       
  1024 	const SRecordTypeInfo CommsDatSchemaV1_1::iConfigAccessPointRecordInfo[] = {
       
  1025 		// CCDRecordBase class
       
  1026         { KCDTIdRecordTag,	        EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
  1027 		{ KCDTIdRecordName,	        EText,		ENotNull,   KCDTypeNameRecordName },
       
  1028 		// This class
       
  1029         { KCDTIdConfigAccessPointSCpr,              ELinkSCprRecord,    ENotNull,   KCDTypeNameConfigAccessPointSCpr },
       
  1030 		{ KCDTIdConfigAccessPointProtocol,          ELinkProtocolRecord,ENotNull,   KCDTypeNameConfigAccessPointProtocol },
       
  1031 		{ KCDTIdConfigAccessPointProtocolConfig,    EInt,               ENotNull,   KCDTypeNameConfigAccessPointProtocolConfig },
       
  1032 		{ KCDTIdConfigAccessPointLayerBelow,        ELinkCAPRecord,     ENoAttrs,   KCDTypeNameConfigAccessPointLayerBelow },
       
  1033 		{ 0, 0, ENoAttrs, KCDNull }
       
  1034      };
       
  1035 
       
  1036  	const SRecordTypeInfo CommsDatSchemaV1_1::iPolicySelectorRecordInfo[] = {
       
  1037  		{ KCDTIdRecordTag,	  		EInt,		ENoAttrs,	KCDTypeNameRecordTag },
       
  1038  		{ KCDTIdRecordName,	  		EText,		ENotNull,	KCDTypeNameRecordName },
       
  1039  		{ KCDTIdPolicyId,			EInt,		ENotNull,	KCDTypeNamePolicyId },
       
  1040  		{ KCDTIdAppUid,				EInt,		ENotNull,	KCDTypeNameAppUid },
       
  1041  		{ KCDTIdSrcAddress,			EText,		ENotNull,	KCDTypeNameSrcAddress },
       
  1042  		{ KCDTIdSrcMask,			EText,		ENotNull,	KCDTypeNameSrcMask },
       
  1043  		{ KCDTIdDstAddress,			EText,		ENotNull,	KCDTypeNameDstAddress },
       
  1044  		{ KCDTIdDstMask,			EText,		ENotNull,	KCDTypeNameDstMask },
       
  1045  		{ KCDTIdSrcPort,			EInt,		ENotNull,	KCDTypeNameSrcPort },
       
  1046  		{ KCDTIdDstPort,			EInt,		ENotNull,	KCDTypeNameDstPort },
       
  1047  		{ KCDTIdSrcPortMax,			EInt,		ENotNull,	KCDTypeNameSrcPortMax },
       
  1048  		{ KCDTIdDstPortMax,			EInt,		ENotNull,	KCDTypeNameDstPortMax },
       
  1049  		{ KCDTIdProtocolId,			EUint32,	ENotNull,	KCDTypeNameProtocolId },
       
  1050  		{ KCDTIdIAPid,				EUint32,	ENotNull,	KCDTypeNameIAPid },
       
  1051  		{ KCDTIdPriority,			EInt,		ENotNull,	KCDTypeNamePriority },
       
  1052  		{ 0, 0, ENoAttrs, KCDNull }
       
  1053      };
       
  1054  
       
  1055  	const SRecordTypeInfo CommsDatSchemaV1_1::iPolicySelector2ParamsRecordInfo[] = {
       
  1056 		{ KCDTIdRecordTag,	        		EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
  1057  		{ KCDTIdRecordName,	        		EText,		ENotNull,   KCDTypeNameRecordName },
       
  1058    		{ KCDTIdPolicySelectorId,	  		EInt,		ENotNull,	KCDTypeNamePolicySelectorId },
       
  1059  		{ KCDTIdParamsId,			EInt,		ENotNull,	KCDTypeNameParamsId },
       
  1060  		{ 0, 0, ENoAttrs, KCDNull }
       
  1061      };
       
  1062 
       
  1063  	const SRecordTypeInfo CommsDatSchemaV1_1::iGenericQosRecordInfo[] = {
       
  1064     		{ KCDTIdRecordTag,	        		EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
  1065  		{ KCDTIdRecordName,	        		EText,		ENotNull,   KCDTypeNameRecordName },
       
  1066      	{ KCDTIdUplinkBandwidth,     		EInt,		ENotNull,   KCDTypeNameUplinkBandwidth},
       
  1067      	{ KCDTIdDownLinkMaximumBurstSize,   EInt,		ENotNull,   KCDTypeNameDownLinkMaximumBurstSize},
       
  1068      	{ KCDTIdUpLinkMaximumBurstSize,     EInt,		ENotNull,   KCDTypeNameUpLinkMaximumBurstSize},
       
  1069      	{ KCDTIdDownLinkAveragePacketSize,  EInt,		ENotNull,   KCDTypeNameDownLinkAveragePacketSize},
       
  1070      	{ KCDTIdUpLinkAveragePacketSize,    EInt,		ENotNull,   KCDTypeNameUpLinkAveragePacketSize},
       
  1071      	{ KCDTIdDownLinkMaximumPacketSize,  EInt,		ENotNull,   KCDTypeNameDownLinkMaximumPacketSize},
       
  1072      	{ KCDTIdUpLinkMaximumPacketSize,    EInt,		ENotNull,   KCDTypeNameUpLinkMaximumPacketSize},
       
  1073      	{ KCDTIdDownLinkDelay,     			EInt,		ENotNull,   KCDTypeNameDownLinkDelay},
       
  1074      	{ KCDTIdUpLinkDelay,     			EInt,		ENotNull,   KCDTypeNameUpLinkDelay},
       
  1075      	{ KCDTIdDownLinkDelayVariation,     EInt,		ENotNull,   KCDTypeNameDownLinkDelayVariation},
       
  1076      	{ KCDTIdUpLinkDelayVariation,     	EInt,		ENotNull,   KCDTypeNameUpLinkDelayVariation},
       
  1077      	{ KCDTIdDownLinkPriority,     		EInt,		ENotNull,   KCDTypeNameDownLinkPriority},
       
  1078      	{ KCDTIdUpLinkPriority,     		EInt,		ENotNull,   KCDTypeNameUpLinkPriority},
       
  1079      	{ KCDTIdHeaderMode, 				EBool,	    ENotNull,   KCDTypeNameHeaderMode },
       
  1080  //    	{ KCDTIdQosName,         			EText,		ENotNull,   KCDTypeNameQosName },
       
  1081  		{ 0, 0, ENoAttrs, KCDNull }
       
  1082  	};	
       
  1083 #endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1084 
       
  1085     //
       
  1086     // Lookup table to associate table name with Table Id
       
  1087     //  
       
  1088 
       
  1089 	const SRecordTypeInfo CommsDatSchemaV1_1::iWifiScanEngineRecordInfo[] = {
       
  1090    		{ KCDTIdRecordTag,	        		EInt,		ENoAttrs,   KCDTypeNameRecordTag },
       
  1091 		{ KCDTIdRecordName,	        		EText,		ENotNull,   KCDTypeNameRecordName },
       
  1092 		{ KCDTIdScanPeriodMs,  				EInt,		ENotNull,	KCDTypeNameScanPeriodMs },
       
  1093 		{ KCDTIdRSSIMin,					EInt,		ENotNull,	KCDTypeNameRSSIMin },
       
  1094 		{ KCDTIdRSSIMax,					EInt,		ENotNull,	KCDTypeNameRSSIMax },
       
  1095 		{ 0, 0, ENoAttrs, KCDNull }
       
  1096     };
       
  1097 
       
  1098     const STableLookup CommsDatSchemaV1_1::iTableLookup[] = {
       
  1099 	{KCDTIdConnectionPrefsRecord,				KCDTypeNameConnectionPrefs,				CommsDatSchemaV1_1::iConnectionPrefsRecordInfo },
       
  1100 	{KCDTIdNetworkRecord,						KCDTypeNameNetwork,						CommsDatSchemaV1_1::iNetworkRecordInfo },
       
  1101 	{KCDTIdIAPRecord,							KCDTypeNameIAP,							CommsDatSchemaV1_1::iIAPRecordInfo },
       
  1102 	{KCDTIdWAPAccessPointRecord,				KCDTypeNameWAPAccessPoint,				CommsDatSchemaV1_1::iWAPAccessPointRecordInfo },
       
  1103 	{KCDTIdDialOutISPRecord,					KCDTypeNameDialOutISP,					CommsDatSchemaV1_1::iDialOutISPRecordInfo },
       
  1104 	{KCDTIdDialInISPRecord,						KCDTypeNameDialInISP,					CommsDatSchemaV1_1::iDialInISPRecordInfo },
       
  1105 	{KCDTIdLANServiceRecord,					KCDTypeNameLANService,					CommsDatSchemaV1_1::iLANServiceRecordInfo },
       
  1106 	{KCDTIdWLANServiceExtRecord,				KCDTypeNameWLANServiceExt,				CommsDatSchemaV1_1::iWLANServiceExtRecordInfo },
       
  1107 	{KCDTIdVPNServiceRecord,					KCDTypeNameVPNService,					CommsDatSchemaV1_1::iVPNServiceRecordInfo },
       
  1108 	{KCDTIdWCDMAPacketServiceRecord,			KCDTypeNameWCDMAPacketService,			CommsDatSchemaV1_1::iWCDMAPacketServiceRecordInfo },
       
  1109 	{KCDTIdOutgoingGprsRecord,					KCDTypeNameOutgoingWCDMA,				CommsDatSchemaV1_1::iWCDMAPacketServiceRecordInfo },
       
  1110 	{KCDTIdIncomingGprsRecord,					KCDTypeNameIncomingWCDMA,				CommsDatSchemaV1_1::iWCDMAPacketServiceRecordInfo },
       
  1111 	{KCDTIdDefaultWCDMARecord,					KCDTypeNameDefaultWCDMA,				CommsDatSchemaV1_1::iDefaultWCDMARecordInfo },
       
  1112 	{KCDTIdModemBearerRecord,					KCDTypeNameModemBearer,					CommsDatSchemaV1_1::iModemBearerRecordInfo },
       
  1113 	{KCDTIdLANBearerRecord,						KCDTypeNameLANBearer,					CommsDatSchemaV1_1::iLANBearerRecordInfo },
       
  1114 	{KCDTIdVirtualBearerRecord,					KCDTypeNameVirtualBearer,				CommsDatSchemaV1_1::iVirtualBearerRecordInfo },
       
  1115 	{KCDTIdWAPSMSBearerRecord,					KCDTypeNameWAPSMSBearer,				CommsDatSchemaV1_1::iWAPSMSBearerRecordInfo },
       
  1116 	{KCDTIdWAPIPBearerRecord,					KCDTypeNameWAPIPBearer,					CommsDatSchemaV1_1::iWAPIPBearerRecordInfo },
       
  1117 	{KCDTIdChargecardRecord,					KCDTypeNameChargecard,					CommsDatSchemaV1_1::iChargecardRecordInfo },
       
  1118 	{KCDTIdProxiesRecord,						KCDTypeNameProxies,						CommsDatSchemaV1_1::iProxiesRecordInfo },
       
  1119 	{KCDTIdSSProtoRecord,						KCDTypeNameSSProto,						CommsDatSchemaV1_1::iSecureSocketRecordInfo},
       
  1120 	{KCDTIdAgentLookupRecord,					KCDTypeNameAgentLookup,					CommsDatSchemaV1_1::iAgentLookupRecordInfo },
       
  1121 	{KCDTIdPANServiceExtRecord,					KCDTypeNamePANServiceExt,				CommsDatSchemaV1_1::iPANServiceExtRecordInfo },
       
  1122 	{KCDTIdGlobalSettingsRecord,				KCDTypeNameGlobalSettings,				CommsDatSchemaV1_1::iGlobalSettingsRecordInfo },
       
  1123 	{KCDTIdLocationRecord,						KCDTypeNameLocation,					CommsDatSchemaV1_1::iLocationRecordInfo },
       
  1124     {KCDTIdAccessPointRecord,	        	    KCDTypeNameAccessPoint,					CommsDatSchemaV1_1::iAccessPointRecordInfo },
       
  1125     {KCDTIdIapPrioritySelectionPolicyRecord,    KCDTypeNameIapPrioritySelectionPolicy,	CommsDatSchemaV1_1::iIAPPrioritySelectionPolicyRecordInfo },
       
  1126     {KCDTIdUmtsR99QoSAndOnTableRecord,          KCDTypeNameUmtsR99QoSAndOnTable,		CommsDatSchemaV1_1::iUmtsR99QoSAndOnTableRecordInfo },
       
  1127 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1128     {KCDTIdTierRecord,        	                KCDTypeNameTierRecord,					CommsDatSchemaV1_1::iTierRecordInfo },
       
  1129     {KCDTIdMCprRecord,        			        KCDTypeNameMCprRecord,					CommsDatSchemaV1_1::iMCprRecordInfo },
       
  1130     {KCDTIdCprRecord,        	                KCDTypeNameCprRecord,					CommsDatSchemaV1_1::iCprRecordInfo },
       
  1131     {KCDTIdSCprRecord,                          KCDTypeNameSCprRecord,					CommsDatSchemaV1_1::iSCprRecordInfo },
       
  1132     {KCDTIdProtocolRecord,                      KCDTypeNameProtocolRecord,				CommsDatSchemaV1_1::iProtocolRecordInfo },
       
  1133     {KCDTIdBearerTypeRecord,                    KCDTypeNameBearerTypeRecord,			CommsDatSchemaV1_1::iBearerTypeRecordInfo },
       
  1134     {KCDTIdConfigAccessPointRecord,             KCDTypeNameConfigAccessPointRecord,		CommsDatSchemaV1_1::iConfigAccessPointRecordInfo },
       
  1135     {KCDTIdApPrioritySelectionPolicyRecord,     KCDTypeNameApPrioritySelectionPolicy,	CommsDatSchemaV1_1::iAPPrioritySelectionPolicyRecordInfo },
       
  1136 #endif //SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1137     {KCDTIdEapSimProtocolRecord,                KCDTypeNameEapSimProtocol,				CommsDatSchemaV1_1::iEAPSIMRecordInfo },
       
  1138     {KCDTIdEapAkaProtocolRecord,                KCDTypeNameEapAkaProtocol,				CommsDatSchemaV1_1::iEAPAKARecordInfo },
       
  1139 	{KCDTIdEAPSecRecord,						KCDTTypeNameEAPSec,			            CommsDatSchemaV1_1::iEAPSecRecordInfo },
       
  1140 	{KCDTIdTunEAPRecord,						KCDTTypeNameTunEAP,			            CommsDatSchemaV1_1::iTunEAPRecordInfo },
       
  1141 	{KCDTIdEAPTLSRecord,						KCDTTypeNameEAPTLS,			            CommsDatSchemaV1_1::iEAPTLSRecordInfo },
       
  1142 	{KCDTIdLEAPRecord,							KCDTTypeNameLEAP,			            CommsDatSchemaV1_1::iLEAPRecordInfo },
       
  1143 	{0,											NULL,			NULL } // stop marker
       
  1144 	};
       
  1145 
       
  1146 /*****************************************************************************************
       
  1147 2/ Static functions to interpret element ids
       
  1148 **********************************************/
       
  1149 
       
  1150 
       
  1151 TBool CommsDatSchema::IsNode(TMDBElementId aElementId)
       
  1152 /*
       
  1153 [ C == 7f ]
       
  1154 [ R == ff ]
       
  1155 Identifies Node as opposed to Field
       
  1156 Understands new table, column or record request to mean Node too
       
  1157 */
       
  1158     {
       
  1159     return ( (aElementId & KCDMaskShowRecordId) == KCDMaskShowRecordId ||
       
  1160 			 (aElementId & KCDMaskShowFieldType) == KCDMaskShowFieldType  );
       
  1161     }
       
  1162 
       
  1163 TBool CommsDatSchema::IsTable(TMDBElementId aElementId)
       
  1164 /*
       
  1165 [ 0 < T < ff ][ C == 7f ][ R == ff ]
       
  1166 */
       
  1167     {
       
  1168     return ( (aElementId & KCDMaskShowColumnTypeAndRecordId) == KCDMaskShowColumnTypeAndRecordId &&
       
  1169 			 HasValidTableId(aElementId) );
       
  1170     }
       
  1171 
       
  1172 
       
  1173 TBool CommsDatSchema::IsColumn(TMDBElementId aElementId)
       
  1174 /*
       
  1175 [ 0 < T <= 7f8 ][ 0 < C < ff][ R == ff]
       
  1176 */
       
  1177     {
       
  1178     return ( (aElementId & KCDMaskShowRecordId) == KCDMaskShowRecordId &&
       
  1179 			 HasValidColumnId(aElementId) &&
       
  1180 			 HasValidTableId(aElementId) );
       
  1181     }
       
  1182 
       
  1183 
       
  1184 TBool CommsDatSchema::IsRecord(TMDBElementId aElementId)
       
  1185 /*
       
  1186 [ 0 < T <= 7f8 ][ C == 7f ][ R < ff ]
       
  1187 */
       
  1188     {
       
  1189     return ( (aElementId & KCDMaskShowFieldType) == KCDMaskShowFieldType &&
       
  1190 			 HasValidRecordId(aElementId) &&
       
  1191 			 HasValidTableId(aElementId) );
       
  1192     }
       
  1193 
       
  1194 
       
  1195 TBool CommsDatSchema::IsGenericRecord(TMDBElementId aElementId)
       
  1196 /*
       
  1197 [ 5F8 < T <= 7f8 ][ C == ff][ R == ff ]
       
  1198 */
       
  1199     {
       
  1200     const TMDBElementId tableType = (aElementId & KCDMaskShowRecordType);
       
  1201     return ( ( tableType >= KCDInitialUDefRecordType || tableType == 0 ) ||
       
  1202 			 IsNewTableRequest(aElementId) ); // But don't support new table request currently
       
  1203     }
       
  1204 
       
  1205 
       
  1206 TBool CommsDatSchema::IsTemplate(TMDBElementId aElementId)
       
  1207 /*
       
  1208 0 record id in real table
       
  1209 [ 0 < T < 7f8 ][ 0 < C < ff ][ R == 0 ]
       
  1210 */
       
  1211     {
       
  1212     return ( (aElementId & KCDMaskShowRecordId) == KCDDefaultRecord &&
       
  1213 			 HasValidTableId(aElementId) );
       
  1214     }
       
  1215 
       
  1216 
       
  1217 TBool CommsDatSchema::HasValidTableId(TMDBElementId aElementId)
       
  1218 	{
       
  1219 	const TMDBElementId recordType = (aElementId & KCDMaskShowRecordType);
       
  1220 	return ( recordType > 0  &&
       
  1221 		     recordType <= KCDMaskShowRecordType );
       
  1222 	}
       
  1223 
       
  1224 
       
  1225 TBool CommsDatSchema::HasValidColumnId(TMDBElementId aElementId)
       
  1226 /*
       
  1227 [ 0 <= C < ff ]
       
  1228 */
       
  1229 	{
       
  1230 	const TMDBElementId fieldType = (aElementId & KCDMaskShowFieldType);
       
  1231 	return ( fieldType > 0  &&
       
  1232 			 fieldType < KCDMaskShowFieldType );
       
  1233 	}
       
  1234 
       
  1235 
       
  1236 TBool CommsDatSchema::HasValidRecordId(TMDBElementId aElementId)
       
  1237 /*
       
  1238 [ 0 <= R < ff ]
       
  1239 */
       
  1240 	{
       
  1241 	return (aElementId & KCDMaskShowRecordId) < KCDMaskShowRecordId;
       
  1242 	}
       
  1243 
       
  1244 
       
  1245 TBool CommsDatSchema::IsNewTableRequest(TMDBElementId aElementId)
       
  1246 /*
       
  1247 <T==0><C==7f><R==ff>
       
  1248 */
       
  1249 	{
       
  1250 	return (aElementId & KCDMaskHideAttrAndRes) == KCDNewTableRequest;
       
  1251 	}
       
  1252 
       
  1253 
       
  1254 TBool CommsDatSchema::IsNewColumnRequest(TMDBElementId aElementId)
       
  1255 /*
       
  1256 0xnn00ff01
       
  1257 [ 0 < T < ff ][ C == 0 ][ R == ff ][ LSB == 1 ]
       
  1258 */	{
       
  1259     return ( ( aElementId & ~( KCDMaskShowAttributes | KCDUtilityFlag ) ) ==
       
  1260              ( KCDNewColumnRequest | (aElementId & KCDMaskShowFieldType) ) );
       
  1261 	}
       
  1262 
       
  1263 
       
  1264 TBool CommsDatSchema::IsNewRecordRequest(TMDBElementId aElementId)
       
  1265 /*
       
  1266 0x8n7f0001
       
  1267 [ U == 1 ][ 0 < T < ff ][ C == 7f ][ R == 00 ][ LSB == 1 ]
       
  1268 */
       
  1269 	{
       
  1270 	return (aElementId & KCDMaskHideAttrAndRes) ==
       
  1271               ( (KCDNewRecordRequest & KCDMaskHideAttrAndRes) | (aElementId & KCDMaskShowRecordType) );
       
  1272 
       
  1273 	}
       
  1274 
       
  1275 
       
  1276 TBool CommsDatSchema::IsDeprecatedRecord(
       
  1277 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1278                                          TMDBElementId aElementId
       
  1279 #endif //SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1280                                         )
       
  1281 /*
       
  1282 Doesn't matter what version of the data schema is in use.  If a 
       
  1283 record has been deprecated it is never stored in the database
       
  1284 */
       
  1285     {
       
  1286 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1287     switch (aElementId)
       
  1288         {
       
  1289         case KCDTIdIapPrioritySelectionPolicyRecord :
       
  1290             {
       
  1291             return ETrue;
       
  1292             }
       
  1293         }
       
  1294 #endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1295 
       
  1296     return EFalse;
       
  1297     }
       
  1298 
       
  1299 
       
  1300 
       
  1301 
       
  1302 /*****************************************************************************************
       
  1303 * 3/ Functions to check validity of container being used to store or modify data
       
  1304 */
       
  1305 
       
  1306 
       
  1307 
       
  1308 const SRecordTypeInfo* CommsDatSchemaV1_1::GetRecordTypeInfo(TMDBElementId aId)
       
  1309 /*
       
  1310 Retrieve the schema for this table
       
  1311 Will Return NULL if someone looks up a table that doesn'exist
       
  1312 @internalComponent
       
  1313 */
       
  1314     {
       
  1315     const TMDBElementId recordTypeId = aId & KCDMaskShowRecordType;
       
  1316 
       
  1317     const STableLookup* tableInfoPtr = iTableLookup;
       
  1318 
       
  1319     while( tableInfoPtr && tableInfoPtr->iTableId != 0)
       
  1320        {
       
  1321         if (tableInfoPtr->iTableId == recordTypeId)
       
  1322             {
       
  1323             return tableInfoPtr->iFields;
       
  1324             }
       
  1325         
       
  1326         ++tableInfoPtr;
       
  1327         }
       
  1328 
       
  1329 	__FLOG_STATIC1(KLogComponent, KCDErrLog, _L("CommsDatSchema::GetRecordTypeInfo failed to find type info for Element %08x"), aId);
       
  1330 
       
  1331 	// CHECK - Don't leave or panic as client may have meant to search for generic record?
       
  1332 
       
  1333 	ASSERT(0);
       
  1334 
       
  1335 	return NULL;
       
  1336 	}
       
  1337 
       
  1338 
       
  1339 EXPORT_C TInt CommsDatSchemaV1_1::GetFieldTypeInfoL(TMDBElementId aId) 
       
  1340 /*
       
  1341 Return the value type of a field that is known to be in this record
       
  1342 @internalcomponent
       
  1343 */
       
  1344     {
       
  1345     const SRecordTypeInfo* recordInfo = GetRecordTypeInfo(aId);
       
  1346    
       
  1347     if (recordInfo)
       
  1348         {
       
  1349         while( recordInfo->iTypeId != 0)
       
  1350             {
       
  1351             TMDBElementId temp = aId & KCDMaskShowFieldType;
       
  1352             if ((recordInfo->iTypeId & KCDMaskShowFieldType) == temp)//(aId & KCDMaskShowFieldType))
       
  1353                {
       
  1354                return recordInfo->iValType; // return the full val type info here (not just the basic type)
       
  1355                }
       
  1356             ++recordInfo;
       
  1357             }
       
  1358         }
       
  1359           
       
  1360     User::Leave(KErrNotFound);
       
  1361     
       
  1362     return KErrNone; // never get here
       
  1363     }
       
  1364 
       
  1365 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1366 EXPORT_C const STableLookup* CommsDatSchemaV1_1::GetTableInfoL(TMDBElementId aId)
       
  1367 /*
       
  1368 Return a full tableinfo based on a tableId
       
  1369 @internalcomponent
       
  1370 */
       
  1371     {
       
  1372     TInt tableID = aId & KCDMaskShowRecordType;
       
  1373     
       
  1374     for (TInt i = 0; 
       
  1375          ( 0 != CommsDat::CommsDatSchemaV1_1::iTableLookup[i].iTableId );
       
  1376          ++i)
       
  1377         {
       
  1378         if ( tableID == CommsDat::CommsDatSchemaV1_1::iTableLookup[i].iTableId )
       
  1379             {
       
  1380             //OK, got the tableId
       
  1381             return &CommsDat::CommsDatSchemaV1_1::iTableLookup[i];
       
  1382             }
       
  1383         }
       
  1384     
       
  1385     User::Leave(KErrNotFound);
       
  1386     
       
  1387     //this is dummy return statement here - never reached
       
  1388     return NULL;
       
  1389     }
       
  1390 #endif
       
  1391 
       
  1392 TBool CommsDatSchemaV1_1::IsEnabledForcedLinkedTypeResolving(TMDBElementId aId)
       
  1393     {
       
  1394     /**
       
  1395     Forced link resolving is enabled for the:
       
  1396     - AccessPointRecord
       
  1397     - IAPRecord
       
  1398     - ProxiesRecord
       
  1399     - LANServiceRecord
       
  1400     */
       
  1401     return ( KCDTIdAccessPointRecord == aId );
       
  1402     }
       
  1403     
       
  1404     
       
  1405 TMDBElementId CommsDatSchemaV1_1::ForcedFindLinkedIdL(TMDBElementId aTableId, TMDBElementId aLinkingFieldId)
       
  1406     {
       
  1407     const SRecordTypeInfo* recordInfo = GetRecordTypeInfo(aTableId);
       
  1408 
       
  1409     if (recordInfo)
       
  1410     {
       
  1411     while( recordInfo->iTypeId != 0)
       
  1412         {
       
  1413         if (recordInfo->iTypeId == aLinkingFieldId)
       
  1414            {
       
  1415            return recordInfo->iValType;
       
  1416            }
       
  1417         ++recordInfo;
       
  1418         }
       
  1419     }
       
  1420           
       
  1421     User::Leave(KErrNotFound);
       
  1422     
       
  1423     return 0; // never get here
       
  1424     }
       
  1425 
       
  1426 
       
  1427 TMDBElementId CommsDatSchemaV1_1::LookupTableId(TDesC& tableName)
       
  1428     {
       
  1429     const STableLookup* tableInfoPtr = iTableLookup;
       
  1430    
       
  1431     while( tableInfoPtr && tableInfoPtr->iTableId != 0)
       
  1432         {
       
  1433         TPtrC tableNameFromId(tableInfoPtr->iTableName);
       
  1434 
       
  1435         if (tableNameFromId.CompareF(tableName) == 0)
       
  1436             {
       
  1437             return tableInfoPtr->iTableId;
       
  1438             }
       
  1439             
       
  1440         ++tableInfoPtr;
       
  1441         }
       
  1442     
       
  1443     return 0;     
       
  1444     }
       
  1445 
       
  1446 
       
  1447 
       
  1448 //
       
  1449 //  CommsDatSchema Functions
       
  1450 //
       
  1451 
       
  1452 TMDBElementId CommsDatSchema::GetLegacyLinkTableIdL(CMDBSession& aSession, TMDBElementId aLinkingFieldId, CMDBElement* aLinkingRecord)
       
  1453     {
       
  1454     // for some legacy fields validate that the link is correct wrt another field
       
  1455 
       
  1456     CMDBField<TDesC>* tableNameField = NULL;
       
  1457     TInt tmp = (aLinkingFieldId & KCDMaskShowType);
       
  1458     
       
  1459     switch (tmp)
       
  1460         {
       
  1461         case KCDTIdIAPService :
       
  1462             {         
       
  1463             if (aLinkingRecord)
       
  1464                 {
       
  1465                 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>(aLinkingRecord);
       
  1466                 tableNameField = &iapRecord->iServiceType;
       
  1467                 if (! tableNameField->IsNull())
       
  1468                     {
       
  1469                     return CommsDatSchemaV1_1::LookupTableId(tableNameField->GetL());
       
  1470                     }
       
  1471                 }
       
  1472             // create new field if linkingRecord is NULL or has no data in the qualifying field
       
  1473             tableNameField = new (ELeave) CMDBField<TDesC>(KCDTIdIAPServiceType);
       
  1474             break;
       
  1475             }
       
  1476         case KCDTIdIAPBearer :
       
  1477             {
       
  1478             if (aLinkingRecord)
       
  1479                 {
       
  1480                 tableNameField = &(static_cast<CCDIAPRecord&>(*aLinkingRecord)).iBearerType;
       
  1481                 if (! tableNameField->IsNull())
       
  1482                     {
       
  1483                     return CommsDatSchemaV1_1::LookupTableId(tableNameField->GetL());
       
  1484                     }
       
  1485                 }
       
  1486            
       
  1487             // create new field if linkingRecord is NULL or has no data in the qualifying field
       
  1488             tableNameField = new (ELeave) CMDBField<TDesC>(KCDTIdIAPBearerType);
       
  1489             break;
       
  1490             }
       
  1491         case KCDTIdISP :
       
  1492             {
       
  1493             if (aLinkingRecord)
       
  1494                 {
       
  1495                 tableNameField = &(static_cast<CCDProxiesRecord&>(*aLinkingRecord)).iServiceType;
       
  1496                 if (! tableNameField->IsNull())
       
  1497                     {
       
  1498                     return CommsDatSchemaV1_1::LookupTableId(tableNameField->GetL());
       
  1499                     }
       
  1500                 }
       
  1501            
       
  1502             // create new field if linkingRecord is NULL or has no data in the qualifying field
       
  1503             tableNameField = new (ELeave) CMDBField<TDesC>(KCDTIdProxyServiceType);
       
  1504             break;
       
  1505             }
       
  1506         case KCDTIdLANServiceExtensionTableRecordId :
       
  1507             {
       
  1508             if (aLinkingRecord)
       
  1509                 {
       
  1510                 tableNameField = &(static_cast<CCDLANServiceRecord&>(*aLinkingRecord)).iServiceExtensionTableName;
       
  1511                 if (! tableNameField->IsNull())
       
  1512                     {
       
  1513                     return CommsDatSchemaV1_1::LookupTableId(tableNameField->GetL());
       
  1514                     }
       
  1515                 }
       
  1516 
       
  1517             // create new field if linkingRecord is NULL or has no data in the qualifying field            
       
  1518             tableNameField = new (ELeave) CMDBField<TDesC>(KCDTIdLANServiceExtensionTableName);
       
  1519             break;
       
  1520             }
       
  1521 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1522         case KCDTIdSelectionPolicy :
       
  1523             {
       
  1524             return KCDTIdApPrioritySelectionPolicyRecord;
       
  1525             }
       
  1526 #endif //SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
  1527         default :
       
  1528             {
       
  1529             //all other linking records should be identified by full element ids so
       
  1530             __FLOG_STATIC1(KLogComponent, KCDErrLog, 
       
  1531                 _L("CommsDatSchema::GetLegacyLinkTableIdL() - Don't have algorithm to find table id for Field <%08x>"), aLinkingFieldId);
       
  1532 
       
  1533             return 0; // shouldn't be in this function in the first place
       
  1534             }
       
  1535         }
       
  1536 
       
  1537 
       
  1538     CleanupStack::PushL(tableNameField);
       
  1539     
       
  1540     
       
  1541     if (aLinkingFieldId & KCDMaskShowRecordId)
       
  1542     	{ //if the linkingField has a valid reocrdID...
       
  1543     	tableNameField->SetRecordId((aLinkingFieldId & KCDMaskShowRecordId) >> 8);
       
  1544     
       
  1545 	    tableNameField->LoadL(aSession);
       
  1546 	            
       
  1547 	    if ( ! tableNameField->IsNull() )
       
  1548 	        {
       
  1549 	        tmp = CommsDatSchemaV1_1::LookupTableId(tableNameField->GetL());
       
  1550 	        }
       
  1551     	}
       
  1552     else
       
  1553     	{
       
  1554     	/* Notifying the caller code that the resolving of the legacy link field was not successful.
       
  1555     	 * Some other actions need to be taken...
       
  1556     	 */
       
  1557     	
       
  1558     	tmp = 0;
       
  1559     	}
       
  1560     
       
  1561     CleanupStack::PopAndDestroy(tableNameField);
       
  1562     
       
  1563     return tmp;
       
  1564     }
       
  1565 
       
  1566 
       
  1567 TMDBElementId CommsDatSchema::ConstructLinkFromLegacyValueL(CMDBSession& aSession, CMDBElement* aLegacyField, TInt aLegacyValue)
       
  1568     {
       
  1569     TMDBElementId linkedTableId = 0;
       
  1570     TMDBElementId serviceFieldId = 0;
       
  1571     TInt temp = aLegacyField->ElementId() & KCDMaskShowType;
       
  1572         
       
  1573     switch (temp)
       
  1574     {
       
  1575     case KCDTIdIAPService :
       
  1576         {         
       
  1577         serviceFieldId = KCDTIdIAPServiceType;
       
  1578         break;
       
  1579         }
       
  1580     case KCDTIdIAPBearer :
       
  1581         {
       
  1582         serviceFieldId = KCDTIdIAPBearerType;
       
  1583         break;
       
  1584         }
       
  1585     case KCDTIdISP :
       
  1586         {
       
  1587         serviceFieldId = KCDTIdProxyServiceType;
       
  1588         break;
       
  1589         }
       
  1590     case KCDTIdLANServiceExtensionTableRecordId :
       
  1591         {
       
  1592         serviceFieldId = KCDTIdLANServiceExtensionTableName;
       
  1593         break;
       
  1594         }
       
  1595     default :
       
  1596         {
       
  1597         //all other linking records should be identified by full element ids so
       
  1598         __FLOG_STATIC1(KLogComponent, KCDErrLog, 
       
  1599             _L("CommsDatSchema::GetLegacyLinkTableIdL() - Don't have algorithm to find table id for Field <%08x>"), aLegacyField);
       
  1600 
       
  1601         return 0; // shouldn't be in this function in the first place
       
  1602         }
       
  1603     }
       
  1604     
       
  1605     //create an empty filed for loading the serviceType field for the given service...
       
  1606     CMDBField<TDesC>* serviceField = new(ELeave) CMDBField<TDesC>(serviceFieldId);
       
  1607     CleanupStack::PushL(serviceField);
       
  1608     
       
  1609     serviceField->SetRecordId(aLegacyValue);
       
  1610     
       
  1611     serviceField->LoadL(aSession);
       
  1612     
       
  1613     linkedTableId = CommsDatSchemaV1_1::LookupTableId(serviceField->GetL());
       
  1614     
       
  1615     if (linkedTableId !=0)
       
  1616         {
       
  1617         linkedTableId |= (aLegacyValue << 8);
       
  1618         }
       
  1619     
       
  1620     CleanupStack::PopAndDestroy(serviceField);
       
  1621     
       
  1622     return linkedTableId;
       
  1623     }
       
  1624         
       
  1625 
       
  1626 
       
  1627 TMDBElementId CommsDatSchema::IdTagResolverL(CMDBSession& aSession, TMDBElementId aLinkedTypeId, TMDBElementId aTargetValue)
       
  1628     {
       
  1629     TMDBElementId linkedElementId = 0;
       
  1630     
       
  1631     CMDBField<TUint32>* tagField = new (ELeave) CMDBField<TUint32>(aLinkedTypeId | KCDTIdRecordTag);
       
  1632     CleanupStack::PushL(tagField);
       
  1633 
       
  1634     *tagField = (aTargetValue & ~KLinkableTag);
       
  1635 
       
  1636     if (tagField->FindL(aSession))
       
  1637         {
       
  1638         linkedElementId = (tagField->ElementId() & KCDMaskShowRecordTypeAndId);
       
  1639         }
       
  1640     else
       
  1641         {        
       
  1642         User::Leave(KErrArgument);
       
  1643         }
       
  1644     
       
  1645     CleanupStack::PopAndDestroy(tagField);
       
  1646     
       
  1647     return linkedElementId;
       
  1648     }
       
  1649 
       
  1650 TMDBElementId CommsDatSchema::GetLinkIdL(CMDBSession& aSession, TMDBElementId aLinkingFieldId, TMDBElementId aLinkingFieldValue, TMDBElementId aLinkedTableId, CMDBElement* aLinkingRecord)
       
  1651 /**
       
  1652     Get or calculate the id of the linked record if enough information is available
       
  1653 
       
  1654     @param  aSession the session to use if need to lookup in the database
       
  1655     @param  The id of the table that is linked to.  This can be NULL, but must be given
       
  1656             if the link type is a base class and link field value does not specify the table being linked to.
       
  1657 
       
  1658     @leave  KErrArgument if aKnownLinkType does not match current field value
       
  1659     @leave  System wide error codes if database action fails unexpectedly for some reason.
       
  1660 
       
  1661     @pre    The linking field value must be set correctly for this operation to succeed.
       
  1662             
       
  1663     @post   The value of this field may be updated to reflect the correct location of the linked record in the database
       
  1664             The caller will have enough information to create the linked record if they need to
       
  1665                 
       
  1666 	@internal component
       
  1667     @prototype
       
  1668 */
       
  1669     {
       
  1670     __FLOG_STATIC2(KLogComponent, KCDInfoLog, 
       
  1671        	                        _L("CommsDatSchema::GetLinkIdL() - aLinkingFieldId: <%08x>, aLinkingFieldValue: <%08x>."), aLinkingFieldId, aLinkingFieldValue);
       
  1672     
       
  1673     TMDBElementId linkedElementId(0);
       
  1674     TMDBElementId linkedTypeId(aLinkedTableId & KCDMaskShowRecordType);
       
  1675     TMDBElementId targetValue(aLinkingFieldValue);
       
  1676 
       
  1677 
       
  1678     if ( (linkedTypeId & KCDMaskShowRecordType) == 0 )
       
  1679         {
       
  1680         if ( (targetValue & KLinkableTag) != 0          ||   // Linkable tag is set
       
  1681              (targetValue & KCDMaskShowRecordType) == 0   )  // target value does not contain table type info
       
  1682             {
       
  1683             // lookup the record type in the value of this field
       
  1684             linkedTypeId = CommsDatSchemaV1_1::GetFieldTypeInfoL(aLinkingFieldId) & KCDMaskShowRecordType;
       
  1685         
       
  1686             if ((linkedTypeId & KCDMaskShowRecordType) == 0)
       
  1687                 {
       
  1688                 // This is the 3rd stage of the legacy link resolver - the BRUTE FORCE...
       
  1689                linkedTypeId = ForcedLegacyLinkFindL(aSession, aLinkingFieldId, aLinkingFieldValue, aLinkingRecord);
       
  1690 
       
  1691                if ((linkedTypeId & KCDMaskShowRecordType) == 0)
       
  1692             	   {
       
  1693                   	// Can't establish the table id for this link. Link is not valid
       
  1694                    __FLOG_STATIC2(KLogComponent, KCDErrLog, 
       
  1695                 		   _L("CommsDatSchema::GetLinkIdL() - Can't identify the table linked to by field <%08x>, value <%08x>.  Link not usable"), aLinkingFieldId, targetValue);
       
  1696 
       
  1697                    User::Leave(KErrArgument);
       
  1698                  	}
       
  1699                 }
       
  1700             }
       
  1701         else 
       
  1702             {
       
  1703             linkedTypeId = (targetValue & KCDMaskShowRecordType);
       
  1704             }
       
  1705         }
       
  1706     
       
  1707     // At this point the target table is known
       
  1708 
       
  1709     if (KLinkableTag & targetValue)
       
  1710         {
       
  1711         // this is a link by tag so need to do a find for the iTag field in the linked table
       
  1712         
       
  1713         linkedElementId = IdTagResolverL(aSession, linkedTypeId, targetValue);
       
  1714         
       
  1715         }
       
  1716     else if (targetValue <= KCDMaxRecords)
       
  1717         {
       
  1718         // targetValue is just a simple record ID not in elementId form
       
  1719         //the record id is greater than 0. It's still not sure that the link is correct...
       
  1720         linkedElementId = linkedTypeId | (targetValue << 8); 
       
  1721         }
       
  1722    	else 
       
  1723         {
       
  1724         // targetValue should be an element id
       
  1725         if ( (targetValue & KCDMaskShowRecordType) == (linkedTypeId & KCDMaskShowRecordType) ||
       
  1726              (linkedTypeId & KCDMaskShowRecordType) == 0 )
       
  1727             {   
       
  1728             //tableid and recordid both set explicitly in targetValue;
       
  1729             linkedElementId = targetValue & KCDMaskShowRecordTypeAndId;
       
  1730             }
       
  1731         else if( (targetValue & KCDMaskShowRecordType) == 0 )
       
  1732             {
       
  1733             // hmmm quite unusual. linkValue does not specify a table but looks like 
       
  1734             // an element id.  So just add in the table id from aTargetTableId 
       
  1735             linkedElementId = (linkedTypeId | (targetValue & KCDMaskShowRecordId));
       
  1736             }
       
  1737         else
       
  1738             {
       
  1739             __FLOG_STATIC3(KLogComponent, KCDErrLog, 
       
  1740                 _L("TMDBRecordLinkVisitor GetLinkIdL() - value <%08x> given in link field <%08x> and type of link <%08x> do not match. Link not usable"), (targetValue & KCDMaskShowRecordType), aLinkingFieldId & KCDMaskHideAttrAndRes, linkedTypeId);
       
  1741             
       
  1742             User::Leave(KErrArgument);
       
  1743             }      
       
  1744         }
       
  1745 
       
  1746     __FLOG_STATIC3(KLogComponent, KCDInfoLog, 
       
  1747     _L("TMDBRecordLinkVisitor GetLinkIdL() - resolved link field <%08x> with value <%08x> to link value <%08x>"), aLinkingFieldId & KCDMaskHideAttrAndRes, aLinkingFieldValue, linkedElementId);
       
  1748  
       
  1749     return linkedElementId;
       
  1750     }
       
  1751 
       
  1752 //We are here because the client entered a number (possibly record id) for a linked field. CommsDat has to resolve
       
  1753 //in this case the linked elementId.
       
  1754 TMDBElementId CommsDatSchema::ForcedLegacyLinkFindL(CMDBSession& aSession, TMDBElementId aLinkingFieldId, TMDBElementId aLinkingFieldValue, CMDBElement* aElement)
       
  1755 	{
       
  1756 	TMDBElementId tableId = aLinkingFieldId & KCDMaskShowRecordType;
       
  1757 	TMDBElementId linkedId = 0;
       
  1758 	switch (tableId)
       
  1759 		{
       
  1760 		case KCDTIdIAPRecord:
       
  1761 			{
       
  1762 			linkedId = ForcedIAPFindL(aSession, aLinkingFieldId, aLinkingFieldValue, aElement);
       
  1763 			__FLOG_STATIC0(KLogComponent, KCDInfoLog, 
       
  1764 			   	                        _L("CommsDatSchema::ForcedLegacyLinkFindL() - IAP"));
       
  1765 			break;
       
  1766 			}
       
  1767 		case KCDTIdProxiesRecord:
       
  1768 			{
       
  1769 			linkedId = ForcedProxiesFindL(aSession, aLinkingFieldId, aLinkingFieldValue, aElement);
       
  1770 			__FLOG_STATIC0(KLogComponent, KCDInfoLog, 
       
  1771 			   	                        _L("CommsDatSchema::ForcedLegacyLinkFindL() - Proxies"));
       
  1772 			break;
       
  1773 			}
       
  1774 		case KCDTIdLANServiceRecord:
       
  1775 			{
       
  1776 			linkedId = ForcedLanServiceFindL(aSession, aLinkingFieldId, aLinkingFieldValue, aElement);
       
  1777 			__FLOG_STATIC0(KLogComponent, KCDInfoLog, 
       
  1778 			   	                        _L("CommsDatSchema::ForcedLegacyLinkFindL() - LanService"));
       
  1779 			break;
       
  1780 			}
       
  1781 		default:
       
  1782 			__FLOG_STATIC2(KLogComponent, KCDErrLog, 
       
  1783 			                        _L("CommsDatSchema::ForcedLegacyLinkFindL() - Can't identify the table linked to by field <%08x>, value <%08x>.  Link not usable"), aLinkingFieldId, aLinkingFieldValue);
       
  1784 
       
  1785 			User::Leave(KErrArgument);
       
  1786 			break;
       
  1787 		}
       
  1788 	return linkedId;
       
  1789 	}
       
  1790 
       
  1791 TMDBElementId CommsDatSchema::ForcedLanServiceFindL(CMDBSession& aSession, TMDBElementId aLinkingFieldId, TMDBElementId aLinkingFieldValue, CMDBElement* aElement)
       
  1792 	{
       
  1793 
       
  1794 	/*CMDBField<TDesC>* serviceExtension = NULL;
       
  1795 	TMDBElementId linkedTableId = 0;*/
       
  1796 	
       
  1797 	TBuf<50> serviceExtension;
       
  1798 	TMDBElementId linkedTableId = 0;
       
  1799 	TBool isRecord = EFalse;
       
  1800 	
       
  1801 	if ((NULL!=aElement) && (CommsDat::CommsDatSchema::IsRecord(aElement->ElementId())))
       
  1802 		{
       
  1803 		isRecord = ETrue;
       
  1804 		}
       
  1805 	
       
  1806 	if (0 != (aLinkingFieldId & KCDMaskShowRecordId))
       
  1807 		{
       
  1808 		//there is a record id set on the container. Let's try to resolve the link from this
       
  1809 		CCDLANServiceRecord* lanServiceRec = static_cast<CCDLANServiceRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdLANServiceRecord));
       
  1810 		CleanupStack::PushL(lanServiceRec);
       
  1811 		lanServiceRec->SetRecordId((aLinkingFieldId & KCDMaskShowRecordId) >> 8);
       
  1812 		lanServiceRec->LoadL(aSession);
       
  1813 		
       
  1814 		serviceExtension = lanServiceRec->iServiceExtensionTableName.GetL();
       
  1815 		
       
  1816 		linkedTableId = CommsDatSchemaV1_1::LookupTableId(serviceExtension);
       
  1817 		CleanupStack::PopAndDestroy(lanServiceRec);
       
  1818 		}
       
  1819 	else if (isRecord)
       
  1820 		{
       
  1821 		RArray<TUint32> ids;
       
  1822 		
       
  1823 		CleanupClosePushL(ids);
       
  1824 			    
       
  1825         TUint32 mask = KCDMaskShowRecordType | KCDMaskShowFieldType | aSession.iMDBSessionImpl->GetReadAttributeMask() | KCDUtilityFlag;
       
  1826         TUint32 id = aElement->ElementId() & KCDMaskHideAttrAndRes;
       
  1827         
       
  1828         aSession.iMDBSessionImpl->StorageL()->FindL(id, mask, ids);
       
  1829 		
       
  1830 		TBool found = EFalse;
       
  1831 		TInt i = 0;
       
  1832 		TUint fieldValue = 0;
       
  1833 		
       
  1834 		CCDLANServiceRecord* lanServiceRec = NULL;
       
  1835 		lanServiceRec = static_cast<CCDLANServiceRecord*>(aElement);
       
  1836 		
       
  1837 		TInt fieldExists = KErrNotFound;
       
  1838 		
       
  1839 		while (!found && i<ids.Count())	
       
  1840 			{
       
  1841 			fieldValue = 0;
       
  1842 			
       
  1843 			if ( (IsRecord(ids[i])) && (KCDTIdLANServiceRecord == (ids[i] & KCDMaskShowRecordType)) )
       
  1844 				{
       
  1845 				//check whether the lanserviceext field is filled/changed...
       
  1846 				if (KCDChangedFlag == (lanServiceRec->iServiceExtensionTableName.ElementId() & KCDChangedFlag))
       
  1847 					{
       
  1848 					//the given field has changed, let's check it
       
  1849 					TInt cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdLANServiceExtensionTableName) | (ids[i] & KCDMaskShowRecordId);
       
  1850 					CMDBField<TDesC>* lanServiceExtName = new(ELeave) CMDBField<TDesC>(cleanID);
       
  1851 					CleanupStack::PushL(lanServiceExtName);
       
  1852 					//This field is not mandatory so it's possible that the given record doesn't contain it...
       
  1853 					TRAP(fieldExists, lanServiceExtName->LoadL(aSession));
       
  1854 					if (KErrNone == fieldExists)
       
  1855 						{
       
  1856 					    TPtrC serviceTypeFromCurrRec(*lanServiceExtName);
       
  1857 					    TPtrC serviceTypeFromOrigRec(lanServiceRec->iServiceExtensionTableName);
       
  1858 					    if (serviceTypeFromCurrRec == serviceTypeFromOrigRec)
       
  1859 					        {
       
  1860 					        //ok, found the primed record
       
  1861 							cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdLANServiceExtensionTableRecordId) | (ids[i] & KCDMaskShowRecordId);
       
  1862 							CMDBRecordLink<CCDServiceRecordBase>* lanServiceExtRecId = new(ELeave) CMDBRecordLink<CCDServiceRecordBase>(cleanID);
       
  1863 							CleanupStack::PushL(lanServiceExtRecId);
       
  1864 							
       
  1865 							TRAP(fieldExists, lanServiceExtRecId->LoadL(aSession));
       
  1866 							if (KErrNone == fieldExists)
       
  1867 								{
       
  1868 								fieldValue = *lanServiceExtRecId;
       
  1869 								serviceExtension = (*lanServiceExtName);
       
  1870 								}
       
  1871 							
       
  1872 							CleanupStack::PopAndDestroy(lanServiceExtRecId);
       
  1873 					        }
       
  1874 						}
       
  1875 						CleanupStack::PopAndDestroy(lanServiceExtName);
       
  1876 					}
       
  1877 				else
       
  1878 					{
       
  1879 					TInt cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdLANServiceExtensionTableRecordId) | (ids[i] & KCDMaskShowRecordId);
       
  1880 					CMDBRecordLink<CCDServiceRecordBase>* lanServiceExtRecId = new(ELeave) CMDBRecordLink<CCDServiceRecordBase>(cleanID);
       
  1881 					CleanupStack::PushL(lanServiceExtRecId);
       
  1882 					
       
  1883 					TRAPD(fieldExists, lanServiceExtRecId->LoadL(aSession));
       
  1884 					if (KErrNone == fieldExists)
       
  1885 						{
       
  1886 						cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdLANServiceExtensionTableName) | (ids[i] & KCDMaskShowRecordId);
       
  1887 						CMDBField<TDesC>* lanServiceExtName = new(ELeave) CMDBField<TDesC>(cleanID);
       
  1888 						CleanupStack::PushL(lanServiceExtName);
       
  1889 						
       
  1890 						TRAP(fieldExists, lanServiceExtName->LoadL(aSession));
       
  1891 						if (KErrNone == fieldExists)
       
  1892 							{
       
  1893 							fieldValue = *lanServiceExtRecId;
       
  1894 							serviceExtension = (*lanServiceExtName);
       
  1895 							}
       
  1896 						
       
  1897 						CleanupStack::PopAndDestroy(lanServiceExtName);
       
  1898 						}
       
  1899 					
       
  1900 					CleanupStack::PopAndDestroy(lanServiceExtRecId);
       
  1901 					}
       
  1902 				
       
  1903 				//Note: the legacy link values are already in the expected decimal recordID format. So no need to shift
       
  1904 				//the value to left...
       
  1905 				if ( fieldValue == aLinkingFieldValue )
       
  1906 					{
       
  1907 				    linkedTableId = CommsDatSchemaV1_1::LookupTableId(serviceExtension);
       
  1908 					found = true;
       
  1909 					}
       
  1910 				++i;
       
  1911 				}
       
  1912 			}
       
  1913 		
       
  1914 		CleanupStack::PopAndDestroy(&ids);
       
  1915 		}
       
  1916 	
       
  1917 	__FLOG_STATIC1(KLogComponent, KCDInfoLog, 
       
  1918 	   	                        _L("CommsDatSchema::ForcedLanServiceFindL() - linkedTableId: <%08x>."), linkedTableId);
       
  1919 	
       
  1920 	return linkedTableId;
       
  1921 	}
       
  1922 
       
  1923 TMDBElementId CommsDatSchema::ForcedProxiesFindL(CMDBSession& aSession, TMDBElementId aLinkingFieldId, TMDBElementId aLinkingFieldValue, CMDBElement* aElement)
       
  1924 	{
       
  1925 	TBuf<50> serviceType;
       
  1926 	TMDBElementId linkedTableId = 0;
       
  1927 	TBool isRecord = EFalse;
       
  1928 	
       
  1929 	if ((NULL!=aElement) && (CommsDat::CommsDatSchema::IsRecord(aElement->ElementId())))
       
  1930 		{
       
  1931 		isRecord = ETrue;
       
  1932 		}
       
  1933 	
       
  1934 	if (0 != (aLinkingFieldId & KCDMaskShowRecordId))
       
  1935 		{
       
  1936 		//there is a record id set on the container. Let's true to resolve the link from this
       
  1937 		CCDProxiesRecord* proxiesRec = static_cast<CCDProxiesRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdProxiesRecord));
       
  1938 		CleanupStack::PushL(proxiesRec);
       
  1939 		proxiesRec->SetRecordId((aLinkingFieldId & KCDMaskShowRecordId) >> 8);
       
  1940 		proxiesRec->LoadL(aSession);
       
  1941 		
       
  1942 		serviceType = proxiesRec->iServiceType.GetL();
       
  1943 		
       
  1944 		linkedTableId = CommsDatSchemaV1_1::LookupTableId(serviceType);
       
  1945 		CleanupStack::PopAndDestroy(proxiesRec);		
       
  1946 		}
       
  1947 	else if (isRecord)
       
  1948 		{
       
  1949 		RArray<TUint32> ids;
       
  1950 		
       
  1951 		CleanupClosePushL(ids);
       
  1952 			    
       
  1953         TUint32 mask = KCDMaskShowRecordType | KCDMaskShowFieldType | aSession.iMDBSessionImpl->GetReadAttributeMask() | KCDUtilityFlag;
       
  1954         TUint32 id = aElement->ElementId() & KCDMaskHideAttrAndRes;
       
  1955         
       
  1956         aSession.iMDBSessionImpl->StorageL()->FindL(id, mask, ids);
       
  1957 		
       
  1958 		TBool found = EFalse;
       
  1959 		TInt i = 0;
       
  1960 		TUint fieldValue = 0;
       
  1961 		
       
  1962 		CCDProxiesRecord* proxiesRec = NULL;
       
  1963 		proxiesRec = static_cast<CCDProxiesRecord*>(aElement);
       
  1964 		
       
  1965 		while (!found && i<ids.Count())	
       
  1966 			{
       
  1967 			fieldValue = 0;
       
  1968 			
       
  1969 			if ( (IsRecord(ids[i])) && (KCDTIdProxiesRecord == (ids[i] & KCDMaskShowRecordType)) )
       
  1970 				{
       
  1971 				//check whether the proxyServiceType field is filled/changed...
       
  1972 				if (KCDChangedFlag == (proxiesRec->iServiceType.ElementId() & KCDChangedFlag))
       
  1973 					{
       
  1974 					//the given field has changed, let's check it
       
  1975 					TInt cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdProxyServiceType) | (ids[i] & KCDMaskShowRecordId);
       
  1976 					CMDBField<TDesC>* proxyServiceType = new(ELeave) CMDBField<TDesC>(cleanID);
       
  1977 					CleanupStack::PushL(proxyServiceType);
       
  1978 					proxyServiceType->LoadL(aSession);
       
  1979 					
       
  1980 				    TPtrC serviceTypeFromCurrRec(*proxyServiceType);
       
  1981 				    TPtrC serviceTypeFromOrigRec(proxiesRec->iServiceType);
       
  1982 				    if (serviceTypeFromCurrRec == serviceTypeFromOrigRec)
       
  1983 				        {
       
  1984 				        //ok, found the primed record
       
  1985 						cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdISP) | (ids[i] & KCDMaskShowRecordId);
       
  1986 						CMDBRecordLink<CCDServiceRecordBase>* proxyISP = new(ELeave) CMDBRecordLink<CCDServiceRecordBase>(cleanID);
       
  1987 						CleanupStack::PushL(proxyISP);
       
  1988 						proxyISP->LoadL(aSession);
       
  1989 						
       
  1990 						fieldValue = *proxyISP;
       
  1991 						serviceType = (*proxyServiceType);
       
  1992 						
       
  1993 						CleanupStack::PopAndDestroy(proxyISP);
       
  1994 				        }
       
  1995 				    
       
  1996 				    CleanupStack::PopAndDestroy(proxyServiceType);
       
  1997 					}
       
  1998 				else
       
  1999 					{
       
  2000 					//the IAPService/BearerType field is not filled which means that were searcing for the 1st IAP
       
  2001 					//record with the given service/bearer value.
       
  2002 					TInt cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdISP) | (ids[i] & KCDMaskShowRecordId);
       
  2003 					CMDBRecordLink<CCDServiceRecordBase>* proxyISP = new(ELeave) CMDBRecordLink<CCDServiceRecordBase>(cleanID);
       
  2004 					CleanupStack::PushL(proxyISP);
       
  2005 					
       
  2006 					cleanID = ((ids[i] & KCDMaskShowRecordType) | KCDTIdProxyServiceType) | (ids[i] & KCDMaskShowRecordId);
       
  2007 					CMDBField<TDesC>* proxyServiceType = new(ELeave) CMDBField<TDesC>(cleanID);
       
  2008 					CleanupStack::PushL(proxyServiceType);
       
  2009 					
       
  2010 					proxyServiceType->LoadL(aSession);
       
  2011 					
       
  2012 					proxyISP->LoadL(aSession);
       
  2013 					
       
  2014 					fieldValue = *proxyISP;
       
  2015 					
       
  2016 					serviceType = (*proxyServiceType);
       
  2017 					
       
  2018 					CleanupStack::PopAndDestroy(proxyServiceType);
       
  2019 					
       
  2020 					CleanupStack::PopAndDestroy(proxyISP);
       
  2021 					}
       
  2022 				}
       
  2023 
       
  2024 				//Note: the legacy link values are already in the expected decimal recordID format. So no need to shift
       
  2025 				//the value to left...
       
  2026 				if ( fieldValue == aLinkingFieldValue )
       
  2027 					{
       
  2028 				    linkedTableId = CommsDatSchemaV1_1::LookupTableId(serviceType);
       
  2029 					found = true;
       
  2030 					}
       
  2031 			++i;
       
  2032 			}
       
  2033 		
       
  2034 		CleanupStack::PopAndDestroy(&ids);
       
  2035 		}
       
  2036 	
       
  2037 	__FLOG_STATIC1(KLogComponent, KCDInfoLog, 
       
  2038 	   	                        _L("CommsDatSchema::ForcedProxiesFindL() - linkedTableId: <%08x>."), linkedTableId);
       
  2039 	
       
  2040 	return linkedTableId;
       
  2041 	}
       
  2042 
       
  2043 TMDBElementId CommsDatSchema::ForcedIAPFindL(CMDBSession& aSession, TMDBElementId aLinkingFieldId, TMDBElementId aLinkingFieldValue, CMDBElement* aElement)
       
  2044 	{
       
  2045 	//According to the schema definition the IAP service/bearer type cannot be longer than 50 character
       
  2046 	TBuf<50> serviceOrBearerType;
       
  2047 	TMDBElementId linkedTableId = 0;
       
  2048 	TMDBElementId tempField = 0;
       
  2049 	TBool isRecord = EFalse;
       
  2050 	
       
  2051 	if ((NULL!=aElement) && (CommsDat::CommsDatSchema::IsRecord(aElement->ElementId())))
       
  2052 		{
       
  2053 		isRecord = ETrue;
       
  2054 		}
       
  2055 	
       
  2056 	if (0 != (aLinkingFieldId & KCDMaskShowRecordId))
       
  2057 		{
       
  2058 		//there is a record id set on the container. Let's try to resolve the link from this
       
  2059 		CCDIAPRecord* iapRec = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
  2060 		CleanupStack::PushL(iapRec);
       
  2061 		iapRec->SetRecordId((aLinkingFieldId & KCDMaskShowRecordId) >> 8);
       
  2062 		iapRec->LoadL(aSession);
       
  2063 		
       
  2064 		tempField = aLinkingFieldId & (KCDMaskShowRecordType | KCDMaskShowFieldType);
       
  2065 			
       
  2066 		if (KCDTIdIAPService == tempField)
       
  2067 			{ //searcing for the service...
       
  2068 			//serviceOrBearerType.Set(iapRec->iServiceType.GetL()); 
       
  2069 			serviceOrBearerType = (iapRec->iServiceType.GetL());
       
  2070 			}
       
  2071 		else
       
  2072 			{ //searching for the bearer...
       
  2073 			serviceOrBearerType = (iapRec->iBearerType.GetL());
       
  2074 			}
       
  2075 		
       
  2076 		linkedTableId = CommsDatSchemaV1_1::LookupTableId(serviceOrBearerType);
       
  2077 		
       
  2078 		CleanupStack::PopAndDestroy(iapRec);
       
  2079 		}
       
  2080 	else if (isRecord)
       
  2081 		{
       
  2082 		RArray<TUint32> ids;
       
  2083 		CleanupClosePushL(ids);
       
  2084 			    
       
  2085         TUint32 mask = KCDMaskShowRecordType | KCDMaskShowFieldType | aSession.iMDBSessionImpl->GetReadAttributeMask() | KCDUtilityFlag;
       
  2086         TUint32 id = aElement->ElementId() & KCDMaskHideAttrAndRes;
       
  2087         
       
  2088         aSession.iMDBSessionImpl->StorageL()->FindL(id, mask, ids);
       
  2089 		
       
  2090 		TBool found = EFalse;
       
  2091 		TInt i = 0;
       
  2092 		TUint fieldValue = 0;
       
  2093 		
       
  2094 		CCDIAPRecord* iapRec = NULL;
       
  2095 		iapRec = static_cast<CCDIAPRecord*>(aElement);
       
  2096 		
       
  2097 		tempField = aLinkingFieldId & (KCDMaskShowRecordType | KCDMaskShowFieldType);
       
  2098 		
       
  2099 		TInt iapServiceOrBearerTypeId = 0;
       
  2100 		TInt iapServiceOrBearerId = 0;
       
  2101 		TInt origIapServiceOrBearerType = 0;
       
  2102 		TBuf<50> serviceOrbearerTypeFromOrigRec(iapRec->iServiceType);
       
  2103 		
       
  2104 		if (KCDTIdIAPService == tempField)
       
  2105 			{ //searcing for the service...
       
  2106 			iapServiceOrBearerTypeId = KCDTIdIAPServiceType;
       
  2107 			iapServiceOrBearerId = KCDTIdIAPService;
       
  2108 			origIapServiceOrBearerType = iapRec->iServiceType.ElementId();
       
  2109 			serviceOrbearerTypeFromOrigRec = iapRec->iServiceType;
       
  2110 			}
       
  2111 		else
       
  2112 			{ //searching for the bearer...
       
  2113 			iapServiceOrBearerTypeId = KCDTIdIAPBearerType;
       
  2114 			iapServiceOrBearerId = KCDTIdIAPBearer;
       
  2115 			origIapServiceOrBearerType = iapRec->iBearerType.ElementId();
       
  2116 			serviceOrbearerTypeFromOrigRec = iapRec->iBearerType;
       
  2117 			}
       
  2118 		
       
  2119 		while (!found && i<ids.Count())	
       
  2120 			{
       
  2121 			fieldValue = 0;
       
  2122 			
       
  2123 			if ( (IsRecord(ids[i])) && (KCDTIdIAPRecord == (ids[i] & KCDMaskShowRecordType)) )
       
  2124 				{
       
  2125 				//check whether the IAPService/BearerType field is filled/changed...
       
  2126 				if (KCDChangedFlag == (origIapServiceOrBearerType & KCDChangedFlag))
       
  2127 					{
       
  2128 					//the given field has changed, let's check it
       
  2129 					TInt cleanID = ((ids[i] & KCDMaskShowRecordType) | iapServiceOrBearerTypeId) | (ids[i] & KCDMaskShowRecordId);
       
  2130 					CMDBField<TDesC>* serviceOrbearerType = new(ELeave) CMDBField<TDesC>(cleanID);
       
  2131 					CleanupStack::PushL(serviceOrbearerType);
       
  2132 					serviceOrbearerType->LoadL(aSession);
       
  2133 					
       
  2134 				    TPtrC serviceTypeFromCurrRec(*serviceOrbearerType);
       
  2135 				    //TPtrC serviceTypeFromOrigRec(iapRec->iServiceType);
       
  2136 				    //if (serviceTypeFromCurrRec == serviceTypeFromOrigRec)
       
  2137 				    if (serviceTypeFromCurrRec == serviceOrbearerTypeFromOrigRec)
       
  2138 				        {
       
  2139 				        //ok, found the primed record
       
  2140 						cleanID = ((ids[i] & KCDMaskShowRecordType) | iapServiceOrBearerId) | (ids[i] & KCDMaskShowRecordId);
       
  2141 						CMDBRecordLink<CCDServiceRecordBase>* serviceOrbearer = new(ELeave) CMDBRecordLink<CCDServiceRecordBase>(cleanID);
       
  2142 						CleanupStack::PushL(serviceOrbearer);
       
  2143 						serviceOrbearer->LoadL(aSession);
       
  2144 						
       
  2145 						fieldValue = *serviceOrbearer;
       
  2146 						serviceOrBearerType = (*serviceOrbearerType);
       
  2147 						
       
  2148 						CleanupStack::PopAndDestroy(serviceOrbearer);
       
  2149 				        }
       
  2150 				    
       
  2151 				    CleanupStack::PopAndDestroy(serviceOrbearerType);
       
  2152 					}
       
  2153 				else
       
  2154 					{
       
  2155 					//the IAPService/BearerType field is not filled which means that were searcing for the 1st IAP
       
  2156 					//record with the given service/bearer value.
       
  2157 					TInt cleanID = ((ids[i] & KCDMaskShowRecordType) | iapServiceOrBearerId) | (ids[i] & KCDMaskShowRecordId);
       
  2158 					CMDBRecordLink<CCDServiceRecordBase>* serviceOrbearer = new(ELeave) CMDBRecordLink<CCDServiceRecordBase>(cleanID);
       
  2159 					CleanupStack::PushL(serviceOrbearer);
       
  2160 					
       
  2161 					cleanID = ((ids[i] & KCDMaskShowRecordType) | iapServiceOrBearerTypeId) | (ids[i] & KCDMaskShowRecordId);
       
  2162 					CMDBField<TDesC>* serviceOrbearerType = new(ELeave) CMDBField<TDesC>(cleanID);
       
  2163 					CleanupStack::PushL(serviceOrbearerType);
       
  2164 					
       
  2165 					serviceOrbearerType->LoadL(aSession);
       
  2166 					
       
  2167 					serviceOrbearer->LoadL(aSession);
       
  2168 					
       
  2169 					fieldValue = *serviceOrbearer;
       
  2170 					
       
  2171 					serviceOrBearerType = (*serviceOrbearerType);
       
  2172 					
       
  2173 					CleanupStack::PopAndDestroy(serviceOrbearerType);
       
  2174 					
       
  2175 					CleanupStack::PopAndDestroy(serviceOrbearer);
       
  2176 					}
       
  2177 					}
       
  2178 
       
  2179 				//Note: the legacy link values are already in the expected decimal recordID format. So no need to shift
       
  2180 				//the value to left...
       
  2181 				if ( fieldValue == aLinkingFieldValue )
       
  2182 					{
       
  2183 				    linkedTableId = CommsDatSchemaV1_1::LookupTableId(serviceOrBearerType);
       
  2184 					found = true;
       
  2185 					}
       
  2186 			++i;
       
  2187 			}
       
  2188 		
       
  2189 		CleanupStack::PopAndDestroy(&ids);
       
  2190 		}
       
  2191 	
       
  2192 	__FLOG_STATIC1(KLogComponent, KCDInfoLog, 
       
  2193 	   	                        _L("CommsDatSchema::ForcedIAPFindL() - linkedTableId: <%08x>."), linkedTableId);
       
  2194 	
       
  2195 	return linkedTableId;
       
  2196 	}
       
  2197 
       
  2198 void CommsDatSchema::ChangeLegacyLinkFieldValues(CMDBElement*& aLegacyField)
       
  2199  	{
       
  2200  	//only do the check if there is a legacy table...
       
  2201      if( ( (aLegacyField->ElementId() & KCDMaskShowRecordType ) < KCDTIdAccessPointRecord    &&
       
  2202            (aLegacyField->ElementId() & KCDMaskShowRecordType ) != KCDTIdWLANServiceExtRecord  ) )
       
  2203      	{
       
  2204      	//this is why we accept only fields in this function...
       
  2205  		//CMDBNumFieldBase* field = static_cast<CMDBNumFieldBase*>(aLegacyField);
       
  2206  		
       
  2207  		CMDBField<TInt>* field = static_cast<CMDBField<TInt>* >(aLegacyField);
       
  2208  		
       
  2209  		TMDBElementId tableId = field->ElementId() & KCDMaskShowRecordType;
       
  2210  		
       
  2211  	    const STableLookup* tableInfoPtr = CommsDatSchemaV1_1::iTableLookup;
       
  2212  	    TInt i = 0;
       
  2213  	    
       
  2214  	    while( tableInfoPtr && tableInfoPtr->iTableId != 0 && (tableInfoPtr->iTableId) != tableId )
       
  2215  	        {
       
  2216  	        ++i;        
       
  2217  	        ++tableInfoPtr;
       
  2218  	        }
       
  2219  	        
       
  2220  	    /* At this point we know that what is the table of the field.
       
  2221  	       Now we should search for the field in the table and get the position of it.
       
  2222  	       it is important because as the mapping here is 1:1 this position will be the 
       
  2223  	       position of the mapped field either.
       
  2224  	       */
       
  2225  	    const CommsDat::SRecordTypeInfo* fieldInfoPtr = CommsDatSchemaV1_1::iTableLookup[i].iFields;
       
  2226  	    TMDBElementId fieldId = field->ElementId() & KCDMaskShowType;
       
  2227  	    TInt fieldPosition = 0;
       
  2228  	    
       
  2229  	    //Skip the tagId and the name fields...
       
  2230  	    ++fieldInfoPtr;
       
  2231  	    ++fieldInfoPtr;
       
  2232  	    
       
  2233  	    while( fieldInfoPtr && fieldInfoPtr->iTypeId != 0 && (fieldInfoPtr->iTypeId) != fieldId)
       
  2234  		    {
       
  2235  		    ++fieldPosition;        
       
  2236  		    ++fieldInfoPtr;
       
  2237  		    }
       
  2238  	    
       
  2239  	    if (fieldInfoPtr->iTypeId != 0)
       
  2240  	    //The field is found...
       
  2241  	    	{
       
  2242  	    	if ( (fieldInfoPtr->iValType & ELink) == ELink )
       
  2243  	    	//Found a link. Remember that this function is called if the input container is a field and
       
  2244  	    	//the type of the field is integer... So if we are here this means that somebody tries to read 
       
  2245  	    	//linked field with a CMDBField<TInt>. Conclusion is that this can be a legacy field where the
       
  2246  	    	//value of the field needs to be chenged to contain only the record number...
       
  2247  	    		{
       
  2248  	    		//field->iValue = ((field->iValue & KCDMaskShowRecordId) >> 8);
       
  2249  	    		*field = (*field & KCDMaskShowRecordId) >> 8;
       
  2250  	    		}
       
  2251  	    	}	    	
       
  2252      	}
       
  2253  	}
       
  2254 
       
  2255 
       
  2256 using namespace CommsDat;
       
  2257 
       
  2258 void CommsDatSchema::ValidateFieldTypeL(CMDBSession& aSession, CMDBElement& aElement)
       
  2259 /* checks the validity of the container being used for this element id
       
  2260  *
       
  2261  	EText,          // 50 length
       
  2262 	EDesC8,         // binary
       
  2263 	EUint32,
       
  2264 	EInt,
       
  2265 	EBool,
       
  2266 	EMedText,       // 256 length
       
  2267 	ELongText,		// 1024 length
       
  2268     ELink			// an integer field that is a link
       
  2269 
       
  2270   only looks up field types, not node types
       
  2271  */
       
  2272 	{
       
  2273 	TMDBElementId elementId = aElement.ElementId();
       
  2274 
       
  2275 	/*
       
  2276 	Don't try to validate nodes or user defined fields here  (CHECK - perhaps would be a good idea though??)
       
  2277 	*/
       
  2278 	if ( IsNode(elementId) || IsGenericRecord(elementId | KCDMaskShowColumnTypeAndRecordId) )
       
  2279 		{
       
  2280 		return;
       
  2281 		}
       
  2282 
       
  2283 	// Lookup type of element in the database
       
  2284 	const SRecordTypeInfo* pRecordTypeInfo = CommsDatSchemaV1_1::GetRecordTypeInfo(elementId);
       
  2285 
       
  2286 	while ( pRecordTypeInfo &&
       
  2287 		    (pRecordTypeInfo->iTypeId & KCDMaskShowFieldType) != (elementId & KCDMaskShowFieldType ) )
       
  2288 		{
       
  2289 		++pRecordTypeInfo;
       
  2290 		}
       
  2291 
       
  2292 	if (pRecordTypeInfo == 0)
       
  2293 		{
       
  2294 		// CHECK - how about looking for generic record info too?
       
  2295 		__FLOG_STATIC1(KLogComponent, KCDErrLog, _L("MMetaDatabase::ValidateFieldTypeL failed for unexpectedly for Element <%08x> because the type info for this element was not found"), aElement.ElementId());                        
       
  2296 		User::Leave(KErrArgument);
       
  2297 		}
       
  2298 
       
  2299 	TInt correctType = pRecordTypeInfo->iValType;
       
  2300 
       
  2301 	// read the type of the element stored with NetMeta
       
  2302 	TInt containerType = aElement.Type();
       
  2303 
       
  2304 	switch (containerType)
       
  2305 		{
       
  2306 		// note - cases ordered with most common types first
       
  2307 		case EInt :
       
  2308 			{
       
  2309 			switch (correctType & KCDShowBasicTypeInfo)
       
  2310                 {
       
  2311                 case EInt :
       
  2312                 case EUint32 :
       
  2313                     {
       
  2314                     // everything ok
       
  2315                     return; 
       
  2316                     }
       
  2317                 case EBool :
       
  2318 				    {
       
  2319 				    CMDBField<TInt>& boolField = static_cast<CMDBField<TInt>&>(aElement);
       
  2320 				    TInt value = boolField;
       
  2321 
       
  2322 				    if ( value == FALSE || value == TRUE)
       
  2323 					    {
       
  2324                         // everything ok
       
  2325                         return;
       
  2326                         }
       
  2327            
       
  2328                     break;
       
  2329 					}
       
  2330                 case ELink : 
       
  2331                     {
       
  2332                     CMDBNumFieldBase& numElement = static_cast<CMDBNumFieldBase&>(aElement);
       
  2333                     numElement = GetLinkIdL(aSession, numElement.ElementId(), numElement.GetL(), 0/*, NULL*/);
       
  2334                     
       
  2335                     return; // everything ok
       
  2336                     }
       
  2337                 }
       
  2338             break;
       
  2339             }
       
  2340         case ELink : 
       
  2341             {
       
  2342             if ( (correctType & KCDShowBasicTypeInfo) == ELink )
       
  2343                 {
       
  2344                 CMDBNumFieldBase& numElement = static_cast<CMDBNumFieldBase&>(aElement);
       
  2345                 numElement = GetLinkIdL(aSession, numElement.ElementId(), numElement.GetL(), 0/*, NULL*/);
       
  2346                 return;
       
  2347                 }
       
  2348             else
       
  2349                 {
       
  2350                 break;
       
  2351                 }
       
  2352             }
       
  2353 		case EText :
       
  2354 			{
       
  2355 			CMDBField<TDesC>& textField = static_cast<CMDBField<TDesC>&>(aElement);
       
  2356 			TDesC value = textField;
       
  2357 
       
  2358 			// Note - Checking the real length of the data not the max length in the container
       
  2359 			if (correctType == EText)
       
  2360 				{
       
  2361 				if ( value.Length() <= KMaxTextLength)
       
  2362 					{
       
  2363 					return;
       
  2364 					}
       
  2365 				}
       
  2366 			else if (correctType == EMedText)
       
  2367 				{
       
  2368 				if ( value.Length() <= KMaxMedTextLength)
       
  2369 					{
       
  2370 					return;
       
  2371 					}
       
  2372 				}
       
  2373 			else if (correctType == ELongText)
       
  2374 				{
       
  2375 				if ( value.Length() <= KMaxLongTextLength)
       
  2376 					{
       
  2377 					return;
       
  2378 					}
       
  2379 				}
       
  2380 
       
  2381 			break; // The string in the container is too long to be correct or the correct type is not text
       
  2382 			}
       
  2383 		case EDesC8 :
       
  2384 			{
       
  2385 			if (correctType == EDesC8)
       
  2386 				{
       
  2387 				return;
       
  2388 				}
       
  2389 			break;
       
  2390 			}
       
  2391 		default :
       
  2392 			{
       
  2393 			// don't need to check any other types so just return
       
  2394 			// useful to log an error though as really should not get here
       
  2395 			__FLOG_STATIC3(KLogComponent, KCDErrLog, _L("CommsDatSchema::ValidateTypeL.  Unexpectedly, the container type is %d.  ElementId is %d.  Correct type is %d. No validation attempted."), containerType, elementId, correctType);
       
  2396 
       
  2397 			ASSERT(0);
       
  2398 
       
  2399 			return;
       
  2400 			}
       
  2401 		}
       
  2402 
       
  2403 
       
  2404 	// The types are not compatible so log and leave
       
  2405 
       
  2406     __FLOG_STATIC3(KLogComponent, KCDErrLog, _L("CommsDatSchema::ValidateTypeL.  Container of type %d cannot be used to access element id %08x that has type %d"), containerType, elementId, correctType);
       
  2407 
       
  2408 	User::Leave(KErrArgument);
       
  2409 	}
       
  2410 
       
  2411 
       
  2412 
       
  2413 //EOF