apengine/apeng/src/APAccessPointItem.cpp
changeset 61 8b0c979bbe8c
parent 59 2709c04a4af5
child 70 ac5daea24fb0
equal deleted inserted replaced
59:2709c04a4af5 61:8b0c979bbe8c
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Declaration of the class CApAccessPointItem
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    21 #include <nifvar_internal.h>
       
    22 #endif
       
    23 #include    <cdblen.h>
       
    24 #include    <f32file.h>
       
    25 #include    <bautils.h>
       
    26 #include    <barsc.h>
       
    27 #include    <apengine.rsg>
       
    28 #include    "ApAccessPointItem.h"
       
    29 #include    "ApEngineConsts.h"
       
    30 #include    "ApEngineCommons.h"
       
    31 #include    "ApEngineLogger.h"
       
    32 #include    <txtetext.h>
       
    33 #include    <in_sock.h>
       
    34 
       
    35 #include    "APItemExtra.h"
       
    36 #include    "APItemCdmaData.h"
       
    37 #include    "APItemWlanData.h"
       
    38 
       
    39 #include    <featmgr.h>
       
    40 #include    <etelpckt.h>
       
    41 #include    <etelqos.h>
       
    42 
       
    43 #include    <data_caging_path_literals.hrh>
       
    44 
       
    45 
       
    46 // EXTERNAL FUNCTION PROTOTYPES
       
    47 
       
    48 // CONSTANTS
       
    49 _LIT( KDefIspIfName, "ppp" );                           // required !
       
    50 
       
    51 _LIT( KDefGprsIfName, "pppgprs" );                      // required !
       
    52 
       
    53 _LIT( KDefIspIfNetworksIPv4, "ip" );                        // required !
       
    54 //_LIT( KDefGprsIfParams, "gprsnif" );                    // required !
       
    55 _LIT( KDefGprsIfParams, "" );                    // required !
       
    56 
       
    57 _LIT( KDefWapGatewayIpAddress, "0.0.0.0" );
       
    58 _LIT( KDefIspGateway, "0.0.0.0" );
       
    59 _LIT( KDefPhoneIpAddress, "0.0.0.0" );
       
    60 _LIT( KDefPrimaryNameServer, "0.0.0.0" );
       
    61 _LIT( KDefSecondaryNameServer, "0.0.0.0" );
       
    62 
       
    63 _LIT( KWellKnownIp6PrimaryNameServer, "fec0:000:0000:ffff::1" );
       
    64 _LIT( KWellKnownIp6SecondaryNameServer, "fec0:000:0000:ffff::2" );
       
    65 _LIT( KDefIp6PrimaryNameServer, "0:0:0:0:0:0:0:0" );
       
    66 _LIT( KDefIp6SecondaryNameServer, "0:0:0:0:0:0:0:0" );
       
    67 
       
    68 _LIT( KDefIspIfNetworksIPv6, "ip6" );                        // required !
       
    69 _LIT( KDefIspIfNetworksIPv4IPv6, "ip,ip6" );                 // required !
       
    70 _LIT( KDefIspIfNetworksIPv4IPv6LAN, "ip,ip6" );              // required !
       
    71 
       
    72 
       
    73 
       
    74 /// ROM drive.
       
    75 _LIT( KApEngineResDriveZ, "z:" );
       
    76 /// ApEngine resource file name.
       
    77 _LIT( KApEngineResFileName, "ApEngine.rsc" );
       
    78 
       
    79 
       
    80 /**
       
    81 * General Settings UID
       
    82 */
       
    83 #ifdef __TEST_USE_SHARED_DATA
       
    84     LOCAL_D const TUid KGeneralSettingsUid = { 0X100058EC };
       
    85 #endif // __TEST_USE_SHARED_DATA
       
    86 
       
    87 
       
    88 // MACROS
       
    89 #define BOOL_COMPARE(a,b) (((a) && (b)) || (!(a) && !(b)))
       
    90 
       
    91 // LOCAL CONSTANTS AND MACROS
       
    92 const TInt KApItemInitialTxtBufSize = 0;
       
    93 
       
    94 const TInt KApMembers = EApWlanIPNameServer2+1;
       
    95 
       
    96 _LIT( KDefProxyProtocolName, "http" );                      // required !
       
    97 
       
    98 #if defined(_DEBUG)
       
    99     _LIT( kApSet, "APEngine" ) ;
       
   100 #endif // (_DEBUG)
       
   101 
       
   102 const TInt KEndOfArray = -1;
       
   103 
       
   104 const TInt KCsdAnalogue[]       = { KSpeedAutobaud, KSpeed9600, KSpeed14400,
       
   105                                     KEndOfArray };
       
   106 
       
   107 const TInt KCsdAnalogueWcdma[]  = { KSpeedAutobaud, KSpeed9600, KSpeed14400,
       
   108                                     KSpeed28800, KEndOfArray};
       
   109 
       
   110 const TInt KCsdIsdn110[]        = { KSpeed9600, KSpeed14400, KEndOfArray};
       
   111 
       
   112 const TInt KCsdIsdn110Wcdma[]   = { KSpeed9600, KSpeed14400, KSpeed28800,
       
   113                                     KSpeed38400, KEndOfArray};
       
   114 
       
   115 const TInt KCsdIsdn120[]        = { KSpeed9600, KSpeed14400, KEndOfArray};
       
   116 
       
   117 const TInt KCsdIsdn120Wcdma[]   = { KSpeed9600, KSpeed14400, KSpeed28800,
       
   118                                     KSpeed56000, KEndOfArray};
       
   119 
       
   120 const TInt KHcsdAnal[]          = { KSpeedAutobaud, KSpeed9600, KSpeed14400,
       
   121                                     KSpeed19200, KSpeed28800, KEndOfArray};
       
   122 
       
   123 const TInt KHcsdIsdn110[]       = { KSpeed9600, KSpeed14400, KSpeed19200, 
       
   124                                     KSpeed28800, KSpeed38400, KEndOfArray};
       
   125 
       
   126 const TInt KHcsdIsdn120[]       = { KSpeed9600, KSpeed14400, KSpeed19200,
       
   127                                     KSpeed28800, KSpeed43200, KEndOfArray};
       
   128 
       
   129 
       
   130 
       
   131 // ---------------------------------------------------------
       
   132 // ---------------------------------------------------------
       
   133 // 
       
   134 //  LOCAL, CApItemExtra class implementation
       
   135 // 
       
   136 // ---------------------------------------------------------
       
   137 // ---------------------------------------------------------
       
   138 //
       
   139 // ---------------------------------------------------------
       
   140 // CApItemExtra::NewL
       
   141 // ---------------------------------------------------------
       
   142 //
       
   143 CApItemExtra* CApItemExtra::NewL()
       
   144     {
       
   145     CLOG( ( EApItem, 0, _L( "-> CApItemExtra::NewL" ) ) );
       
   146 
       
   147     CApItemExtra* self = new ( ELeave ) CApItemExtra;
       
   148     CleanupStack::PushL( self );
       
   149     self->ConstructL();
       
   150 
       
   151     CleanupStack::Pop( self );
       
   152 
       
   153     CLOG( ( EApItem, 1, _L( "<- CApItemExtra::NewL" ) ) );
       
   154     
       
   155     return self;
       
   156     }
       
   157 
       
   158 
       
   159 // Destructor
       
   160 // ---------------------------------------------------------
       
   161 // CApItemExtra::~CApItemExtra
       
   162 // ---------------------------------------------------------
       
   163 //
       
   164 CApItemExtra::~CApItemExtra()
       
   165     {
       
   166     CLOG( ( EApItem, 0, _L( "-> CApItemExtra::~CApItemExtra" ) ) );
       
   167 
       
   168     delete iCdmaData;
       
   169     delete iWlanData;
       
   170     delete iIpv6PrimaryDNS;
       
   171     delete iIpv6SecondaryDNS;
       
   172     delete iLanBearerModemName;
       
   173     delete iIapBearerType;
       
   174     }
       
   175 
       
   176 
       
   177 // C++ default constructor can NOT contain any code that
       
   178 // might leave.
       
   179 // ---------------------------------------------------------
       
   180 // CApItemExtra::CApItemExtra
       
   181 // ---------------------------------------------------------
       
   182 //
       
   183 CApItemExtra::CApItemExtra()
       
   184 :iIsFeatureManagerInitialised( EFalse ),
       
   185 iIpv6GetDNSIPFromServer( ETrue ),
       
   186 iIsWcdma( EFalse ), 
       
   187 iIsIpv6Supported( EFalse ),
       
   188 iIsVpnAp( EFalse ),
       
   189 iIsAppCsdSupport( EFalse )
       
   190     {
       
   191     }
       
   192 
       
   193 // Symbian OS default constructor can leave.
       
   194 // ---------------------------------------------------------
       
   195 // CApItemExtra::ConstructL
       
   196 // ---------------------------------------------------------
       
   197 //
       
   198 void CApItemExtra::ConstructL()
       
   199     {
       
   200     CLOG( ( EApItem, 0, _L( "-> CApItemExtra::ConstructL" ) ) );
       
   201 
       
   202     iIpv6PrimaryDNS = HBufC::NewL( KApItemInitialTxtBufSize );
       
   203     iIpv6SecondaryDNS = HBufC::NewL( KApItemInitialTxtBufSize );
       
   204     iLanBearerModemName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   205     iIapBearerType = HBufC::NewL( KApItemInitialTxtBufSize );
       
   206      
       
   207 #ifdef __TEST_USE_SHARED_DATA
       
   208     iIsAppHscsdSupport = 
       
   209         ApCommons::IsGivenSharedDataSupportL( KGeneralSettingsUid, 
       
   210                                               KGSHSCSDAccessPoints );
       
   211 #else
       
   212     iIsAppHscsdSupport = ETrue;
       
   213 #endif // __TEST_USE_SHARED_DATA
       
   214 
       
   215 
       
   216 #ifdef __TEST_HSCSD_SUPPORT
       
   217     iIsAppHscsdSupport = ETrue;
       
   218 #endif // __TEST_HSCSD_SUPPORT
       
   219 
       
   220     CLOG( ( EApItem, 1, _L( "<- CApItemExtra::ConstructL" ) ) );
       
   221     }
       
   222 
       
   223 
       
   224 // ---------------------------------------------------------
       
   225 // ---------------------------------------------------------
       
   226 // 
       
   227 //  LOCAL, CApItemCdmaData class implementation
       
   228 // 
       
   229 // ---------------------------------------------------------
       
   230 // ---------------------------------------------------------
       
   231 //
       
   232 // ---------------------------------------------------------
       
   233 // CApItemCdmaData::NewL
       
   234 // ---------------------------------------------------------
       
   235 //
       
   236 CApItemCdmaData* CApItemCdmaData::NewL()
       
   237     {
       
   238     CLOG( ( EApItem, 0, _L( "-> CApItemCdmaData::NewL" ) ) );
       
   239 
       
   240     CApItemCdmaData* self = new ( ELeave ) CApItemCdmaData;
       
   241     CleanupStack::PushL( self );
       
   242     self->ConstructL();
       
   243     CleanupStack::Pop( self );
       
   244 
       
   245     CLOG( ( EApItem, 1, _L( "<- CApItemCdmaData::NewL" ) ) );
       
   246     
       
   247     return self;
       
   248     }
       
   249 
       
   250 
       
   251 // Destructor
       
   252 // ---------------------------------------------------------
       
   253 // CApItemCdmaData::~CApItemCdmaData
       
   254 // ---------------------------------------------------------
       
   255 //
       
   256 CApItemCdmaData::~CApItemCdmaData()
       
   257     {
       
   258     CLOG( ( EApItem, 0, _L( "-> CApItemCdmaData::~CApItemCdmaData" ) ) );
       
   259 
       
   260     delete iIwfName;
       
   261     delete iPdpAddress;
       
   262     delete iHomeAgentAddress;
       
   263     delete iMipHomeAddress;
       
   264     delete iMipPrimaryHomeAgent;
       
   265     delete iMipSecondaryHomeAgent;
       
   266     }
       
   267 
       
   268 
       
   269 // C++ default constructor can NOT contain any code that
       
   270 // might leave.
       
   271 // ---------------------------------------------------------
       
   272 // CApItemCdmaData::CApItemCdmaData
       
   273 // ---------------------------------------------------------
       
   274 //
       
   275 CApItemCdmaData::CApItemCdmaData()
       
   276 /* Assuming 0 default values everywhere. */
       
   277 :iServiceOption( RPacketContext::KLowSpeedData ),
       
   278 iPdpType( EIPv4 ),
       
   279 iReqFwdPriority( 0 ), /*RPacketQoS::TQoSLinkPriority*/
       
   280 iReqRevPriority( 0 ), /*RPacketQoS::TQoSLinkPriority*/
       
   281 iReqFwdBitrate( 0 ),  /*RPacketQoS::TQoSDataRate*/
       
   282 iReqRevBitrate( 0 ),  /*RPacketQoS::TQoSDataRate*/
       
   283 iReqFwdLoss( 0 ),  /*RPacketQoS::TQoSDataLoss*/
       
   284 iReqRevLoss( 0 ),  /*RPacketQoS::TQoSDataLoss*/
       
   285 iReqFwdMaxDelay( 0 ),  /*RPacketQoS::TQoSDelay*/
       
   286 iReqRevMaxDelay( 0 ),  /*RPacketQoS::TQoSDelay*/
       
   287 iMinFwdBitrate( 0 ),  /*RPacketQoS::TQoSDataRate*/
       
   288 iMinRevBitrate( 0 ),  /*RPacketQoS::TQoSDataRate*/
       
   289 iAccptFwdLoss( 0 ),  /*RPacketQoS::TQoSDataLoss*/
       
   290 iAccptRevLoss( 0 ),  /*RPacketQoS::TQoSDataLoss*/
       
   291 iAccptFwdMaxDelay( 0 ),  /*RPacketQoS::TQoSDelay*/
       
   292 iAccptRevMaxDelay( 0 ),  /*RPacketQoS::TQoSDelay*/
       
   293 iQosWarningTimeout( 0 ), /*0xffffffff disables*/
       
   294 iRlpMode( RPacketQoS::KRLPUnknown ),
       
   295 // CDMA2000 deprecated Mobile IP fields
       
   296 iMip( EFalse ),
       
   297 iMipTimeout( 0 ),
       
   298 // CDMA2000 specific CDMA parameters provisioned through OTA
       
   299 iNaiType( 0 ),
       
   300 iSimpleIpAuthAlgorithm( 0 ),
       
   301 iSimpleIpPapSsHandle( 0 ),
       
   302 iSimpleIpChapSsHandle( 0 ),
       
   303 iMipTBit( 0 ),
       
   304 iMipMnAaaAuthAlgorithm( 0 ),
       
   305 iMipMnAaaSpi( 0 ),
       
   306 iMipMnAaaSsHandle( 0 ),
       
   307 iMipMnHaAuthAlgorithm( 0 ),
       
   308 iMipMnHaSpi( 0 ),
       
   309 iMipMnHaSsHandle( 0 )
       
   310     {
       
   311     }
       
   312 
       
   313 // Symbian OS default constructor can leave.
       
   314 // ---------------------------------------------------------
       
   315 // CApItemCdmaData::ConstructL
       
   316 // ---------------------------------------------------------
       
   317 //
       
   318 void CApItemCdmaData::ConstructL()
       
   319     {
       
   320     CLOG( ( EApItem, 0, _L( "-> CApItemCdmaData::ConstructL" ) ) );
       
   321 
       
   322     iIwfName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   323     iPdpAddress = HBufC::NewL( KApItemInitialTxtBufSize );
       
   324     iHomeAgentAddress = HBufC::NewL( KApItemInitialTxtBufSize );
       
   325     iMipHomeAddress = HBufC::NewL( KApItemInitialTxtBufSize );
       
   326     iMipPrimaryHomeAgent = HBufC::NewL( KApItemInitialTxtBufSize );
       
   327     iMipSecondaryHomeAgent = HBufC::NewL( KApItemInitialTxtBufSize );
       
   328 
       
   329     CLOG( ( EApItem, 1, _L( "<- CApItemCdmaData::ConstructL" ) ) );
       
   330     }
       
   331 
       
   332 
       
   333 
       
   334 
       
   335 
       
   336 
       
   337 
       
   338 // ---------------------------------------------------------
       
   339 // ---------------------------------------------------------
       
   340 // 
       
   341 //  LOCAL, CApItemWlanData class implementation
       
   342 // 
       
   343 // ---------------------------------------------------------
       
   344 // ---------------------------------------------------------
       
   345 //
       
   346 // ---------------------------------------------------------
       
   347 // CApItemWlanData::NewL
       
   348 // ---------------------------------------------------------
       
   349 //
       
   350 CApItemWlanData* CApItemWlanData::NewL()
       
   351     {
       
   352     CLOG( ( EApItem, 0, _L( "-> CApItemWlanData::NewL" ) ) );
       
   353 
       
   354     CApItemWlanData* self = new ( ELeave ) CApItemWlanData;
       
   355     CleanupStack::PushL( self );
       
   356     self->ConstructL();
       
   357     CleanupStack::Pop( self );
       
   358 
       
   359     CLOG( ( EApItem, 1, _L( "<- CApItemWlanData::NewL" ) ) );
       
   360     
       
   361     return self;
       
   362     }
       
   363 
       
   364 
       
   365 // Destructor
       
   366 // ---------------------------------------------------------
       
   367 // CApItemWlanData::~CApItemWlanData
       
   368 // ---------------------------------------------------------
       
   369 //
       
   370 CApItemWlanData::~CApItemWlanData()
       
   371     {
       
   372     CLOG( ( EApItem, 0, _L( "-> CApItemWlanData::~CApItemWlanData" ) ) );
       
   373     delete iWlanNetworkName;
       
   374     }
       
   375 
       
   376 
       
   377 // C++ default constructor can NOT contain any code that
       
   378 // might leave.
       
   379 // ---------------------------------------------------------
       
   380 // CApItemWlanData::CApItemWlanData
       
   381 // ---------------------------------------------------------
       
   382 //
       
   383 CApItemWlanData::CApItemWlanData()
       
   384 :iWlanNetworkMode( EInfra ),
       
   385 iWlanSecurityMode( EOpen )
       
   386 /* Assuming 0 default values elsewhere. */
       
   387     {
       
   388     }
       
   389 
       
   390 // Symbian OS default constructor can leave.
       
   391 // ---------------------------------------------------------
       
   392 // CApItemWlanData::ConstructL
       
   393 // ---------------------------------------------------------
       
   394 //
       
   395 void CApItemWlanData::ConstructL()
       
   396     {
       
   397     CLOG( ( EApItem, 0, _L( "-> CApItemWlanData::ConstructL" ) ) );
       
   398 
       
   399     iWlanNetworkName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   400 
       
   401     CLOG( ( EApItem, 1, _L( "<- CApItemWlanData::ConstructL" ) ) );
       
   402     }
       
   403 
       
   404 
       
   405 
       
   406 
       
   407 // MODULE DATA STRUCTURES
       
   408 
       
   409 // =========================================================
       
   410 // =========================================================
       
   411 // =========================================================
       
   412 // 
       
   413 // CApAccessPointItem class implementation
       
   414 // 
       
   415 // =========================================================
       
   416 // =========================================================
       
   417 // =========================================================
       
   418 //
       
   419 
       
   420 // ================= MEMBER FUNCTIONS =======================
       
   421 // Two-phased constructor.
       
   422 // ---------------------------------------------------------
       
   423 // CApAccessPointItem::NewLC
       
   424 // ---------------------------------------------------------
       
   425 //
       
   426 EXPORT_C CApAccessPointItem* CApAccessPointItem::NewLC()
       
   427     {
       
   428     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::NewLC" ) ) );
       
   429 
       
   430     CApAccessPointItem* self = new ( ELeave ) CApAccessPointItem;
       
   431     CleanupStack::PushL( self );
       
   432     self->ConstructL();
       
   433 
       
   434     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::NewLC" ) ) );
       
   435     return self;
       
   436     }
       
   437 
       
   438 
       
   439 // Destructor
       
   440 // ---------------------------------------------------------
       
   441 // CApAccessPointItem::~CApAccessPointItem
       
   442 // ---------------------------------------------------------
       
   443 //
       
   444 EXPORT_C CApAccessPointItem::~CApAccessPointItem()
       
   445     {
       
   446     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::~CApAccessPointItem" ) ) );
       
   447 
       
   448     if ( iExt )
       
   449         {
       
   450         if ( iExt->iIsFeatureManagerInitialised )
       
   451             {
       
   452             FeatureManager::UnInitializeLib();
       
   453             }
       
   454         }
       
   455 
       
   456     delete iExt;
       
   457     delete iSpecified;
       
   458     delete iWapAccessPointName;
       
   459     delete iWapBearer;
       
   460     delete iStartingPage;
       
   461     delete iWapGatewayAddress;
       
   462     delete iIapName;
       
   463     delete iIspName;
       
   464     delete iIspDescription;
       
   465     delete iIspDefaultTelNumber;
       
   466     delete iLoginScript;
       
   467     delete iUserName;
       
   468     delete iPassword;
       
   469     delete iIspIfName;
       
   470     delete iIspIfParams;
       
   471     delete iIspIfNetworks;
       
   472     delete iIspIfAuthName;
       
   473     delete iIspIfAuthPass;
       
   474     delete iIspIfCallbackInfo;
       
   475     delete iIspIPAddr;
       
   476     delete iIspIPNetMask;
       
   477     delete iIspGateway;
       
   478     delete iPrimaryDNS;
       
   479     delete iSecondaryDNS;
       
   480     delete iIspInitString;
       
   481     delete iIapServiceType;
       
   482     delete iGprsAccessPointName;
       
   483     delete iGprsPdpAddress;
       
   484     delete iApProxyProtocolName;
       
   485     delete iApProxyServerAddress;
       
   486     delete iApProxyExceptions;
       
   487     delete iNetworkName;
       
   488     delete iWapProxyLoginName; 
       
   489     delete iWapProxyLoginPass;
       
   490 
       
   491     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::~CApAccessPointItem" ) ) );
       
   492     }
       
   493 
       
   494 
       
   495 // ---------------------------------------------------------
       
   496 // CApAccessPointItem::CopyFromL
       
   497 // ---------------------------------------------------------
       
   498 //
       
   499 EXPORT_C void CApAccessPointItem::CopyFromL( const CApAccessPointItem&
       
   500                                             aCopyFrom  )
       
   501     {
       
   502     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CopyFromL" ) ) );
       
   503 
       
   504     WriteTextL( EApWapAccessPointName, *aCopyFrom.iWapAccessPointName );
       
   505     WriteTextL( EApWapCurrentBearer, *aCopyFrom.iWapBearer );
       
   506     WriteLongTextL( EApWapStartPage, *aCopyFrom.iStartingPage );
       
   507     // The WAP gateway address
       
   508     WriteTextL( EApWapGatewayAddress, *aCopyFrom.iWapGatewayAddress );
       
   509 
       
   510     iIsWTLSSecurityOn = aCopyFrom.iIsWTLSSecurityOn;
       
   511     iIsConnectionTypeContinuous = aCopyFrom.iIsConnectionTypeContinuous;
       
   512     iChargeCard = aCopyFrom.iChargeCard;
       
   513     iWapIap = aCopyFrom.iWapIap;
       
   514 
       
   515     WriteTextL( EApIapName, *aCopyFrom.iIapName );
       
   516     iIapServiceId = aCopyFrom.iIapServiceId;
       
   517     WriteTextL( EApIapServiceType, *aCopyFrom.iIapServiceType );
       
   518 
       
   519 
       
   520     iIapChargeCardId = aCopyFrom.iIapChargeCardId;
       
   521 
       
   522     WriteTextL( EApIspName, *aCopyFrom.iIspName );
       
   523     WriteTextL( EApIspDescription, *aCopyFrom.iIspDescription );
       
   524 
       
   525     iIspType = aCopyFrom.iIspType;
       
   526 
       
   527     WriteTextL( EApIspDefaultTelNumber, *aCopyFrom.iIspDefaultTelNumber );
       
   528 
       
   529     iIspDialResolution = aCopyFrom.iIspDialResolution;
       
   530     iUseLoginScript = aCopyFrom.iUseLoginScript;
       
   531 
       
   532     WriteLongTextL( EApIspLoginScript, *aCopyFrom.iLoginScript );
       
   533 
       
   534     iPromptPassword = aCopyFrom.iPromptPassword;
       
   535 
       
   536     WriteTextL( EApIspLoginName, *aCopyFrom.iUserName );
       
   537     WriteTextL( EApIspLoginPass, *aCopyFrom.iPassword );
       
   538 
       
   539     iDisplayTerminalWindow = aCopyFrom.iDisplayTerminalWindow;
       
   540 
       
   541     WriteTextL( EApIspIfName, *aCopyFrom.iIspIfName );
       
   542     WriteTextL( EApIspIfParams, *aCopyFrom.iIspIfParams );
       
   543     WriteTextL( EApIspIfNetworks, *aCopyFrom.iIspIfNetworks );
       
   544 
       
   545     iIspIfPromptForAuth = aCopyFrom.iIspIfPromptForAuth;
       
   546 
       
   547     WriteTextL( EApIspIfAuthName, *aCopyFrom.iIspIfAuthName );
       
   548     WriteTextL( EApIspIfAuthPass, *aCopyFrom.iIspIfAuthPass );
       
   549 
       
   550     iIspIfAuthRetries = aCopyFrom.iIspIfAuthRetries;
       
   551     iUseCallBack = aCopyFrom.iUseCallBack;
       
   552     iCallBackTypeIsServerNum = aCopyFrom.iCallBackTypeIsServerNum;
       
   553 
       
   554     WriteTextL( EApIspIfCallbackInfo, *aCopyFrom.iIspIfCallbackInfo );
       
   555 
       
   556     iIspCallbackTimeOut = aCopyFrom.iIspCallbackTimeOut;
       
   557     iIspIPAddrFromServer = aCopyFrom.iIspIPAddrFromServer;
       
   558 
       
   559     WriteTextL( EApIspIPAddr, *aCopyFrom.iIspIPAddr );
       
   560     WriteTextL( EApIspIPNetMask, *aCopyFrom.iIspIPNetMask );
       
   561     WriteTextL( EApIspIPGateway, *aCopyFrom.iIspGateway );
       
   562 
       
   563     iGetDNSIPFromServer = aCopyFrom.iGetDNSIPFromServer;
       
   564 
       
   565     WriteTextL( EApIspIPNameServer1, *aCopyFrom.iPrimaryDNS );
       
   566     WriteTextL( EApIspIPNameServer2, *aCopyFrom.iSecondaryDNS );
       
   567 
       
   568     iEnablePPPCompression = aCopyFrom.iEnablePPPCompression;
       
   569     iIspEnableLCPExtensions = aCopyFrom.iIspEnableLCPExtensions;
       
   570     iIsPasswordAuthenticationSecure =
       
   571                 aCopyFrom.iIsPasswordAuthenticationSecure;
       
   572     iIspEnableSwCompression = aCopyFrom.iIspEnableSwCompression;
       
   573     iIspBearerName = aCopyFrom.iIspBearerName;
       
   574     iMaxConnSpeed = aCopyFrom.iMaxConnSpeed;
       
   575     iIspBearerCE = aCopyFrom.iIspBearerCE;
       
   576     iApIapBearerService = aCopyFrom.iApIapBearerService;
       
   577     iBearerCallTypeIsdn = aCopyFrom.iBearerCallTypeIsdn;
       
   578 
       
   579     WriteTextL( EApIspInitString, *aCopyFrom.iIspInitString );
       
   580 
       
   581     iIspBearerType = aCopyFrom.iIspBearerType;
       
   582     iIspChannelCoding = aCopyFrom.iIspChannelCoding;
       
   583     iIspAIUR = aCopyFrom.iIspAIUR;
       
   584     iIspRequestedTimeSlots = aCopyFrom.iIspRequestedTimeSlots;
       
   585     iIspMaximumTimeSlots = aCopyFrom.iIspMaximumTimeSlots;
       
   586 
       
   587     WriteLongTextL( EApGprsAccessPointName, *aCopyFrom.iGprsAccessPointName );
       
   588 
       
   589     WriteTextL( EApGprsPdpAddress, *aCopyFrom.iGprsPdpAddress );
       
   590 
       
   591     iGprsPdpType = aCopyFrom.iGprsPdpType;
       
   592     iGprsReqPrecedence = aCopyFrom.iGprsReqPrecedence;
       
   593     iGprsReqDelay = aCopyFrom.iGprsReqDelay;
       
   594     iGprsReqReliability = aCopyFrom.iGprsReqReliability;
       
   595     iGprsReqPeakThroughput = aCopyFrom.iGprsReqPeakThroughput;
       
   596     iGprsReqMeanPeakThroughput = aCopyFrom.iGprsReqMeanPeakThroughput;
       
   597     iGprsMinPrecedence = aCopyFrom.iGprsMinPrecedence;
       
   598 
       
   599     iGprsMinDelay = aCopyFrom.iGprsMinDelay;
       
   600     iGprsMinReliability = aCopyFrom.iGprsMinReliability;
       
   601     iGprsMinPeakThroughput = aCopyFrom.iGprsMinPeakThroughput;
       
   602     iGprsMinMeanThroughput = aCopyFrom.iGprsMinMeanThroughput;
       
   603 
       
   604     iGprsUseAnonymAccess = aCopyFrom.iGprsUseAnonymAccess;
       
   605     WriteTextL( EApProxyProtocolName, *aCopyFrom.iApProxyProtocolName );
       
   606     WriteLongTextL( EApProxyServerAddress, *aCopyFrom.iApProxyServerAddress );
       
   607     WriteLongTextL( EApProxyExceptions, *aCopyFrom.iApProxyExceptions);        
       
   608     iApProxyPortNumber = aCopyFrom.iApProxyPortNumber;
       
   609     iApProxyUseProxy = aCopyFrom.iApProxyUseProxy;
       
   610     iApHasProxySettings = aCopyFrom.iApHasProxySettings;
       
   611     WriteTextL( EApNetworkName, *aCopyFrom.iNetworkName );
       
   612     WriteTextL( EApProxyLoginName, *aCopyFrom.iWapProxyLoginName );
       
   613     WriteTextL( EApProxyLoginPass, *aCopyFrom.iWapProxyLoginPass );
       
   614 
       
   615     iNetworkId = aCopyFrom.iNetworkId;
       
   616     WriteTextL( EApLanBearerName, *aCopyFrom.iExt->iLanBearerModemName );
       
   617     WriteTextL( EApIapBearerType, *aCopyFrom.iExt->iIapBearerType );
       
   618 
       
   619 
       
   620     // Copying of WLAN data must be before Ipv6 support handling as that 
       
   621     // requires the knowledge of the bearer type!!!!!
       
   622     if ( iExt->iWlanData )
       
   623         {
       
   624         iExt->iWlanData->iWlanNetworkMode = 
       
   625                     aCopyFrom.iExt->iWlanData->iWlanNetworkMode;
       
   626         iExt->iWlanData->iWlanSecurityMode = 
       
   627                     aCopyFrom.iExt->iWlanData->iWlanSecurityMode;
       
   628         ReAllocL( iExt->iWlanData->iWlanNetworkName, 
       
   629                     *aCopyFrom.iExt->iWlanData->iWlanNetworkName );
       
   630         iExt->iWlanData->iWlanId = aCopyFrom.iExt->iWlanData->iWlanId;
       
   631         iExt->iWlanData->iIsWlan = aCopyFrom.iExt->iWlanData->iIsWlan;
       
   632         iExt->iWlanData->iScanSSID = aCopyFrom.iExt->iWlanData->iScanSSID;
       
   633         iExt->iWlanData->iChannelId = aCopyFrom.iExt->iWlanData->iChannelId;
       
   634         }
       
   635 
       
   636     if ( iExt->iIsIpv6Supported )
       
   637         {
       
   638         iExt->iIpv6GetDNSIPFromServer = 
       
   639             aCopyFrom.iExt->iIpv6GetDNSIPFromServer;
       
   640         WriteTextL( EApIP6NameServer1, *aCopyFrom.iExt->iIpv6PrimaryDNS );
       
   641         WriteTextL( EApIP6NameServer2, *aCopyFrom.iExt->iIpv6SecondaryDNS );
       
   642         }
       
   643 
       
   644     if( iExt->iCdmaData )
       
   645         {
       
   646         // CDMA2000
       
   647         ReAllocL( iExt->iCdmaData->iIwfName, 
       
   648                     *aCopyFrom.iExt->iCdmaData->iIwfName );
       
   649         iExt->iCdmaData->iServiceOption = 
       
   650                     aCopyFrom.iExt->iCdmaData->iServiceOption;
       
   651         iExt->iCdmaData->iPdpType = aCopyFrom.iExt->iCdmaData->iPdpType;
       
   652         ReAllocL( iExt->iCdmaData->iPdpAddress, 
       
   653                     *aCopyFrom.iExt->iCdmaData->iPdpAddress );
       
   654         iExt->iCdmaData->iReqFwdPriority = 
       
   655                     aCopyFrom.iExt->iCdmaData->iReqFwdPriority;
       
   656         iExt->iCdmaData->iReqRevPriority = 
       
   657                     aCopyFrom.iExt->iCdmaData->iReqRevPriority;
       
   658         iExt->iCdmaData->iReqFwdBitrate = 
       
   659                     aCopyFrom.iExt->iCdmaData->iReqFwdBitrate;
       
   660         iExt->iCdmaData->iReqRevBitrate = 
       
   661                     aCopyFrom.iExt->iCdmaData->iReqRevBitrate;
       
   662         iExt->iCdmaData->iReqFwdLoss = aCopyFrom.iExt->iCdmaData->iReqFwdLoss;
       
   663         iExt->iCdmaData->iReqRevLoss = aCopyFrom.iExt->iCdmaData->iReqRevLoss;
       
   664         iExt->iCdmaData->iReqFwdMaxDelay = 
       
   665                     aCopyFrom.iExt->iCdmaData->iReqFwdMaxDelay;
       
   666         iExt->iCdmaData->iReqRevMaxDelay = 
       
   667                     aCopyFrom.iExt->iCdmaData->iReqRevMaxDelay;
       
   668         iExt->iCdmaData->iMinFwdBitrate = 
       
   669                     aCopyFrom.iExt->iCdmaData->iMinFwdBitrate;
       
   670         iExt->iCdmaData->iMinRevBitrate = 
       
   671                     aCopyFrom.iExt->iCdmaData->iMinRevBitrate;
       
   672         iExt->iCdmaData->iAccptFwdLoss = 
       
   673                     aCopyFrom.iExt->iCdmaData->iAccptFwdLoss;
       
   674         iExt->iCdmaData->iAccptRevLoss = 
       
   675                     aCopyFrom.iExt->iCdmaData->iAccptRevLoss;
       
   676         iExt->iCdmaData->iAccptFwdMaxDelay = 
       
   677                     aCopyFrom.iExt->iCdmaData->iAccptFwdMaxDelay;
       
   678         iExt->iCdmaData->iAccptRevMaxDelay = 
       
   679                     aCopyFrom.iExt->iCdmaData->iAccptRevMaxDelay;
       
   680         iExt->iCdmaData->iQosWarningTimeout = 
       
   681                     aCopyFrom.iExt->iCdmaData->iQosWarningTimeout;
       
   682         iExt->iCdmaData->iRlpMode = aCopyFrom.iExt->iCdmaData->iRlpMode;
       
   683         // CDMA2000 deprecated Mobile IP fields
       
   684         iExt->iCdmaData->iMip = aCopyFrom.iExt->iCdmaData->iMip;
       
   685         ReAllocL( iExt->iCdmaData->iHomeAgentAddress, 
       
   686                     *aCopyFrom.iExt->iCdmaData->iHomeAgentAddress );
       
   687         iExt->iCdmaData->iMipTimeout = aCopyFrom.iExt->iCdmaData->iMipTimeout;
       
   688         // CDMA2000 specific CDMA parameters provisioned through OTA
       
   689         iExt->iCdmaData->iNaiType = aCopyFrom.iExt->iCdmaData->iNaiType;
       
   690         iExt->iCdmaData->iSimpleIpAuthAlgorithm = 
       
   691                     aCopyFrom.iExt->iCdmaData->iSimpleIpAuthAlgorithm;
       
   692         iExt->iCdmaData->iSimpleIpPapSsHandle = 
       
   693                     aCopyFrom.iExt->iCdmaData->iSimpleIpPapSsHandle;
       
   694         iExt->iCdmaData->iSimpleIpChapSsHandle = 
       
   695                     aCopyFrom.iExt->iCdmaData->iSimpleIpChapSsHandle;
       
   696         iExt->iCdmaData->iMipTBit = aCopyFrom.iExt->iCdmaData->iMipTBit;
       
   697         ReAllocL( iExt->iCdmaData->iMipHomeAddress, 
       
   698                     *aCopyFrom.iExt->iCdmaData->iMipHomeAddress );
       
   699         ReAllocL( iExt->iCdmaData->iMipPrimaryHomeAgent, 
       
   700                     *aCopyFrom.iExt->iCdmaData->iMipPrimaryHomeAgent );
       
   701         ReAllocL( iExt->iCdmaData->iMipSecondaryHomeAgent, 
       
   702                     *aCopyFrom.iExt->iCdmaData->iMipSecondaryHomeAgent );
       
   703         iExt->iCdmaData->iMipMnAaaAuthAlgorithm = 
       
   704                     aCopyFrom.iExt->iCdmaData->iMipMnAaaAuthAlgorithm;
       
   705         iExt->iCdmaData->iMipMnAaaSpi = 
       
   706                     aCopyFrom.iExt->iCdmaData->iMipMnAaaSpi;
       
   707         iExt->iCdmaData->iMipMnAaaSsHandle = 
       
   708                     aCopyFrom.iExt->iCdmaData->iMipMnAaaSsHandle;
       
   709         iExt->iCdmaData->iMipMnHaAuthAlgorithm = 
       
   710                     aCopyFrom.iExt->iCdmaData->iMipMnHaAuthAlgorithm;
       
   711         iExt->iCdmaData->iMipMnHaSpi = aCopyFrom.iExt->iCdmaData->iMipMnHaSpi;
       
   712         iExt->iCdmaData->iMipMnHaSsHandle = 
       
   713                     aCopyFrom.iExt->iCdmaData->iMipMnHaSsHandle;
       
   714         }
       
   715 
       
   716 
       
   717     SetIfNetworksL();
       
   718 
       
   719     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CopyFromL" ) ) );
       
   720     }
       
   721 
       
   722 
       
   723 
       
   724 // ---------------------------------------------------------
       
   725 // CApAccessPointItem::operator==
       
   726 // ---------------------------------------------------------
       
   727 //
       
   728 EXPORT_C TBool CApAccessPointItem::operator==(
       
   729                                              const CApAccessPointItem& aItem
       
   730                                              ) const
       
   731     {
       
   732     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::operator==" ) ) );
       
   733 
       
   734     TBool retval( EFalse );
       
   735     TRAPD( err, retval = DoCompareApL( aItem ) );
       
   736     if ( err )
       
   737         {
       
   738         retval = EFalse;
       
   739         }
       
   740 
       
   741     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::operator==" ) ) );
       
   742     return retval;
       
   743     }
       
   744 
       
   745 
       
   746 
       
   747 // ---------------------------------------------------------
       
   748 // CApAccessPointItem::operator!=
       
   749 // ---------------------------------------------------------
       
   750 //
       
   751 EXPORT_C TBool CApAccessPointItem::operator!=(
       
   752                                              const CApAccessPointItem& aItem
       
   753                                              ) const
       
   754     {
       
   755     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::operator!=" ) ) );
       
   756 
       
   757     TBool ret = ( *this == aItem );
       
   758 
       
   759     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::operator!=" ) ) );
       
   760     return ( !ret );
       
   761     }
       
   762 
       
   763 
       
   764 
       
   765 // C++ default constructor can NOT contain any code that
       
   766 // might leave.
       
   767 // ---------------------------------------------------------
       
   768 // CApAccessPointItem::CApAccessPointItem
       
   769 // ---------------------------------------------------------
       
   770 //
       
   771 EXPORT_C CApAccessPointItem::CApAccessPointItem()
       
   772 :iIsWTLSSecurityOn( EFalse ),
       
   773 iIsConnectionTypeContinuous( EWapWspOptionConnectionOriented ),
       
   774 iIspType( EIspTypeInternetOnly ),
       
   775 iUseLoginScript( EFalse ),
       
   776 iPromptPassword( EFalse ),
       
   777 iDisplayTerminalWindow( EFalse ),
       
   778 iUseCallBack( EFalse ),
       
   779 iCallBackTypeIsServerNum( ECallbackActionMSCBCPAcceptServerSpecifiedNumber ),
       
   780 iIspCallbackTimeOut( KCallBackTimeOut ),
       
   781 iEnablePPPCompression( EFalse ),
       
   782 iIsPasswordAuthenticationSecure( ETrue ),
       
   783 iBearerCallTypeIsdn( ECallTypeAnalogue ),
       
   784 iIspBearerCE( RMobileCall::EQoSNonTransparent ),
       
   785 iGprsPdpType( EIPv4 ),
       
   786 iIsReadOnly( EFalse ),
       
   787 iApHasProxySettings( EFalse ),
       
   788 iNetworkId( 0 ),
       
   789 iApIapBearerService( RMobileCall::KCapsDataCircuitAsynchronous )
       
   790 
       
   791     {
       
   792     }
       
   793 
       
   794 
       
   795 // Symbian OS default constructor can leave.
       
   796 // ---------------------------------------------------------
       
   797 // CApAccessPointItem::ConstructL
       
   798 // ---------------------------------------------------------
       
   799 //
       
   800 EXPORT_C void CApAccessPointItem::ConstructL()
       
   801     {
       
   802     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ConstructL" ) ) );
       
   803    
       
   804     iExt = CApItemExtra::NewL();
       
   805 
       
   806     FeatureManager::InitializeLibL();
       
   807     iExt->iIsFeatureManagerInitialised = ETrue;
       
   808 
       
   809     iExt->iIsWcdma = 
       
   810         FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma );
       
   811 
       
   812     iExt->iIsAppCsdSupport = 
       
   813         FeatureManager::FeatureSupported( KFeatureIdAppCsdSupport );
       
   814 #ifdef __TEST_CSD_SUPPORT
       
   815     iExt->iIsAppCsdSupport = ETrue;
       
   816 #endif // __TEST_CSD_SUPPORT
       
   817 
       
   818 
       
   819     iExt->iIsIpv6Supported = 
       
   820         FeatureManager::FeatureSupported( KFeatureIdIPv6 );
       
   821 #ifdef __TEST_IPV6_SUPPORT    
       
   822     iExt->iIsIpv6Supported = ETrue;
       
   823 #endif //  __TEST_IPV6_SUPPORT    
       
   824     if( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) )
       
   825         {
       
   826         iExt->iCdmaData = CApItemCdmaData::NewL();
       
   827         }
       
   828 #ifdef __TEST_CDMA_SUPPORT
       
   829     if( !iExt->iCdmaData )
       
   830         {
       
   831         iExt->iCdmaData = CApItemCdmaData::NewL();
       
   832         }
       
   833 #endif // __TEST_CDMA_SUPPORT
       
   834 
       
   835     if( FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ) )
       
   836         {
       
   837         iExt->iWlanData = CApItemWlanData::NewL();
       
   838         }
       
   839 #ifdef __TEST_WLAN_SUPPORT
       
   840     iExt->iWlanData = CApItemWlanData::NewL();
       
   841 #endif // __TEST_WLAN_SUPPORT
       
   842 
       
   843     iSpecified = new (ELeave) CArrayFixFlat<TBool>( KApMembers );
       
   844     for (TInt i=0; i< KApMembers; i++)
       
   845         {
       
   846         iSpecified->AppendL( EFalse );
       
   847         }
       
   848     // as we are in ConstructL called from NewLC,
       
   849     // 'this' is already on the CleanupStack,
       
   850     // so do not push members onto it!
       
   851     iWapAccessPointName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   852     iWapBearer = HBufC::NewL( KApItemInitialTxtBufSize );
       
   853     iStartingPage = HBufC::NewL( KApItemInitialTxtBufSize );
       
   854     iWapGatewayAddress = HBufC::NewL( KApItemInitialTxtBufSize );
       
   855     iIapName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   856     iIspName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   857     iIspDescription = HBufC::NewL( KApItemInitialTxtBufSize );
       
   858     iLoginScript = HBufC::NewL( KApItemInitialTxtBufSize );
       
   859     iUserName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   860 
       
   861     iPassword = HBufC::NewL( KApItemInitialTxtBufSize );
       
   862     iIspIfName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   863     iIspIfParams = HBufC::NewL( KApItemInitialTxtBufSize );
       
   864     iIspIfNetworks = HBufC::NewL( KApItemInitialTxtBufSize );
       
   865     iIspIfAuthName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   866     iIspIfAuthPass = HBufC::NewL( KApItemInitialTxtBufSize );
       
   867     iIspIfCallbackInfo = HBufC8::NewL( KApItemInitialTxtBufSize );
       
   868     iIspIPAddr = HBufC::NewL( KApItemInitialTxtBufSize );
       
   869     iIspIPNetMask = HBufC::NewL( KApItemInitialTxtBufSize );
       
   870     iIspGateway = HBufC::NewL( KApItemInitialTxtBufSize );
       
   871 
       
   872     iPrimaryDNS = HBufC::NewL( KApItemInitialTxtBufSize );
       
   873     iSecondaryDNS = HBufC::NewL( KApItemInitialTxtBufSize );
       
   874     iIspInitString = HBufC8::NewL( KApItemInitialTxtBufSize );
       
   875     iIspDefaultTelNumber = HBufC::NewL( KApItemInitialTxtBufSize );
       
   876 
       
   877 
       
   878     iIapServiceType = HBufC::NewL( KApItemInitialTxtBufSize );
       
   879     iGprsAccessPointName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   880     iGprsPdpAddress = HBufC::NewL( KApItemInitialTxtBufSize );
       
   881 
       
   882 
       
   883     iApProxyProtocolName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   884     iApProxyServerAddress = HBufC::NewL( KApItemInitialTxtBufSize );
       
   885     iApProxyExceptions = HBufC::NewL( KApItemInitialTxtBufSize );
       
   886     iNetworkName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   887 
       
   888     iWapProxyLoginName = HBufC::NewL( KApItemInitialTxtBufSize );
       
   889     iWapProxyLoginPass = HBufC::NewL( KApItemInitialTxtBufSize );
       
   890 
       
   891     RFs fs;
       
   892     CleanupClosePushL<RFs>( fs );
       
   893     User::LeaveIfError( fs.Connect() );
       
   894 
       
   895     // can't use resource here because it is not added yet....
       
   896     TFileName resourceFile;
       
   897     resourceFile.Append( KApEngineResDriveZ );
       
   898     resourceFile.Append( KDC_RESOURCE_FILES_DIR );
       
   899     resourceFile.Append( KApEngineResFileName );
       
   900     BaflUtils::NearestLanguageFile( fs, resourceFile );
       
   901 
       
   902     RResourceFile rf;
       
   903     CleanupClosePushL<RResourceFile>( rf );
       
   904     rf.OpenL( fs, resourceFile );
       
   905     rf.ConfirmSignatureL( 0 );
       
   906     HBufC8* readBuffer = rf.AllocReadLC( R_APNG_DEFAULT_AP_NAME );
       
   907     // as we are expecting HBufC16...
       
   908     __ASSERT_DEBUG( ( readBuffer->Length()%2 ) == 0,
       
   909                     ApCommons::Panic( EWrongResourceFormat ) );
       
   910     const TPtrC16 ptrReadBuffer( (TText16*) readBuffer->Ptr(),
       
   911                                  ( readBuffer->Length() + 1 ) >> 1 );
       
   912     HBufC16* textBuffer=HBufC16::NewL( ptrReadBuffer.Length() );
       
   913     *textBuffer=ptrReadBuffer;
       
   914     CleanupStack::PopAndDestroy( readBuffer ); // readBuffer
       
   915     CleanupStack::PushL( textBuffer );
       
   916     
       
   917     SetNamesL( *textBuffer );
       
   918 
       
   919     CleanupStack::PopAndDestroy( 3 ); // textbuffer, fs, rf
       
   920 
       
   921     WriteTextL( EApWapCurrentBearer, TPtrC(WAP_IP_BEARER) );    // required !
       
   922 
       
   923     WriteTextL( EApIapServiceType, TPtrC(OUTGOING_WCDMA) );      // required !
       
   924 
       
   925 
       
   926     WriteTextL( EApIspIfName, KDefGprsIfName );                 // required !
       
   927     WriteTextL( EApIspIfParams, KDefGprsIfParams );             // required !
       
   928     WriteTextL( EApIspIPGateway, KDefIspGateway );
       
   929     
       
   930     WriteTextL( EApWapGatewayAddress, KDefWapGatewayIpAddress );
       
   931     WriteTextL( EApIspIPAddr, KDefPhoneIpAddress );
       
   932     WriteTextL( EApIspIPNameServer1, KDefPrimaryNameServer );
       
   933     WriteTextL( EApIspIPNameServer2, KDefSecondaryNameServer );
       
   934 
       
   935     if ( iExt->iIsIpv6Supported )
       
   936         {
       
   937         WriteTextL( EApIP6NameServer1, KDefIp6PrimaryNameServer );
       
   938         WriteTextL( EApIP6NameServer2, KDefIp6SecondaryNameServer );
       
   939         }
       
   940 
       
   941     SetIfNetworksL();
       
   942 
       
   943     WriteTextL( EApProxyProtocolName, KDefProxyProtocolName );
       
   944 
       
   945     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ConstructL" ) ) );
       
   946     }
       
   947 
       
   948 
       
   949 // ---------------------------------------------------------
       
   950 // CApAccessPointItem::ReadTextL
       
   951 // ---------------------------------------------------------
       
   952 //
       
   953 EXPORT_C void CApAccessPointItem::ReadTextL( const TApMember aColumn,
       
   954                                            TDes8& aValue )
       
   955     {
       
   956     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReadTextL8" ) ) );
       
   957 
       
   958     LeaveIfUnsupportedL( aColumn );
       
   959 
       
   960     switch ( aColumn )
       
   961         {
       
   962         case EApIspIfCallbackInfo:
       
   963             {
       
   964             // make it large enough to hold
       
   965             aValue.SetLength( iIspIfCallbackInfo->Length() );
       
   966             aValue.Format( KFormat8, iIspIfCallbackInfo );
       
   967             break;
       
   968             }
       
   969         case EApIspInitString:
       
   970             {
       
   971             // make it large enough to hold
       
   972             aValue.SetLength( iIspInitString->Length() );
       
   973             aValue.Format( KFormat8, iIspInitString );
       
   974             break;
       
   975             }
       
   976         default:
       
   977             {
       
   978             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
   979             User::Leave( KErrInvalidColumn );
       
   980             break;
       
   981             }
       
   982         }
       
   983 
       
   984     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReadTextL8" ) ) );
       
   985     }
       
   986 
       
   987 
       
   988 
       
   989 // ---------------------------------------------------------
       
   990 // CApAccessPointItem::ReadTextL
       
   991 // ---------------------------------------------------------
       
   992 //
       
   993 EXPORT_C void CApAccessPointItem::ReadTextL( const TApMember aColumn,
       
   994                                            TDes16& aValue )
       
   995     {
       
   996     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReadTextL" ) ) );
       
   997 
       
   998     LeaveIfUnsupportedL( aColumn );
       
   999 
       
  1000     switch ( aColumn )
       
  1001         {
       
  1002         case EApWapAccessPointName:
       
  1003             {
       
  1004             aValue.SetLength( iWapAccessPointName->Length() );
       
  1005             aValue.Format( KFormat, iWapAccessPointName );
       
  1006             break;
       
  1007             }
       
  1008         case EApWapCurrentBearer:
       
  1009             {
       
  1010             // make it large enough to hold
       
  1011             aValue.SetLength( iWapBearer->Length() );
       
  1012             aValue.Format( KFormat, iWapBearer );
       
  1013             break;
       
  1014             }
       
  1015         case EApWapGatewayAddress:
       
  1016             {
       
  1017             // make it large enough to hold
       
  1018             aValue.SetLength( iWapGatewayAddress->Length() );
       
  1019             aValue.Format( KFormat, iWapGatewayAddress );
       
  1020             break;
       
  1021             }
       
  1022         case EApIapName:
       
  1023             {
       
  1024             // make it large enough to hold
       
  1025             aValue.SetLength( iIapName->Length() );
       
  1026             aValue.Format( KFormat, iIapName );
       
  1027             break;
       
  1028             }
       
  1029         case EApIapServiceType:
       
  1030             {
       
  1031             // make it large enough to hold
       
  1032             aValue.SetLength( iIapServiceType->Length() );
       
  1033             aValue.Format( KFormat, iIapServiceType );
       
  1034             break;
       
  1035             }
       
  1036         case EApIspName:
       
  1037             {
       
  1038             // make it large enough to hold
       
  1039             aValue.SetLength( iIspName->Length() );
       
  1040             aValue.Format( KFormat, iIspName );
       
  1041             break;
       
  1042             }
       
  1043         case EApIspDescription:
       
  1044             {
       
  1045             // make it large enough to hold
       
  1046             aValue.SetLength( iIspDescription->Length() );
       
  1047             aValue.Format( KFormat, iIspDescription );
       
  1048             break;
       
  1049             }
       
  1050         case EApIspDefaultTelNumber:
       
  1051             {
       
  1052             // make it large enough to hold
       
  1053             aValue.SetLength( iIspDefaultTelNumber->Length() );
       
  1054             aValue.Format( KFormat, iIspDefaultTelNumber );
       
  1055             break;
       
  1056             }
       
  1057         case EApIspLoginName:
       
  1058             {
       
  1059             // make it large enough to hold
       
  1060             aValue.SetLength( iUserName->Length() );
       
  1061             aValue.Format( KFormat, iUserName );
       
  1062             break;
       
  1063             }
       
  1064         case EApIspLoginPass:
       
  1065             {
       
  1066             // make it large enough to hold
       
  1067             aValue.SetLength( iPassword->Length() );
       
  1068             aValue.Format( KFormat, iPassword );
       
  1069             break;
       
  1070             }
       
  1071         case EApIspIfName:
       
  1072         case EApGprsIfName:
       
  1073         case EApCdmaIfName:
       
  1074             {
       
  1075             // make it large enough to hold
       
  1076             aValue.SetLength( iIspIfName->Length() );
       
  1077             aValue.Format( KFormat, iIspIfName );
       
  1078             break;
       
  1079             }
       
  1080         case EApIspIfParams:
       
  1081         case EApGprsIfParams:
       
  1082         case EApCdmaIfParams:
       
  1083             {
       
  1084             // make it large enough to hold
       
  1085             aValue.SetLength( iIspIfParams->Length() );
       
  1086             aValue.Format( KFormat, iIspIfParams );
       
  1087             break;
       
  1088             }
       
  1089         case EApIspIfNetworks:
       
  1090         case EApGprsIfNetworks:
       
  1091         case EApCdmaIfNetworks:
       
  1092         case EApWlanIfNetworks:
       
  1093             {
       
  1094             // make it large enough to hold
       
  1095             aValue.SetLength( iIspIfNetworks->Length() );
       
  1096             aValue.Format( KFormat, iIspIfNetworks );
       
  1097             break;
       
  1098             }
       
  1099         case EApIspIfAuthName:
       
  1100         case EApGprsIfAuthName:
       
  1101         case EApCdmaIfAuthName:
       
  1102         case EApWlanIfAuthName:
       
  1103             {
       
  1104             // make it large enough to hold
       
  1105             aValue.SetLength( iIspIfAuthName->Length() );
       
  1106             aValue.Format( KFormat, iIspIfAuthName );
       
  1107             break;
       
  1108             }
       
  1109         case EApIspIfAuthPass:
       
  1110         case EApGprsIfAuthPassword:
       
  1111         case EApCdmaIfAuthPassword:
       
  1112         case EApWlanIfAuthPassword:
       
  1113             {
       
  1114             // make it large enough to hold
       
  1115             aValue.SetLength( iIspIfAuthPass->Length() );
       
  1116             aValue.Format( KFormat, iIspIfAuthPass );
       
  1117             break;
       
  1118             }
       
  1119         case EApIspIPAddr:
       
  1120         case EApGprsIpAddr:
       
  1121         case EApCdmaIpAddr:
       
  1122         case EApWlanIpAddr:
       
  1123             {
       
  1124             // make it large enough to hold
       
  1125             aValue.SetLength( iIspIPAddr->Length() );
       
  1126             aValue.Format( KFormat, iIspIPAddr );
       
  1127             break;
       
  1128             }
       
  1129         case EApIspIPNetMask:
       
  1130         case EApGprsIpNetMask:
       
  1131         case EApCdmaIpNetMask:
       
  1132         case EApWlanIpNetMask:
       
  1133             {
       
  1134             // make it large enough to hold
       
  1135             aValue.SetLength( iIspIPNetMask->Length() );
       
  1136             aValue.Format( KFormat, iIspIPNetMask );
       
  1137             break;
       
  1138             }
       
  1139         case EApIspIPGateway:
       
  1140         case EApGprsIpGateway:
       
  1141         case EApCdmaIpGateway:
       
  1142         case EApWlanIpGateway:
       
  1143             {
       
  1144             // make it large enough to hold
       
  1145             aValue.SetLength( iIspGateway->Length() );
       
  1146             aValue.Format( KFormat, iIspGateway );
       
  1147             break;
       
  1148             }
       
  1149         case EApIspIPNameServer1:
       
  1150         case EApGprsIPNameServer1:
       
  1151         case EApCdmaIPNameServer1:
       
  1152         case EApWlanIPNameServer1:
       
  1153             {
       
  1154             // make it large enough to hold
       
  1155             aValue.SetLength( iPrimaryDNS->Length() );
       
  1156             aValue.Format( KFormat, iPrimaryDNS );
       
  1157             break;
       
  1158             }
       
  1159         case EApIspIPNameServer2:
       
  1160         case EApGprsIPNameServer2:
       
  1161         case EApCdmaIPNameServer2:
       
  1162         case EApWlanIPNameServer2:
       
  1163             {
       
  1164             // make it large enough to hold
       
  1165             aValue.SetLength( iSecondaryDNS->Length() );
       
  1166             aValue.Format( KFormat, iSecondaryDNS );
       
  1167             break;
       
  1168             }
       
  1169         case EApGprsPdpAddress:
       
  1170             {
       
  1171             // make it large enough to hold
       
  1172             aValue.SetLength( iGprsPdpAddress->Length() );
       
  1173             aValue.Format( KFormat, iGprsPdpAddress );
       
  1174             break;
       
  1175             }
       
  1176         case EApProxyProtocolName:
       
  1177             {
       
  1178             aValue.SetLength( iApProxyProtocolName->Length() );
       
  1179             aValue.Format( KFormat, iApProxyProtocolName );
       
  1180             break;
       
  1181             }
       
  1182         case EApProxyLoginName:
       
  1183             {
       
  1184             aValue.SetLength( iWapProxyLoginName->Length() );
       
  1185             aValue.Format( KFormat, iWapProxyLoginName );
       
  1186             break;
       
  1187             }
       
  1188         case EApProxyLoginPass:
       
  1189             {
       
  1190             aValue.SetLength( iWapProxyLoginPass->Length() );
       
  1191             aValue.Format( KFormat, iWapProxyLoginPass );
       
  1192             break;
       
  1193             }
       
  1194         case EApNetworkName:
       
  1195             {
       
  1196             aValue.SetLength( iNetworkName->Length() );
       
  1197             aValue.Format( KFormat, iNetworkName );
       
  1198             break;
       
  1199             }
       
  1200         case EApIP6NameServer1:
       
  1201             {
       
  1202             // make it large enough to hold
       
  1203             if ( iExt->iIsIpv6Supported )
       
  1204                 {
       
  1205                 aValue.SetLength( iExt->iIpv6PrimaryDNS->Length() );
       
  1206                 aValue.Format( KFormat, iExt->iIpv6PrimaryDNS );
       
  1207                 }
       
  1208             else
       
  1209                 {
       
  1210                 User::Leave( KErrNotSupported );
       
  1211                 }
       
  1212             break;
       
  1213             }
       
  1214         case EApIP6NameServer2:
       
  1215             {
       
  1216             // make it large enough to hold
       
  1217             if ( iExt->iIsIpv6Supported )
       
  1218                 {
       
  1219                 aValue.SetLength( iExt->iIpv6SecondaryDNS->Length() );
       
  1220                 aValue.Format( KFormat, iExt->iIpv6SecondaryDNS );
       
  1221                 }
       
  1222             else
       
  1223                 {
       
  1224                 User::Leave( KErrNotSupported );
       
  1225                 }
       
  1226             break;
       
  1227             }
       
  1228         // CDMA2000
       
  1229         case EApCdmaIwfName:
       
  1230             {
       
  1231             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1232             __ASSERT_ALWAYS \
       
  1233                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1234             aValue.SetLength( iExt->iCdmaData->iIwfName->Length() );
       
  1235             aValue.Format( KFormat, iExt->iCdmaData->iIwfName );
       
  1236             break;
       
  1237             }
       
  1238         case EApCdmaPdpAddress:
       
  1239             {
       
  1240             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1241             __ASSERT_ALWAYS \
       
  1242                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1243             aValue.SetLength( iExt->iCdmaData->iPdpAddress->Length() );
       
  1244             aValue.Format( KFormat, iExt->iCdmaData->iPdpAddress );
       
  1245             break;
       
  1246             }
       
  1247         case EApCdmaHomeAgentAddress:
       
  1248             {
       
  1249             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1250             __ASSERT_ALWAYS \
       
  1251                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1252             aValue.SetLength( iExt->iCdmaData->iHomeAgentAddress->Length() );
       
  1253             aValue.Format( KFormat, iExt->iCdmaData->iHomeAgentAddress );
       
  1254             break;
       
  1255             }
       
  1256         case EApCdmaMipPrimaryHomeAgent:
       
  1257             {
       
  1258             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1259             __ASSERT_ALWAYS \
       
  1260                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1261             aValue.SetLength
       
  1262                 ( iExt->iCdmaData->iMipPrimaryHomeAgent->Length() );
       
  1263             aValue.Format
       
  1264                 ( KFormat, iExt->iCdmaData->iMipPrimaryHomeAgent );
       
  1265             break;
       
  1266             }
       
  1267         case EApCdmaMipSecondaryHomeAgent:
       
  1268             {
       
  1269             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1270             __ASSERT_ALWAYS \
       
  1271                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1272             aValue.SetLength
       
  1273                 ( iExt->iCdmaData->iMipSecondaryHomeAgent->Length() );
       
  1274             aValue.Format
       
  1275                 ( KFormat, iExt->iCdmaData->iMipSecondaryHomeAgent );
       
  1276             break;
       
  1277             }
       
  1278         // END CDMA2000
       
  1279         // WLAN
       
  1280         case EApWlanNetworkName:
       
  1281             {
       
  1282             // LeaveIfUnsupported prevents getting here with no WLAN support.
       
  1283             __ASSERT_ALWAYS \
       
  1284                 ( iExt->iWlanData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1285             aValue.SetLength
       
  1286                 ( iExt->iWlanData->iWlanNetworkName->Length() );
       
  1287             aValue.Format
       
  1288                 ( KFormat, iExt->iWlanData->iWlanNetworkName );
       
  1289             break;
       
  1290             }
       
  1291         // END WLAN
       
  1292         // LANModem
       
  1293         case EApLanBearerName:
       
  1294             {
       
  1295             aValue.SetLength( iExt->iLanBearerModemName->Length() );
       
  1296             aValue.Format( KFormat, iExt->iLanBearerModemName );            
       
  1297             break;
       
  1298             }
       
  1299         // END LANModem
       
  1300         case EApIapBearerType:
       
  1301             {
       
  1302             aValue.SetLength( iExt->iIapBearerType->Length() );
       
  1303             aValue.Format( KFormat, iExt->iIapBearerType );            
       
  1304             break;
       
  1305             }
       
  1306         default:
       
  1307             {
       
  1308             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  1309             User::Leave( KErrInvalidColumn );
       
  1310             }
       
  1311         }
       
  1312 
       
  1313     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReadTextL" ) ) );
       
  1314     }
       
  1315 
       
  1316 
       
  1317 // ---------------------------------------------------------
       
  1318 // CApAccessPointItem::ReadLongTextL
       
  1319 // ---------------------------------------------------------
       
  1320 //
       
  1321 EXPORT_C HBufC* CApAccessPointItem::ReadLongTextL( const TApMember aColumn )
       
  1322     {
       
  1323     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReadLongTextL" ) ) );
       
  1324 
       
  1325     LeaveIfUnsupportedL( aColumn );
       
  1326 
       
  1327     HBufC* retval = NULL;
       
  1328     switch ( aColumn )
       
  1329         {
       
  1330         case EApWapStartPage:
       
  1331             {
       
  1332             retval = iStartingPage;
       
  1333             break;
       
  1334             }
       
  1335         case EApIspLoginScript:
       
  1336             {
       
  1337             retval = iLoginScript;
       
  1338             break;
       
  1339             }
       
  1340         case EApGprsAccessPointName:
       
  1341             {
       
  1342             retval = iGprsAccessPointName;
       
  1343             break;
       
  1344             }
       
  1345         case EApProxyServerAddress:
       
  1346             {
       
  1347             retval = iApProxyServerAddress;
       
  1348             break;
       
  1349             }
       
  1350         case EApProxyExceptions:
       
  1351             {
       
  1352             retval = iApProxyExceptions;
       
  1353             break;
       
  1354             }
       
  1355         default:
       
  1356             {
       
  1357             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  1358             User::Leave( KErrInvalidColumn );
       
  1359             break;
       
  1360             }
       
  1361         }
       
  1362 
       
  1363     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReadLongTextL" ) ) );
       
  1364     return retval;
       
  1365     }
       
  1366 
       
  1367 
       
  1368 
       
  1369 
       
  1370 // ---------------------------------------------------------
       
  1371 // CApAccessPointItem::ReadConstLongTextL
       
  1372 // ---------------------------------------------------------
       
  1373 //
       
  1374 EXPORT_C const HBufC* CApAccessPointItem::ReadConstLongTextL
       
  1375                                             ( const TApMember aColumn )
       
  1376     {
       
  1377     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReadConstLongTextL" ) ) );
       
  1378 
       
  1379     LeaveIfUnsupportedL( aColumn );
       
  1380 
       
  1381     HBufC* retval = NULL;
       
  1382     switch ( aColumn )
       
  1383         {
       
  1384         case EApWapStartPage:
       
  1385             {
       
  1386             retval = iStartingPage;
       
  1387             break;
       
  1388             }
       
  1389         case EApIspLoginScript:
       
  1390             {
       
  1391             retval = iLoginScript;
       
  1392             break;
       
  1393             }
       
  1394         case EApGprsAccessPointName:
       
  1395             {
       
  1396             retval = iGprsAccessPointName;
       
  1397             break;
       
  1398             }
       
  1399         case EApProxyServerAddress:
       
  1400             {
       
  1401             retval = iApProxyServerAddress;
       
  1402             break;
       
  1403             }
       
  1404         case EApProxyExceptions:
       
  1405             {
       
  1406             retval = iApProxyExceptions;
       
  1407             break;
       
  1408             }
       
  1409         default:
       
  1410             {
       
  1411             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  1412             User::Leave( KErrInvalidColumn );
       
  1413             break;
       
  1414             }
       
  1415         }
       
  1416     
       
  1417     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReadConstLongTextL" ) ) );
       
  1418     return retval;
       
  1419     }
       
  1420 
       
  1421 
       
  1422 // ---------------------------------------------------------
       
  1423 // CApAccessPointItem::ReadTextLengthL
       
  1424 // ---------------------------------------------------------
       
  1425 //
       
  1426 EXPORT_C TUint32 CApAccessPointItem::ReadTextLengthL( const TApMember aColumn )
       
  1427     {
       
  1428     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReadTextLengthL" ) ) );
       
  1429 
       
  1430     LeaveIfUnsupportedL( aColumn );
       
  1431 
       
  1432     TUint32 l( 0 );
       
  1433     switch ( aColumn )
       
  1434         { // 16 first
       
  1435         case EApWapAccessPointName:
       
  1436             {
       
  1437             l = iWapAccessPointName->Length();
       
  1438             break;
       
  1439             }
       
  1440         case EApWapStartPage:
       
  1441             {
       
  1442             l = iStartingPage->Length();
       
  1443             break;
       
  1444             }
       
  1445         case EApWapCurrentBearer:
       
  1446             {
       
  1447             l = iWapBearer->Length();
       
  1448             break;
       
  1449             }
       
  1450         case EApWapGatewayAddress:
       
  1451             {
       
  1452             l = iWapGatewayAddress->Length();
       
  1453             break;
       
  1454             }
       
  1455         case EApIapName:
       
  1456             {
       
  1457             l = iIapName->Length();
       
  1458             break;
       
  1459             }
       
  1460         case EApIapServiceType:
       
  1461             {
       
  1462             l = iIapServiceType->Length();
       
  1463             break;
       
  1464             }
       
  1465         case EApIspName:
       
  1466             {
       
  1467             l = iIspName->Length();
       
  1468             break;
       
  1469             }
       
  1470         case EApIspDescription:
       
  1471             {
       
  1472             l = iIspDescription->Length();
       
  1473             break;
       
  1474             }
       
  1475         case EApIspDefaultTelNumber:
       
  1476             {
       
  1477             l = iIspDefaultTelNumber->Length();
       
  1478             break;
       
  1479             }
       
  1480         case EApIspLoginName:
       
  1481             {
       
  1482             l = iUserName->Length();
       
  1483             break;
       
  1484             }
       
  1485         case EApIspLoginPass:
       
  1486             {
       
  1487             l = iPassword->Length();
       
  1488             break;
       
  1489             }
       
  1490         case EApIspIfName:
       
  1491         case EApGprsIfName:
       
  1492         case EApCdmaIfName:
       
  1493             {
       
  1494             l = iIspIfName->Length();
       
  1495             break;
       
  1496             }
       
  1497         case EApIspIfParams:
       
  1498         case EApGprsIfParams:
       
  1499         case EApCdmaIfParams:
       
  1500             {
       
  1501             l = iIspIfParams->Length();
       
  1502             break;
       
  1503             }
       
  1504         case EApIspIfNetworks:
       
  1505         case EApGprsIfNetworks:
       
  1506         case EApCdmaIfNetworks:
       
  1507         case EApWlanIfNetworks:
       
  1508             {
       
  1509             l = iIspIfNetworks->Length();
       
  1510             break;
       
  1511             }
       
  1512         case EApIspIfAuthName:
       
  1513         case EApGprsIfAuthName:
       
  1514         case EApCdmaIfAuthName:
       
  1515         case EApWlanIfAuthName:
       
  1516             {
       
  1517             l = iIspIfAuthName->Length();
       
  1518             break;
       
  1519             }
       
  1520         case EApIspIfAuthPass:
       
  1521         case EApGprsIfAuthPassword:
       
  1522         case EApCdmaIfAuthPassword:
       
  1523         case EApWlanIfAuthPassword:
       
  1524             {
       
  1525             l = iIspIfAuthPass->Length();
       
  1526             break;
       
  1527             }
       
  1528         case EApIspIPAddr:
       
  1529         case EApGprsIpAddr:
       
  1530         case EApCdmaIpAddr:
       
  1531         case EApWlanIpAddr:
       
  1532             {
       
  1533             l = iIspIPAddr->Length();
       
  1534             break;
       
  1535             }
       
  1536         case EApIspIPNetMask:
       
  1537         case EApGprsIpNetMask:
       
  1538         case EApCdmaIpNetMask:
       
  1539         case EApWlanIpNetMask:
       
  1540             {
       
  1541             l = iIspIPNetMask->Length();
       
  1542             break;
       
  1543             }
       
  1544         case EApIspIPGateway:
       
  1545         case EApGprsIpGateway:
       
  1546         case EApCdmaIpGateway:
       
  1547         case EApWlanIpGateway:
       
  1548             {
       
  1549             l = iIspGateway->Length();
       
  1550             break;
       
  1551             }
       
  1552         case EApIspIPNameServer1:
       
  1553         case EApGprsIPNameServer1:
       
  1554         case EApCdmaIPNameServer1:
       
  1555         case EApWlanIPNameServer1:
       
  1556             {
       
  1557             l = iPrimaryDNS->Length();
       
  1558             break;
       
  1559             }
       
  1560         case EApIspIPNameServer2:
       
  1561         case EApGprsIPNameServer2:
       
  1562         case EApCdmaIPNameServer2:
       
  1563         case EApWlanIPNameServer2:
       
  1564             {
       
  1565             l = iSecondaryDNS->Length();
       
  1566             break;
       
  1567             }
       
  1568         case EApGprsAccessPointName:
       
  1569             {
       
  1570             l = iGprsAccessPointName->Length();
       
  1571             break;
       
  1572             }
       
  1573         case EApGprsPdpAddress:
       
  1574             {
       
  1575             l = iGprsPdpAddress->Length();
       
  1576             break;
       
  1577             }
       
  1578         // 8 bit ones
       
  1579         case EApIspIfCallbackInfo:
       
  1580             {
       
  1581             l = iIspIfCallbackInfo->Length();
       
  1582             break;
       
  1583             }
       
  1584         case EApIspInitString:
       
  1585             {
       
  1586             l = iIspInitString->Length();
       
  1587             break;
       
  1588             }
       
  1589         // Login script
       
  1590         case EApIspLoginScript:
       
  1591             {
       
  1592             l = iLoginScript->Length();
       
  1593             break;
       
  1594             }
       
  1595         case EApProxyProtocolName:
       
  1596             {
       
  1597             l = iApProxyProtocolName->Length();
       
  1598             break;
       
  1599             }
       
  1600         case EApProxyServerAddress:
       
  1601             {
       
  1602             l = iApProxyServerAddress->Length();
       
  1603             break;
       
  1604             }
       
  1605         case EApProxyExceptions:
       
  1606             {
       
  1607             l = iApProxyExceptions->Length();
       
  1608             break;
       
  1609             }
       
  1610         case EApProxyLoginName:
       
  1611             {
       
  1612             l = iWapProxyLoginName->Length();
       
  1613             break;
       
  1614             }
       
  1615         case EApProxyLoginPass:
       
  1616             {
       
  1617             l = iWapProxyLoginPass->Length();
       
  1618             break;
       
  1619             }
       
  1620         case EApNetworkName:
       
  1621             {
       
  1622             l = iNetworkName->Length();
       
  1623             break;
       
  1624             }
       
  1625         case EApIP6NameServer1:
       
  1626             {
       
  1627             if ( iExt->iIsIpv6Supported )
       
  1628                 {
       
  1629                 l = iExt->iIpv6PrimaryDNS->Length();
       
  1630                 }
       
  1631             else
       
  1632                 {
       
  1633                 User::Leave( KErrNotSupported );
       
  1634                 }
       
  1635             break;
       
  1636             }
       
  1637         case EApIP6NameServer2:
       
  1638             {
       
  1639             if ( iExt->iIsIpv6Supported )
       
  1640                 {
       
  1641                 l = iExt->iIpv6SecondaryDNS->Length();
       
  1642                 }
       
  1643             else
       
  1644                 {
       
  1645                 User::Leave( KErrNotSupported );
       
  1646                 }
       
  1647             break;
       
  1648             }
       
  1649         // CDMA2000
       
  1650         case EApCdmaIwfName:
       
  1651             {
       
  1652             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1653             __ASSERT_ALWAYS \
       
  1654                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1655             l = iExt->iCdmaData->iIwfName->Length();
       
  1656             break;
       
  1657             }
       
  1658         case EApCdmaPdpAddress:
       
  1659             {
       
  1660             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1661             __ASSERT_ALWAYS \
       
  1662                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1663             l = iExt->iCdmaData->iPdpAddress->Length();
       
  1664             break;
       
  1665             }
       
  1666         case EApCdmaHomeAgentAddress:
       
  1667             {
       
  1668             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1669             __ASSERT_ALWAYS \
       
  1670                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1671             l = iExt->iCdmaData->iHomeAgentAddress->Length();
       
  1672             break;
       
  1673             }
       
  1674         case EApCdmaMipPrimaryHomeAgent:
       
  1675             {
       
  1676             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1677             __ASSERT_ALWAYS \
       
  1678                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1679             l = iExt->iCdmaData->iMipPrimaryHomeAgent->Length();
       
  1680             break;
       
  1681             }
       
  1682         case EApCdmaMipSecondaryHomeAgent:
       
  1683             {
       
  1684             // LeaveIfUnsupported prevents getting here with no CDMA support.
       
  1685             __ASSERT_ALWAYS \
       
  1686                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1687             l = iExt->iCdmaData->iMipSecondaryHomeAgent->Length();
       
  1688             break;
       
  1689             }
       
  1690         // END CDMA2000
       
  1691         // WLAN
       
  1692         case EApWlanNetworkName:
       
  1693             {
       
  1694             // LeaveIfUnsupported prevents getting here with no WLAN support.
       
  1695             __ASSERT_ALWAYS \
       
  1696                 ( iExt->iWlanData, ApCommons::Panic( ESanityCheckFailed ) );
       
  1697             l = iExt->iWlanData->iWlanNetworkName->Length();
       
  1698             break;
       
  1699             }
       
  1700         // END WLAN
       
  1701         default:
       
  1702             {
       
  1703             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  1704             User::Leave( KErrInvalidColumn );
       
  1705             }
       
  1706         }
       
  1707 
       
  1708     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReadTextLengthL" ) ) );
       
  1709     return l;
       
  1710     }
       
  1711 
       
  1712 
       
  1713 // ---------------------------------------------------------
       
  1714 // CApAccessPointItem::ReadUint
       
  1715 // ---------------------------------------------------------
       
  1716 //
       
  1717 EXPORT_C TInt CApAccessPointItem::ReadUint( const TApMember aColumn,
       
  1718                                            TUint32& aValue )
       
  1719     {
       
  1720     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReadUint" ) ) );
       
  1721 
       
  1722     TInt retval ( KErrNone );
       
  1723 
       
  1724     if( !IsSupported( aColumn ) )
       
  1725         {
       
  1726         retval = KErrNotSupported;
       
  1727         }
       
  1728     else
       
  1729         {
       
  1730         switch ( aColumn )
       
  1731             {
       
  1732             case EApWapAccessPointID:
       
  1733                 {
       
  1734                 aValue = iWapUid;
       
  1735                 break;
       
  1736                 }
       
  1737             case EApWapIap:
       
  1738                 {
       
  1739                 aValue = iWapIap;
       
  1740                 break;
       
  1741                 }
       
  1742             case EApIapServiceId:
       
  1743                 {
       
  1744                 aValue = iIapServiceId;
       
  1745                 break;
       
  1746                 }
       
  1747             case EApIapChargecard:
       
  1748                 {
       
  1749                 aValue = iIapChargeCardId;
       
  1750                 break;
       
  1751                 }
       
  1752             case EApIspIspType:
       
  1753             case EApCdmaApType:
       
  1754                 {
       
  1755                 aValue = iIspType;
       
  1756                 break;
       
  1757                 }
       
  1758             case EApIspAuthRetries:
       
  1759             case EApGprsIfAuthRetries:
       
  1760             case EApCdmaIfAuthRetries:
       
  1761             case EApWlanIfAuthRetries:
       
  1762                 {
       
  1763                 aValue = iIspIfAuthRetries;
       
  1764                 break;
       
  1765                 }
       
  1766             case EApIspIfCallbackType:
       
  1767                 {
       
  1768                 aValue = iCallBackTypeIsServerNum;
       
  1769                 break;
       
  1770                 }
       
  1771             case EApIspCallBackTimeOut:
       
  1772                 {
       
  1773                 aValue = iIspCallbackTimeOut;
       
  1774                 break;
       
  1775                 }
       
  1776             case EApIspBearerName:
       
  1777                 {
       
  1778                 aValue = iIspBearerName;
       
  1779                 break;
       
  1780                 }
       
  1781             case EApIspBearerSpeed:
       
  1782                 {
       
  1783                 aValue = iMaxConnSpeed;
       
  1784                 break;
       
  1785                 }
       
  1786             case EApIspBearerCE:
       
  1787                 {
       
  1788                 aValue = iIspBearerCE;
       
  1789                 break;
       
  1790                 }
       
  1791             case EApIspBearerCallTypeIsdn:
       
  1792                 {
       
  1793                 aValue = iBearerCallTypeIsdn;
       
  1794                 break;
       
  1795                 }
       
  1796             case EApIspBearerType:
       
  1797                 {
       
  1798                 aValue = iIspBearerType;
       
  1799                 break;
       
  1800                 }
       
  1801             case EApIspChannelCoding:
       
  1802                 {
       
  1803                 aValue = iIspChannelCoding;
       
  1804                 break;
       
  1805                 }
       
  1806             case EApIspAIUR:
       
  1807                 {
       
  1808                 aValue = iIspAIUR;
       
  1809                 break;
       
  1810                 }
       
  1811             case EApIspRequestedTimeSlots:
       
  1812                 {
       
  1813                 aValue = iIspRequestedTimeSlots;
       
  1814                 break;
       
  1815                 }
       
  1816             case EApIspMaximumTimeSlots:
       
  1817                 {
       
  1818                 aValue = iIspMaximumTimeSlots;
       
  1819                 break;
       
  1820                 }
       
  1821             case EApGprsPdpType:
       
  1822                 {
       
  1823                 aValue = iGprsPdpType;
       
  1824                 break;
       
  1825                 }
       
  1826             case EApGprsReqPrecedence:
       
  1827                 {
       
  1828                 aValue = iGprsReqPrecedence;
       
  1829                 break;
       
  1830                 }
       
  1831             case EApGprsReqDelay:
       
  1832                 {
       
  1833                 aValue = iGprsReqDelay;
       
  1834                 break;
       
  1835                 }
       
  1836             case EApGprsReqReliability:
       
  1837                 {
       
  1838                 aValue = iGprsReqReliability;
       
  1839                 break;
       
  1840                 }
       
  1841             case EApGprsReqPeakThroughput:
       
  1842                 {
       
  1843                 aValue = iGprsReqPeakThroughput;
       
  1844                 break;
       
  1845                 }
       
  1846             case EApGprsReqMeanPeakThroughput:
       
  1847                 {
       
  1848                 aValue = iGprsReqMeanPeakThroughput;
       
  1849                 break;
       
  1850                 }
       
  1851             case EApGprsMinPrecedence:
       
  1852                 {
       
  1853                 aValue = iGprsMinPrecedence;
       
  1854                 break;
       
  1855                 }
       
  1856             case EApGprsMinDelay:
       
  1857                 {
       
  1858                 aValue = iGprsMinDelay;
       
  1859                 break;
       
  1860                 }
       
  1861             case EApGprsMinReliability:
       
  1862                 {
       
  1863                 aValue = iGprsMinReliability;
       
  1864                 break;
       
  1865                 }
       
  1866             case EApGprsMinPeakThroughput:
       
  1867                 {
       
  1868                 aValue = iGprsMinPeakThroughput;
       
  1869                 break;
       
  1870                 }
       
  1871             case EApGprsMinMeanThroughput:
       
  1872                 {
       
  1873                 aValue = iGprsMinMeanThroughput;
       
  1874                 break;
       
  1875                 }
       
  1876             case EApWapWspOption:
       
  1877                 {
       
  1878                 aValue = iIsConnectionTypeContinuous;
       
  1879                 break;
       
  1880                 }
       
  1881             case EApProxyPortNumber:
       
  1882                 {
       
  1883                 aValue = iApProxyPortNumber;
       
  1884                 break;
       
  1885                 }
       
  1886             case EApWapProxyPort:
       
  1887                 {
       
  1888                 aValue = iWapProxyPort;
       
  1889                 break;
       
  1890                 }
       
  1891             case EApNetworkID:
       
  1892                 {
       
  1893                 aValue = iNetworkId;
       
  1894                 break;
       
  1895                 }
       
  1896             case EApIapBearerService:
       
  1897                 {
       
  1898                 aValue = iApIapBearerService;
       
  1899                 break;
       
  1900                 }
       
  1901 
       
  1902     //* DEPRECATED !!!
       
  1903             case EApWapIsp:
       
  1904             case EApWapChargecard:
       
  1905             case EApWapIspType:
       
  1906                 {
       
  1907                 __ASSERT_DEBUG( EFalse, \
       
  1908                                 User::Panic( kApSet, KErrNotSupported ) );
       
  1909                 retval = KErrNotSupported;
       
  1910                 break;
       
  1911                 }
       
  1912     //* Deprecated ends
       
  1913             // CDMA2000
       
  1914             case EApCdmaServiceOption:
       
  1915                 {
       
  1916                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1917                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1918                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1919                 aValue = iExt->iCdmaData->iServiceOption;
       
  1920                 break;
       
  1921                 }
       
  1922             case EApCdmaPdpType:
       
  1923                 {
       
  1924                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1925                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1926                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1927                 aValue = iExt->iCdmaData->iPdpType;
       
  1928                 break;
       
  1929                 }
       
  1930             case EApCdmaReqFwdPriority:
       
  1931                 {
       
  1932                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1933                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1934                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1935                 aValue = iExt->iCdmaData->iReqFwdPriority;
       
  1936                 break;
       
  1937                 }
       
  1938             case EApCdmaReqRevPriority:
       
  1939                 {
       
  1940                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1941                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1942                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1943                 aValue = iExt->iCdmaData->iReqRevPriority;
       
  1944                 break;
       
  1945                 }
       
  1946             case EApCdmaReqFwdBitrate:
       
  1947                 {
       
  1948                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1949                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1950                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1951                 aValue = iExt->iCdmaData->iReqFwdBitrate;
       
  1952                 break;
       
  1953                 }
       
  1954             case EApCdmaReqRevBitrate:
       
  1955                 {
       
  1956                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1957                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1958                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1959                 aValue = iExt->iCdmaData->iReqRevBitrate;
       
  1960                 break;
       
  1961                 }
       
  1962             case EApCdmaReqFwdLoss:
       
  1963                 {
       
  1964                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1965                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1966                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1967                 aValue = iExt->iCdmaData->iReqFwdLoss;
       
  1968                 break;
       
  1969                 }
       
  1970             case EApCdmaReqRevLoss:
       
  1971                 {
       
  1972                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1973                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1974                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1975                 aValue = iExt->iCdmaData->iReqRevLoss;
       
  1976                 break;
       
  1977                 }
       
  1978             case EApCdmaReqFwdMaxDelay:
       
  1979                 {
       
  1980                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1981                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1982                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1983                 aValue = iExt->iCdmaData->iReqFwdMaxDelay;
       
  1984                 break;
       
  1985                 }
       
  1986             case EApCdmaReqRevMaxDelay:
       
  1987                 {
       
  1988                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1989                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1990                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1991                 aValue = iExt->iCdmaData->iReqRevMaxDelay;
       
  1992                 break;
       
  1993                 }
       
  1994             case EApCdmaMinFwdBitrate:
       
  1995                 {
       
  1996                 // IsSupported() check prevents getting here with no CDMA supp.
       
  1997                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  1998                     ApCommons::Panic( ESanityCheckFailed ) );
       
  1999                 aValue = iExt->iCdmaData->iMinFwdBitrate;
       
  2000                 break;
       
  2001                 }
       
  2002             case EApCdmaMinRevBitrate:
       
  2003                 {
       
  2004                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2005                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2006                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2007                 aValue = iExt->iCdmaData->iMinRevBitrate;
       
  2008                 break;
       
  2009                 }
       
  2010             case EApCdmaAccptFwdLoss:
       
  2011                 {
       
  2012                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2013                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2014                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2015                 aValue = iExt->iCdmaData->iAccptFwdLoss;
       
  2016                 break;
       
  2017                 }
       
  2018             case EApCdmaAccptRevLoss:
       
  2019                 {
       
  2020                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2021                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2022                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2023                 aValue = iExt->iCdmaData->iAccptRevLoss;
       
  2024                 break;
       
  2025                 }
       
  2026             case EApCdmaAccptFwdMaxDelay:
       
  2027                 {
       
  2028                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2029                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2030                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2031                 aValue = iExt->iCdmaData->iAccptFwdMaxDelay;
       
  2032                 break;
       
  2033                 }
       
  2034             case EApCdmaAccptRevMaxDelay:
       
  2035                 {
       
  2036                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2037                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2038                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2039                 aValue = iExt->iCdmaData->iAccptRevMaxDelay;
       
  2040                 break;
       
  2041                 }
       
  2042             case EApCdmaQosWarningTimeout:
       
  2043                 {
       
  2044                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2045                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2046                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2047                 aValue = iExt->iCdmaData->iQosWarningTimeout;
       
  2048                 break;
       
  2049                 }
       
  2050             case EApCdmaRlpMode:
       
  2051                 {
       
  2052                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2053                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2054                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2055                 aValue = iExt->iCdmaData->iRlpMode;
       
  2056                 break;
       
  2057                 }
       
  2058             case EApCdmaMipTimeout:
       
  2059                 {
       
  2060                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2061                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2062                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2063                 aValue = iExt->iCdmaData->iMipTimeout;
       
  2064                 break;
       
  2065                 }
       
  2066             case EApCdmaNaiType:
       
  2067                 {
       
  2068                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2069                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2070                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2071                 aValue = iExt->iCdmaData->iNaiType;
       
  2072                 break;
       
  2073                 }
       
  2074             case EApCdmaSimpleIpAuthAlgorithm:
       
  2075                 {
       
  2076                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2077                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2078                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2079                 aValue = iExt->iCdmaData->iSimpleIpAuthAlgorithm;
       
  2080                 break;
       
  2081                 }
       
  2082             case EApCdmaSimpleIpPapSsHandle:
       
  2083                 {
       
  2084                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2085                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2086                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2087                 aValue = iExt->iCdmaData->iSimpleIpPapSsHandle;
       
  2088                 break;
       
  2089                 }
       
  2090             case EApCdmaSimpleIpChapSsHandle:
       
  2091                 {
       
  2092                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2093                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2094                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2095                 aValue = iExt->iCdmaData->iSimpleIpChapSsHandle;
       
  2096                 break;
       
  2097                 }
       
  2098             case EApCdmaMipTBit:
       
  2099                 {
       
  2100                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2101                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2102                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2103                 aValue = iExt->iCdmaData->iMipTBit;
       
  2104                 break;
       
  2105                 }
       
  2106             case EApCdmaMipMnAaaAuthAlgorithm:
       
  2107                 {
       
  2108                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2109                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2110                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2111                 aValue = iExt->iCdmaData->iMipMnAaaAuthAlgorithm;
       
  2112                 break;
       
  2113                 }
       
  2114             case EApCdmaMipMnAaaSpi:
       
  2115                 {
       
  2116                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2117                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2118                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2119                 aValue = iExt->iCdmaData->iMipMnAaaSpi;
       
  2120                 break;
       
  2121                 }
       
  2122             case EApCdmaMipMnAaaSsHandle:
       
  2123                 {
       
  2124                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2125                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2126                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2127                 aValue = iExt->iCdmaData->iMipMnAaaSsHandle;
       
  2128                 break;
       
  2129                 }
       
  2130             case EApCdmaMipMnHaAuthAlgorithm:
       
  2131                 {
       
  2132                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2133                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2134                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2135                 aValue = iExt->iCdmaData->iMipMnHaAuthAlgorithm;
       
  2136                 break;
       
  2137                 }
       
  2138             case EApCdmaMipMnHaSpi:
       
  2139                 {
       
  2140                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2141                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2142                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2143                 aValue = iExt->iCdmaData->iMipMnHaSpi;
       
  2144                 break;
       
  2145                 }
       
  2146             case EApCdmaMipMnHaSsHandle:
       
  2147                 {
       
  2148                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2149                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2150                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2151                 aValue = iExt->iCdmaData->iMipMnHaSsHandle;
       
  2152                 break;
       
  2153                 }
       
  2154             // END CDMA2000
       
  2155             // WLAN
       
  2156             case EApWlanNetworkMode:
       
  2157                 {
       
  2158                 // IsSupported() check prevents getting here with no WLAN supp.
       
  2159                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  2160                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2161                 aValue = iExt->iWlanData->iWlanNetworkMode;
       
  2162                 break;
       
  2163                 }
       
  2164             case EApWlanSecurityMode:
       
  2165                 {
       
  2166                 // IsSupported() check prevents getting here with no WLAN supp.
       
  2167                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  2168                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2169                 aValue = iExt->iWlanData->iWlanSecurityMode;
       
  2170                 break;
       
  2171                 }
       
  2172             case EApWlanSettingsId:
       
  2173                 {
       
  2174                 // IsSupported() check prevents getting here with no WLAN supp.
       
  2175                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  2176                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2177                 aValue = iExt->iWlanData->iWlanId;
       
  2178                 break;
       
  2179                 }
       
  2180             case EApWlanChannelId:
       
  2181                 {
       
  2182                 // IsSupported() check prevents getting here with no WLAN supp.
       
  2183                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  2184                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2185                 aValue = iExt->iWlanData->iChannelId;
       
  2186                 break;                
       
  2187                 }
       
  2188             // END WLAN
       
  2189             // LANModem
       
  2190             case EApIapBearerID:
       
  2191                 {
       
  2192                 aValue = iExt->iIapBearerID;
       
  2193                 break;
       
  2194                 }
       
  2195             // END LANModem            
       
  2196             default :
       
  2197                 {
       
  2198                 __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  2199                 retval = KErrInvalidColumn;
       
  2200                 break;
       
  2201                 }
       
  2202             }
       
  2203         }
       
  2204 
       
  2205     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReadUint" ) ) );
       
  2206     return retval;
       
  2207     }
       
  2208 
       
  2209 
       
  2210 
       
  2211 // ---------------------------------------------------------
       
  2212 // CApAccessPointItem::ReadBool
       
  2213 // ---------------------------------------------------------
       
  2214 //
       
  2215 EXPORT_C TInt CApAccessPointItem::ReadBool( const TApMember aColumn,
       
  2216                                            TBool& aValue )
       
  2217     {
       
  2218     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReadBool" ) ) );
       
  2219     
       
  2220     TInt retval ( KErrNone );
       
  2221 
       
  2222     if( !IsSupported( aColumn ) )
       
  2223         {
       
  2224         retval = KErrNotSupported;
       
  2225         }
       
  2226     else
       
  2227         {
       
  2228         switch ( aColumn )
       
  2229             {
       
  2230             case EApWapSecurity:
       
  2231                 {
       
  2232                 aValue = iIsWTLSSecurityOn;
       
  2233                 break;
       
  2234                 }
       
  2235             case EApIspDialResolution:
       
  2236                 {
       
  2237                 aValue = iIspDialResolution;
       
  2238                 break;
       
  2239                 }
       
  2240             case EApIspUseLoginScript:
       
  2241                 {
       
  2242                 aValue = iUseLoginScript;
       
  2243                 break;
       
  2244                 }
       
  2245             case EApIspPromptForLogin:
       
  2246                 {
       
  2247                 aValue = iPromptPassword;
       
  2248                 break;
       
  2249                 }
       
  2250             case EApIspDisplayPCT:
       
  2251                 {
       
  2252                 aValue = iDisplayTerminalWindow;
       
  2253                 break;
       
  2254                 }
       
  2255             case EApIspIfPromptForAuth:
       
  2256             case EApGprsIfPromptForAuth:
       
  2257             case EApCdmaIfPromptForAuth:
       
  2258             case EApWlanIfPromptForAuth:
       
  2259                 {
       
  2260                 aValue = iIspIfPromptForAuth;
       
  2261                 break;
       
  2262                 }
       
  2263             case EApIspIfCallbackEnabled:
       
  2264                 {
       
  2265                 aValue = iUseCallBack;
       
  2266                 break;
       
  2267                 }
       
  2268             case EApIspIPAddrFromServer:
       
  2269             case EApGprsIpAddrFromServer:
       
  2270             case EApCdmaIpAddrFromServer:
       
  2271             case EApWlanIpAddrFromServer:
       
  2272                 {
       
  2273                 aValue = iIspIPAddrFromServer;
       
  2274                 break;
       
  2275                 }
       
  2276             case EApIspIPDnsAddrFromServer:
       
  2277             case EApGprsIpDnsAddrFromServer:
       
  2278             case EApCdmaIpDnsAddrFromServer:
       
  2279             case EApWlanIpDnsAddrFromServer:
       
  2280                 {
       
  2281                 aValue = iGetDNSIPFromServer;
       
  2282                 break;
       
  2283                 }
       
  2284             case EApIspEnableIpHeaderComp:
       
  2285             case EApGprsHeaderCompression:
       
  2286             case EApCdmaHeaderCompression:
       
  2287                 {
       
  2288                 aValue = iEnablePPPCompression;
       
  2289                 break;
       
  2290                 }
       
  2291             case EApIspEnableLCPExtensions:
       
  2292             case EApGprsEnableLCPExtensions:
       
  2293             case EApCdmaEnableLCPExtensions:
       
  2294                 {
       
  2295                 aValue = iIspEnableLCPExtensions;
       
  2296                 break;
       
  2297                 }
       
  2298             case EApIspDisablePlainTextAuth:
       
  2299             case EApGprsDisablePlainTextAuth:
       
  2300             case EApCdmaDisablePlainTextAuth:
       
  2301                 {
       
  2302                 aValue = iIsPasswordAuthenticationSecure;
       
  2303                 break;
       
  2304                 }
       
  2305             case EApIspEnableSWCompression:
       
  2306             case EApGprsDataCompression:
       
  2307             case EApCdmaDataCompression:
       
  2308                 {
       
  2309                 aValue = iIspEnableSwCompression;
       
  2310                 break;
       
  2311                 }
       
  2312 // NOTE! This has been deprecated.
       
  2313             case EApIspBearerCallTypeIsdn:
       
  2314                 {
       
  2315                 aValue = ( iBearerCallTypeIsdn != ECallTypeAnalogue );
       
  2316                 break;
       
  2317                 }
       
  2318             case EApGprsUseAnonymAccess:
       
  2319             case EApCdmaAnonymousAccess:
       
  2320                 {
       
  2321                 aValue = iGprsUseAnonymAccess;
       
  2322                 break;
       
  2323                 }
       
  2324             case EApIsReadOnly:
       
  2325                 {
       
  2326                 aValue = iIsReadOnly;
       
  2327                 break;
       
  2328                 }
       
  2329             case EApProxyUseProxy:
       
  2330                 {
       
  2331                 aValue = iApProxyUseProxy;
       
  2332                 break;
       
  2333                 }
       
  2334             case EApHasProxySettings:
       
  2335                 {
       
  2336                 aValue = iApHasProxySettings;
       
  2337                 break;
       
  2338                 }
       
  2339             case EApIP6DNSAddrFromServer:
       
  2340                 {
       
  2341                 if ( iExt->iIsIpv6Supported )
       
  2342                     {
       
  2343                     aValue = iExt->iIpv6GetDNSIPFromServer;
       
  2344                     }
       
  2345                 else
       
  2346                     {
       
  2347                     retval = KErrNotSupported;
       
  2348                     }
       
  2349                 break;
       
  2350                 }
       
  2351             // CDMA2000
       
  2352             case EApCdmaMip:
       
  2353                 {
       
  2354                 // IsSupported() check prevents getting here with no CDMA supp.
       
  2355                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2356                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2357                 aValue = iExt->iCdmaData->iMip;
       
  2358                 break;
       
  2359                 }
       
  2360             // END CDMA2000
       
  2361             // WLAN
       
  2362             case EApWlanScanSSID:
       
  2363                 {
       
  2364                 // IsSupported() check prevents getting here with no WLAN supp.
       
  2365                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  2366                     ApCommons::Panic( ESanityCheckFailed ) );                
       
  2367                 aValue = iExt->iWlanData->iScanSSID;
       
  2368                 break;
       
  2369                 }
       
  2370             // END WLAN
       
  2371             default :
       
  2372                 {
       
  2373                 __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  2374                 return KErrInvalidColumn;
       
  2375                 }
       
  2376             }
       
  2377         }
       
  2378 
       
  2379     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReadBool" ) ) );
       
  2380     return retval;
       
  2381     }
       
  2382 
       
  2383 
       
  2384 // Update
       
  2385 // ---------------------------------------------------------
       
  2386 // CApAccessPointItem::WriteTextL
       
  2387 // ---------------------------------------------------------
       
  2388 //
       
  2389 EXPORT_C TInt CApAccessPointItem::WriteTextL( const TApMember aColumn,
       
  2390                                             const TDesC8& aValue )
       
  2391     {
       
  2392     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::WriteTextL8" ) ) );
       
  2393 
       
  2394     LeaveIfUnsupportedL( aColumn );
       
  2395 
       
  2396     TInt ret = KErrNone;
       
  2397 
       
  2398     switch ( aColumn )
       
  2399         {
       
  2400         case EApIspIfCallbackInfo:
       
  2401             {
       
  2402             ReAllocL( iIspIfCallbackInfo, aValue );
       
  2403             break;
       
  2404             }
       
  2405         case EApIspInitString:
       
  2406             {
       
  2407             ReAllocL( iIspInitString, aValue );
       
  2408             break;
       
  2409             }
       
  2410         default:
       
  2411             {
       
  2412             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  2413             ret = KErrInvalidColumn;
       
  2414             break;
       
  2415             }
       
  2416         }
       
  2417 
       
  2418     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::WriteTextL8" ) ) );
       
  2419     return ret;
       
  2420     }
       
  2421 
       
  2422 
       
  2423 
       
  2424 // ---------------------------------------------------------
       
  2425 // CApAccessPointItem::WriteTextL
       
  2426 // ---------------------------------------------------------
       
  2427 //
       
  2428 EXPORT_C TInt CApAccessPointItem::WriteTextL( const TApMember aColumn,
       
  2429                                             const TDesC16& aValue )
       
  2430     {
       
  2431     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::WriteTextL" ) ) );
       
  2432 
       
  2433     LeaveIfUnsupportedL( aColumn );
       
  2434 
       
  2435     TInt retval( KErrNone );
       
  2436     switch ( aColumn )
       
  2437     {
       
  2438         case EApWapAccessPointName:
       
  2439             {
       
  2440             HBufC* sgd = aValue.AllocLC();
       
  2441             sgd->Des().Trim();
       
  2442             ReAllocL( iWapAccessPointName, *sgd);
       
  2443             CleanupStack::PopAndDestroy( sgd ); // sgd
       
  2444             break;
       
  2445             }
       
  2446         case EApWapCurrentBearer:
       
  2447             {
       
  2448             ReAllocL( iWapBearer, aValue);
       
  2449             break;
       
  2450             }
       
  2451         case EApWapGatewayAddress:
       
  2452             {
       
  2453             // this is an IP Address, must remove leading 0s from
       
  2454             // the numbers
       
  2455             HBufC *tmp = GetCleanIpAddressLC( aValue );
       
  2456             ReAllocL( iWapGatewayAddress, *tmp );
       
  2457             CleanupStack::PopAndDestroy( tmp );
       
  2458             break;
       
  2459             }
       
  2460         case EApIapName:
       
  2461             {
       
  2462             ReAllocL( iIapName, aValue);
       
  2463             break;
       
  2464             }
       
  2465         case EApIspName:
       
  2466             {
       
  2467             ReAllocL( iIspName, aValue);
       
  2468             break;
       
  2469             }
       
  2470         case EApIapServiceType:
       
  2471             {
       
  2472             ReAllocL( iIapServiceType, aValue);
       
  2473             //Check if ISP/GPRS has changed , update lfname &/or lfnetworks.!
       
  2474             if ( ( *iIapServiceType == TPtrC(DIAL_IN_ISP) ) ||
       
  2475                  ( *iIapServiceType == TPtrC(DIAL_OUT_ISP) ) )
       
  2476                 {
       
  2477                 WriteTextL( EApIspIfName, KDefIspIfName );
       
  2478                 }
       
  2479             else if ( ( *iIapServiceType == TPtrC(OUTGOING_GPRS) ) ||
       
  2480                      ( *iIapServiceType == TPtrC(INCOMING_GPRS) ) )
       
  2481                 {
       
  2482                 WriteTextL( EApIspIfName, KDefGprsIfName );
       
  2483                 }
       
  2484             else
       
  2485                 { // unknown ISP type, do not know what to write, 
       
  2486                 // simply ignore it....
       
  2487                 }
       
  2488             break;
       
  2489             }
       
  2490         case EApIspDescription:
       
  2491             {
       
  2492             ReAllocL( iIspDescription, aValue);
       
  2493             break;
       
  2494             }
       
  2495         case EApIspDefaultTelNumber:
       
  2496             {
       
  2497             ReAllocL( iIspDefaultTelNumber, aValue);
       
  2498             break;
       
  2499             }
       
  2500         case EApIspLoginName:
       
  2501             {
       
  2502             ReAllocL( iUserName, aValue);
       
  2503             ReAllocL( iIspIfAuthName, aValue);
       
  2504             break;
       
  2505             }
       
  2506         case EApIspLoginPass:
       
  2507             {
       
  2508             ReAllocL( iPassword, aValue);
       
  2509             ReAllocL( iIspIfAuthPass, aValue);
       
  2510             break;
       
  2511             }
       
  2512         case EApIspIfName:
       
  2513         case EApGprsIfName:
       
  2514         case EApCdmaIfName:
       
  2515             {
       
  2516             ReAllocL( iIspIfName, aValue);
       
  2517             break;
       
  2518             }
       
  2519         case EApIspIfParams:
       
  2520         case EApGprsIfParams:
       
  2521         case EApCdmaIfParams:
       
  2522             {
       
  2523             ReAllocL( iIspIfParams, aValue);
       
  2524             break;
       
  2525             }
       
  2526         case EApIspIfNetworks:
       
  2527         case EApGprsIfNetworks:
       
  2528         case EApCdmaIfNetworks:
       
  2529         case EApWlanIfNetworks:
       
  2530             {
       
  2531             ReAllocL( iIspIfNetworks, aValue); // CAN NOT BE CHANGED
       
  2532             break;
       
  2533             }
       
  2534         case EApIspIfAuthName:
       
  2535         case EApGprsIfAuthName:
       
  2536         case EApCdmaIfAuthName:
       
  2537         case EApWlanIfAuthName:
       
  2538             {
       
  2539             ReAllocL( iIspIfAuthName, aValue);
       
  2540             ReAllocL( iUserName, aValue);
       
  2541             break;
       
  2542             }
       
  2543         case EApIspIfAuthPass:
       
  2544         case EApGprsIfAuthPassword:
       
  2545         case EApCdmaIfAuthPassword:
       
  2546         case EApWlanIfAuthPassword:
       
  2547             {
       
  2548             ReAllocL( iIspIfAuthPass, aValue);
       
  2549             ReAllocL( iPassword, aValue);
       
  2550             break;
       
  2551             }
       
  2552         case EApIspIPAddr:
       
  2553         case EApGprsIpAddr:
       
  2554         case EApCdmaIpAddr:
       
  2555         case EApWlanIpAddr:
       
  2556             {
       
  2557             ReAllocL( iIspIPAddr, aValue);
       
  2558             SetIpFromServer();
       
  2559             break;
       
  2560             }
       
  2561         case EApIspIPNetMask:
       
  2562         case EApGprsIpNetMask:
       
  2563         case EApCdmaIpNetMask:
       
  2564         case EApWlanIpNetMask:
       
  2565             {
       
  2566             ReAllocL( iIspIPNetMask, aValue);
       
  2567             break;
       
  2568             }
       
  2569         case EApIspIPGateway:
       
  2570         case EApGprsIpGateway:
       
  2571         case EApCdmaIpGateway:
       
  2572         case EApWlanIpGateway:
       
  2573             {
       
  2574             ReAllocL( iIspGateway, aValue);
       
  2575             break;
       
  2576             }
       
  2577         case EApIspIPNameServer1:
       
  2578         case EApGprsIPNameServer1:
       
  2579         case EApCdmaIPNameServer1:
       
  2580         case EApWlanIPNameServer1:
       
  2581             {
       
  2582             ReAllocL( iPrimaryDNS, aValue);
       
  2583             SetDnsIpFromServer();
       
  2584             break;
       
  2585             }
       
  2586         case EApIspIPNameServer2:
       
  2587         case EApGprsIPNameServer2:
       
  2588         case EApCdmaIPNameServer2:
       
  2589         case EApWlanIPNameServer2:
       
  2590             {
       
  2591             ReAllocL( iSecondaryDNS, aValue);
       
  2592             SetDnsIpFromServer();
       
  2593             break;
       
  2594             }
       
  2595         case EApGprsPdpAddress:
       
  2596             {
       
  2597             ReAllocL( iGprsPdpAddress, aValue );
       
  2598             break;
       
  2599             }
       
  2600         case EApProxyProtocolName:
       
  2601             {
       
  2602             ReAllocL( iApProxyProtocolName, aValue );
       
  2603             SetProxyFlag();
       
  2604             break;
       
  2605             }
       
  2606         case EApNetworkName:
       
  2607             {
       
  2608             ReAllocL( iNetworkName, aValue );
       
  2609             break;
       
  2610             }
       
  2611         case EApProxyLoginName:
       
  2612             {
       
  2613             ReAllocL( iWapProxyLoginName, aValue );
       
  2614             break;
       
  2615             }
       
  2616         case EApProxyLoginPass:
       
  2617             {
       
  2618             ReAllocL( iWapProxyLoginPass, aValue );
       
  2619             break;
       
  2620             }
       
  2621         case EApIP6NameServer1:
       
  2622             {
       
  2623             if ( iExt->iIsIpv6Supported )
       
  2624                 {
       
  2625                 ReAllocL( iExt->iIpv6PrimaryDNS, aValue);
       
  2626                 SetDns6IpFromServer();
       
  2627                 }
       
  2628             else
       
  2629                 {
       
  2630                 User::Leave( KErrNotSupported );
       
  2631                 }
       
  2632             break;
       
  2633             }
       
  2634         case EApIP6NameServer2:
       
  2635             {
       
  2636             if ( iExt->iIsIpv6Supported )
       
  2637                 {
       
  2638                 ReAllocL( iExt->iIpv6SecondaryDNS, aValue);
       
  2639                 SetDns6IpFromServer();
       
  2640                 }
       
  2641             else
       
  2642                 {
       
  2643                 User::Leave( KErrNotSupported );
       
  2644                 }
       
  2645             break;
       
  2646             }
       
  2647         // CDMA2000
       
  2648         case EApCdmaIwfName:
       
  2649             {
       
  2650             __ASSERT_ALWAYS \
       
  2651                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  2652             ReAllocL( iExt->iCdmaData->iIwfName, aValue );
       
  2653             break;
       
  2654             }
       
  2655         case EApCdmaPdpAddress:
       
  2656             {
       
  2657             __ASSERT_ALWAYS \
       
  2658                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  2659             ReAllocL( iExt->iCdmaData->iPdpAddress, aValue );
       
  2660             break;
       
  2661             }
       
  2662         case EApCdmaHomeAgentAddress:
       
  2663             {
       
  2664             __ASSERT_ALWAYS \
       
  2665                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  2666             ReAllocL( iExt->iCdmaData->iHomeAgentAddress, aValue );
       
  2667             break;
       
  2668             }
       
  2669         case EApCdmaMipPrimaryHomeAgent:
       
  2670             {
       
  2671             __ASSERT_ALWAYS \
       
  2672                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  2673             ReAllocL( iExt->iCdmaData->iMipPrimaryHomeAgent, aValue );
       
  2674             break;
       
  2675             }
       
  2676         case EApCdmaMipSecondaryHomeAgent:
       
  2677             {
       
  2678             __ASSERT_ALWAYS \
       
  2679                 ( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  2680             ReAllocL( iExt->iCdmaData->iMipSecondaryHomeAgent, aValue );
       
  2681             break;
       
  2682             }
       
  2683         // END CDMA2000
       
  2684         // WLAN
       
  2685         case EApWlanNetworkName:
       
  2686             {
       
  2687             __ASSERT_ALWAYS \
       
  2688                 ( iExt->iWlanData, ApCommons::Panic( ESanityCheckFailed ) );
       
  2689             ReAllocL( iExt->iWlanData->iWlanNetworkName, aValue );
       
  2690             break;
       
  2691             }
       
  2692         // END WLAN
       
  2693         // LANModem
       
  2694         case EApLanBearerName:
       
  2695             {
       
  2696             ReAllocL( iExt->iLanBearerModemName, aValue );
       
  2697             break;
       
  2698             }
       
  2699         // END LANModem
       
  2700         case EApIapBearerType:
       
  2701             {
       
  2702             ReAllocL( iExt->iIapBearerType, aValue );
       
  2703             break;
       
  2704             }        
       
  2705         default:
       
  2706             {
       
  2707             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  2708             retval = KErrInvalidColumn;
       
  2709             break;
       
  2710             }
       
  2711         }
       
  2712 
       
  2713     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::WriteTextL" ) ) );
       
  2714     return retval;
       
  2715     }
       
  2716 
       
  2717 
       
  2718 // ---------------------------------------------------------
       
  2719 // CApAccessPointItem::WriteLongTextL
       
  2720 // ---------------------------------------------------------
       
  2721 //
       
  2722 EXPORT_C TInt CApAccessPointItem::WriteLongTextL( const TApMember aColumn,
       
  2723                                                 const TDesC& aValue )
       
  2724     {
       
  2725     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::WriteLongTextL" ) ) );
       
  2726 
       
  2727     LeaveIfUnsupportedL( aColumn );
       
  2728 
       
  2729     TInt retval( KErrNone );
       
  2730     switch ( aColumn )
       
  2731         {
       
  2732         case EApGprsAccessPointName:
       
  2733             {
       
  2734             ReAllocL( iGprsAccessPointName, aValue);
       
  2735             break;
       
  2736             }
       
  2737         case EApWapStartPage:
       
  2738             {
       
  2739             ReAllocL( iStartingPage, aValue);
       
  2740             break;
       
  2741             }
       
  2742         case EApIspLoginScript:
       
  2743             {
       
  2744             ReAllocL( iLoginScript, aValue );
       
  2745             break;
       
  2746             }
       
  2747         case EApProxyServerAddress:
       
  2748             {
       
  2749             ReAllocL( iApProxyServerAddress, aValue );
       
  2750             SetProxyFlag();
       
  2751             break;
       
  2752             }
       
  2753         case EApProxyExceptions:
       
  2754             {
       
  2755             ReAllocL( iApProxyExceptions, aValue );
       
  2756             SetProxyFlag();
       
  2757             break;
       
  2758             }
       
  2759         default:
       
  2760             {
       
  2761             // unknown column...
       
  2762             __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  2763             retval = KErrInvalidColumn;
       
  2764             break;
       
  2765             }
       
  2766         }
       
  2767 
       
  2768     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::WriteLongTextL" ) ) );
       
  2769     return retval;
       
  2770     }
       
  2771 
       
  2772 
       
  2773 // ---------------------------------------------------------
       
  2774 // CApAccessPointItem::WriteUint
       
  2775 // ---------------------------------------------------------
       
  2776 //
       
  2777 EXPORT_C TInt CApAccessPointItem::WriteUint( const TApMember aColumn,
       
  2778                                             const TUint32& aValue )
       
  2779     {
       
  2780     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::WriteUint" ) ) );
       
  2781 
       
  2782     /*****************************************************
       
  2783     *   Series 60 Customer / ETel
       
  2784     *   Series 60  ETel API
       
  2785     *****************************************************/
       
  2786     TInt retval( KErrNone );
       
  2787 
       
  2788     if ( !IsSupported( aColumn ) )
       
  2789         {
       
  2790         retval = KErrNotSupported;
       
  2791         }
       
  2792     else
       
  2793         {
       
  2794         switch ( aColumn )
       
  2795             {
       
  2796             case EApWapAccessPointID:
       
  2797                 {
       
  2798                 iWapUid = aValue;
       
  2799                 break;
       
  2800                 }
       
  2801             case EApWapIap:
       
  2802                 {
       
  2803                 iWapIap = aValue;
       
  2804                 break;
       
  2805                 }
       
  2806             case EApIapServiceId:
       
  2807                 {
       
  2808                 iIapServiceId = aValue;
       
  2809                 break;
       
  2810                 }
       
  2811             case EApIapChargecard:
       
  2812                 {
       
  2813                 iIapChargeCardId = aValue;
       
  2814                 break;
       
  2815                 }
       
  2816             case EApIspIspType:
       
  2817             case EApCdmaApType:
       
  2818                 {
       
  2819                 iIspType = (TCommsDbIspType)aValue;
       
  2820                 break;
       
  2821                 }
       
  2822             case EApIspAuthRetries:
       
  2823             case EApGprsIfAuthRetries:
       
  2824             case EApCdmaIfAuthRetries:
       
  2825             case EApWlanIfAuthRetries:
       
  2826                 {
       
  2827                 iIspIfAuthRetries = aValue;
       
  2828                 break;
       
  2829                 }
       
  2830             case EApIspIfCallbackType:
       
  2831                 {
       
  2832                 iCallBackTypeIsServerNum = TCallbackAction( aValue );
       
  2833                 break;
       
  2834                 }
       
  2835             case EApIspCallBackTimeOut:
       
  2836                 {
       
  2837                 iIspCallbackTimeOut = aValue;
       
  2838                 break;
       
  2839                 }
       
  2840             case EApIspBearerName:
       
  2841                 {
       
  2842                 iIspBearerName = 
       
  2843                     RMobileCall::TMobileCallDataServiceCaps( aValue );
       
  2844                 break;
       
  2845                 }
       
  2846             case EApIspBearerSpeed:
       
  2847                 {
       
  2848                 iMaxConnSpeed = TApCallSpeed( aValue );
       
  2849                 break;
       
  2850                 }
       
  2851             case EApIspBearerCE:
       
  2852                 {
       
  2853                 //iIspBearerCE = RMobileCall::TMobileCallDataQoSCaps( aValue );
       
  2854                 iIspBearerCE = RMobileCall::TMobileCallDataQoS( aValue );
       
  2855                 break;
       
  2856                 }
       
  2857             case EApIspBearerCallTypeIsdn:
       
  2858                 {
       
  2859                 /*
       
  2860                 // DO NOT CHECK VALIDITY HERE AS COMMSDB STORES IT DIFFERENTLY
       
  2861                 // AFTER READED FROM THE DB, IT WILL BE CHECKED!!!!!
       
  2862                 // ensure it is in the valid range
       
  2863                 TUint32 tempint = aValue;
       
  2864                 tempint = Min( tempint, TUint32(ECallTypeISDNv120) );
       
  2865                 tempint = Max( tempint, TUint32(ECallTypeAnalogue) );
       
  2866                 */
       
  2867                 iBearerCallTypeIsdn = (TApCallType)aValue;
       
  2868                 break;
       
  2869                 }
       
  2870             case EApIspBearerType:
       
  2871                 {
       
  2872                 iIspBearerType = aValue;
       
  2873                 break;
       
  2874                 }
       
  2875             case EApIspChannelCoding:
       
  2876                 {
       
  2877                 iIspChannelCoding = aValue;
       
  2878                 break;
       
  2879                 }
       
  2880             case EApIspAIUR:
       
  2881                 {
       
  2882                 iIspAIUR = aValue;
       
  2883                 break;
       
  2884                 }
       
  2885             case EApIspRequestedTimeSlots:
       
  2886                 {
       
  2887                 iIspRequestedTimeSlots = aValue;
       
  2888                 break;
       
  2889                 }
       
  2890             case EApIspMaximumTimeSlots:
       
  2891                 {
       
  2892                 iIspMaximumTimeSlots = aValue;
       
  2893                 break;
       
  2894                 }
       
  2895 
       
  2896             case EApGprsPdpType:
       
  2897                 {
       
  2898                 iGprsPdpType = aValue;
       
  2899                 TRAP_IGNORE( SetIfNetworksL() );
       
  2900                 break;
       
  2901                 }
       
  2902             case EApGprsReqPrecedence:
       
  2903                 {
       
  2904                 iGprsReqPrecedence = aValue;
       
  2905                 break;
       
  2906                 }
       
  2907             case EApGprsReqDelay:
       
  2908                 {
       
  2909                 iGprsReqDelay = aValue;
       
  2910                 break;
       
  2911                 }
       
  2912             case EApGprsReqReliability:
       
  2913                 {
       
  2914                 iGprsReqReliability = aValue;
       
  2915                 break;
       
  2916                 }
       
  2917             case EApGprsReqPeakThroughput:
       
  2918                 {
       
  2919                 iGprsReqPeakThroughput = aValue;
       
  2920                 break;
       
  2921                 }
       
  2922             case EApGprsReqMeanPeakThroughput:
       
  2923                 {
       
  2924                 iGprsReqMeanPeakThroughput = aValue;
       
  2925                 break;
       
  2926                 }
       
  2927             case EApGprsMinPrecedence:
       
  2928                 {
       
  2929                 iGprsMinPrecedence = aValue;
       
  2930                 break;
       
  2931                 }
       
  2932             case EApGprsMinDelay:
       
  2933                 {
       
  2934                 iGprsMinDelay = aValue;
       
  2935                 break;
       
  2936                 }
       
  2937             case EApGprsMinReliability:
       
  2938                 {
       
  2939                 iGprsMinReliability = aValue;
       
  2940                 break;
       
  2941                 }
       
  2942             case EApGprsMinPeakThroughput:
       
  2943                 {
       
  2944                 iGprsMinPeakThroughput = aValue;
       
  2945                 break;
       
  2946                 }
       
  2947             case EApGprsMinMeanThroughput:
       
  2948                 {
       
  2949                 iGprsMinMeanThroughput = aValue;
       
  2950                 break;
       
  2951                 }
       
  2952             case EApWapWspOption:
       
  2953                 {
       
  2954                 iIsConnectionTypeContinuous = aValue;
       
  2955                 break;
       
  2956                 }
       
  2957             case EApProxyPortNumber:
       
  2958                 {
       
  2959                 iApProxyPortNumber = aValue;
       
  2960                 SetProxyFlag();
       
  2961                 break;
       
  2962                 }
       
  2963             case EApWapProxyPort:
       
  2964                 {
       
  2965                 iWapProxyPort = aValue;
       
  2966                 break;
       
  2967                 }
       
  2968             case EApNetworkID:
       
  2969                 { // now it is supported to set it from the outside...
       
  2970                 iNetworkId = aValue;
       
  2971                 break;
       
  2972                 }
       
  2973             case EApIapBearerService:
       
  2974                 {
       
  2975                 iApIapBearerService = aValue;
       
  2976                 break;
       
  2977                 }
       
  2978 
       
  2979     // DEPRECATED !!!
       
  2980             case EApWapIsp:
       
  2981             case EApWapChargecard:
       
  2982             case EApWapIspType:
       
  2983                 {
       
  2984                 __ASSERT_DEBUG( EFalse, \
       
  2985                                 User::Panic( kApSet, KErrNotSupported ) );
       
  2986                 retval = KErrNotSupported;
       
  2987                 break;
       
  2988                 }
       
  2989             // CDMA2000
       
  2990             case EApCdmaServiceOption:
       
  2991                 {
       
  2992                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  2993                     ApCommons::Panic( ESanityCheckFailed ) );
       
  2994                 iExt->iCdmaData->iServiceOption = aValue;
       
  2995                 break;
       
  2996                 }
       
  2997             case EApCdmaPdpType:
       
  2998                 {
       
  2999                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3000                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3001                 iExt->iCdmaData->iPdpType = aValue;
       
  3002                 TRAP_IGNORE( SetIfNetworksL() );
       
  3003                 break;
       
  3004                 }
       
  3005             case EApCdmaReqFwdPriority:
       
  3006                 {
       
  3007                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3008                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3009                 iExt->iCdmaData->iReqFwdPriority = aValue;
       
  3010                 break;
       
  3011                 }
       
  3012             case EApCdmaReqRevPriority:
       
  3013                 {
       
  3014                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3015                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3016                 iExt->iCdmaData->iReqRevPriority = aValue;
       
  3017                 break;
       
  3018                 }
       
  3019             case EApCdmaReqFwdBitrate:
       
  3020                 {
       
  3021                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3022                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3023                 iExt->iCdmaData->iReqFwdBitrate = aValue;
       
  3024                 break;
       
  3025                 }
       
  3026             case EApCdmaReqRevBitrate:
       
  3027                 {
       
  3028                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3029                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3030                 iExt->iCdmaData->iReqRevBitrate = aValue;
       
  3031                 break;
       
  3032                 }
       
  3033             case EApCdmaReqFwdLoss:
       
  3034                 {
       
  3035                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3036                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3037                 iExt->iCdmaData->iReqFwdLoss = aValue;
       
  3038                 break;
       
  3039                 }
       
  3040             case EApCdmaReqRevLoss:
       
  3041                 {
       
  3042                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3043                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3044                 iExt->iCdmaData->iReqRevLoss = aValue;
       
  3045                 break;
       
  3046                 }
       
  3047             case EApCdmaReqFwdMaxDelay:
       
  3048                 {
       
  3049                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3050                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3051                 iExt->iCdmaData->iReqFwdMaxDelay = aValue;
       
  3052                 break;
       
  3053                 }
       
  3054             case EApCdmaReqRevMaxDelay:
       
  3055                 {
       
  3056                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3057                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3058                 iExt->iCdmaData->iReqRevMaxDelay = aValue;
       
  3059                 break;
       
  3060                 }
       
  3061             case EApCdmaMinFwdBitrate:
       
  3062                 {
       
  3063                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3064                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3065                 iExt->iCdmaData->iMinFwdBitrate = aValue;
       
  3066                 break;
       
  3067                 }
       
  3068             case EApCdmaMinRevBitrate:
       
  3069                 {
       
  3070                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3071                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3072                 iExt->iCdmaData->iMinRevBitrate = aValue;
       
  3073                 break;
       
  3074                 }
       
  3075             case EApCdmaAccptFwdLoss:
       
  3076                 {
       
  3077                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3078                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3079                 iExt->iCdmaData->iAccptFwdLoss = aValue;
       
  3080                 break;
       
  3081                 }
       
  3082             case EApCdmaAccptRevLoss:
       
  3083                 {
       
  3084                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3085                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3086                 iExt->iCdmaData->iAccptRevLoss = aValue;
       
  3087                 break;
       
  3088                 }
       
  3089             case EApCdmaAccptFwdMaxDelay:
       
  3090                 {
       
  3091                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3092                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3093                 iExt->iCdmaData->iAccptFwdMaxDelay = aValue;
       
  3094                 break;
       
  3095                 }
       
  3096             case EApCdmaAccptRevMaxDelay:
       
  3097                 {
       
  3098                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3099                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3100                 iExt->iCdmaData->iAccptRevMaxDelay = aValue;
       
  3101                 break;
       
  3102                 }
       
  3103             case EApCdmaQosWarningTimeout:
       
  3104                 {
       
  3105                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3106                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3107                 iExt->iCdmaData->iQosWarningTimeout = aValue;
       
  3108                 break;
       
  3109                 }
       
  3110             case EApCdmaRlpMode:
       
  3111                 {
       
  3112                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3113                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3114                 iExt->iCdmaData->iRlpMode = aValue;
       
  3115                 break;
       
  3116                 }
       
  3117             case EApCdmaMipTimeout:
       
  3118                 {
       
  3119                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3120                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3121                 iExt->iCdmaData->iMipTimeout = aValue;
       
  3122                 break;
       
  3123                 }
       
  3124             case EApCdmaNaiType:
       
  3125                 {
       
  3126                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3127                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3128                 iExt->iCdmaData->iNaiType = aValue;
       
  3129                 break;
       
  3130                 }
       
  3131             case EApCdmaSimpleIpAuthAlgorithm:
       
  3132                 {
       
  3133                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3134                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3135                 iExt->iCdmaData->iSimpleIpAuthAlgorithm = aValue;
       
  3136                 break;
       
  3137                 }
       
  3138             case EApCdmaSimpleIpPapSsHandle:
       
  3139                 {
       
  3140                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3141                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3142                 iExt->iCdmaData->iSimpleIpPapSsHandle = aValue;
       
  3143                 break;
       
  3144                 }
       
  3145             case EApCdmaSimpleIpChapSsHandle:
       
  3146                 {
       
  3147                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3148                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3149                 iExt->iCdmaData->iSimpleIpChapSsHandle = aValue;
       
  3150                 break;
       
  3151                 }
       
  3152             case EApCdmaMipTBit:
       
  3153                 {
       
  3154                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3155                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3156                 iExt->iCdmaData->iMipTBit = aValue;
       
  3157                 break;
       
  3158                 }
       
  3159             case EApCdmaMipMnAaaAuthAlgorithm:
       
  3160                 {
       
  3161                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3162                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3163                 iExt->iCdmaData->iMipMnAaaAuthAlgorithm = aValue;
       
  3164                 break;
       
  3165                 }
       
  3166             case EApCdmaMipMnAaaSpi:
       
  3167                 {
       
  3168                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3169                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3170                 iExt->iCdmaData->iMipMnAaaSpi = aValue;
       
  3171                 break;
       
  3172                 }
       
  3173             case EApCdmaMipMnAaaSsHandle:
       
  3174                 {
       
  3175                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3176                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3177                 iExt->iCdmaData->iMipMnAaaSsHandle = aValue;
       
  3178                 break;
       
  3179                 }
       
  3180             case EApCdmaMipMnHaAuthAlgorithm:
       
  3181                 {
       
  3182                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3183                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3184                 iExt->iCdmaData->iMipMnHaAuthAlgorithm = aValue;
       
  3185                 break;
       
  3186                 }
       
  3187             case EApCdmaMipMnHaSpi:
       
  3188                 {
       
  3189                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3190                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3191                 iExt->iCdmaData->iMipMnHaSpi = aValue;
       
  3192                 break;
       
  3193                 }
       
  3194             case EApCdmaMipMnHaSsHandle:
       
  3195                 {
       
  3196                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3197                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3198                 iExt->iCdmaData->iMipMnHaSsHandle = aValue;
       
  3199                 break;
       
  3200                 }
       
  3201             // END CDMA2000
       
  3202             // WLAN
       
  3203             case EApWlanNetworkMode:
       
  3204                 {
       
  3205                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  3206                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3207                 iExt->iWlanData->iWlanNetworkMode = aValue;
       
  3208                 break;
       
  3209                 }
       
  3210             case EApWlanSecurityMode:
       
  3211                 {
       
  3212                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  3213                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3214                 iExt->iWlanData->iWlanSecurityMode = aValue;
       
  3215                 break;
       
  3216                 }
       
  3217             case EApWlanSettingsId:
       
  3218                 {
       
  3219                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  3220                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3221                 iExt->iWlanData->iWlanId = aValue;
       
  3222                 break;
       
  3223                 }
       
  3224             case EApWlanChannelId:
       
  3225                 {
       
  3226                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  3227                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3228                 iExt->iWlanData->iChannelId = aValue;
       
  3229                 break;
       
  3230                 }
       
  3231             // END WLAN
       
  3232             // LANModem
       
  3233             case EApIapBearerID:
       
  3234                 {
       
  3235                 iExt->iIapBearerID = aValue;
       
  3236                 break;
       
  3237                 }
       
  3238             // END LANModem
       
  3239             default :
       
  3240                 {
       
  3241                 __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  3242                 retval = KErrInvalidColumn;
       
  3243                 }
       
  3244             }
       
  3245         }
       
  3246 
       
  3247     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::WriteUint" ) ) );
       
  3248     return retval;
       
  3249     }
       
  3250 
       
  3251 
       
  3252 
       
  3253 // ---------------------------------------------------------
       
  3254 // CApAccessPointItem::WriteBool
       
  3255 // ---------------------------------------------------------
       
  3256 //
       
  3257 EXPORT_C TInt CApAccessPointItem::WriteBool( const TApMember aColumn,
       
  3258                                             const TBool& aValue )
       
  3259     {
       
  3260     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::WriteBool" ) ) );
       
  3261 
       
  3262     TInt retval( KErrNone );
       
  3263 
       
  3264     if ( !IsSupported( aColumn ) )
       
  3265         {
       
  3266         retval = KErrNotSupported;
       
  3267         }
       
  3268     else
       
  3269         {
       
  3270         switch ( aColumn )
       
  3271             {
       
  3272             case EApWapSecurity:
       
  3273                 {
       
  3274                 iIsWTLSSecurityOn = aValue;
       
  3275                 break;
       
  3276                 }
       
  3277             case EApIspDialResolution:
       
  3278                 {
       
  3279                 iIspDialResolution = aValue;
       
  3280                 break;
       
  3281                 }
       
  3282             case EApIspUseLoginScript:
       
  3283                 {
       
  3284                 iUseLoginScript = aValue;
       
  3285                 break;
       
  3286                 }
       
  3287             case EApIspPromptForLogin:
       
  3288                 {
       
  3289                 iPromptPassword = aValue;
       
  3290                 iIspIfPromptForAuth = aValue;
       
  3291                 break;
       
  3292                 }
       
  3293             case EApIspDisplayPCT:
       
  3294                 {
       
  3295                 iDisplayTerminalWindow = EFalse;
       
  3296                 break;
       
  3297                 }
       
  3298             case EApIspIfPromptForAuth:
       
  3299             case EApGprsIfPromptForAuth:
       
  3300             case EApCdmaIfPromptForAuth:
       
  3301             case EApWlanIfPromptForAuth:
       
  3302                 {
       
  3303                 iIspIfPromptForAuth = aValue;
       
  3304                 iPromptPassword = aValue;
       
  3305                 break;
       
  3306                 }
       
  3307             case EApIspIfCallbackEnabled:
       
  3308                 {
       
  3309                 iUseCallBack = aValue;
       
  3310                 break;
       
  3311                 }
       
  3312             case EApIspIPAddrFromServer:
       
  3313             case EApGprsIpAddrFromServer:
       
  3314             case EApCdmaIpAddrFromServer:
       
  3315             case EApWlanIpAddrFromServer:
       
  3316                 {
       
  3317                 iIspIPAddrFromServer = aValue;
       
  3318                 break;
       
  3319                 }
       
  3320             case EApIspIPDnsAddrFromServer:
       
  3321             case EApGprsIpDnsAddrFromServer:
       
  3322             case EApCdmaIpDnsAddrFromServer:
       
  3323             case EApWlanIpDnsAddrFromServer:
       
  3324                 {
       
  3325                 iGetDNSIPFromServer = aValue;
       
  3326                 break;
       
  3327                 }
       
  3328             case EApIspEnableIpHeaderComp:
       
  3329             case EApGprsHeaderCompression:
       
  3330             case EApCdmaHeaderCompression:
       
  3331                 {
       
  3332                 iEnablePPPCompression = aValue;
       
  3333                 break;
       
  3334                 }
       
  3335             case EApIspEnableLCPExtensions:
       
  3336             case EApGprsEnableLCPExtensions:
       
  3337             case EApCdmaEnableLCPExtensions:
       
  3338                 {
       
  3339                 iIspEnableLCPExtensions = aValue;
       
  3340                 break;
       
  3341                 }
       
  3342             case EApIspDisablePlainTextAuth:
       
  3343             case EApGprsDisablePlainTextAuth:
       
  3344             case EApCdmaDisablePlainTextAuth:
       
  3345                 {
       
  3346                 iIsPasswordAuthenticationSecure = aValue;
       
  3347                 break;
       
  3348                 }
       
  3349             case EApIspEnableSWCompression:
       
  3350             case EApGprsDataCompression:
       
  3351             case EApCdmaDataCompression:
       
  3352                 {
       
  3353                 iIspEnableSwCompression = aValue;
       
  3354                 break;
       
  3355                 }
       
  3356     // NOTE! This is deprecated.
       
  3357             case EApIspBearerCallTypeIsdn:
       
  3358                 {
       
  3359                 iBearerCallTypeIsdn = 
       
  3360                     TApCallType( aValue != ECallTypeAnalogue );
       
  3361                 break;
       
  3362                 }
       
  3363             case EApGprsUseAnonymAccess:
       
  3364             case EApCdmaAnonymousAccess:
       
  3365                 {
       
  3366                 iGprsUseAnonymAccess = aValue;
       
  3367                 break;
       
  3368                 }
       
  3369             case EApIsReadOnly:
       
  3370                 {
       
  3371                 __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  3372                 retval = KErrInvalidColumn;
       
  3373                 break;
       
  3374                 }
       
  3375             case EApProxyUseProxy:
       
  3376                 {
       
  3377                 iApProxyUseProxy = aValue;
       
  3378                 SetProxyFlag();
       
  3379                 break;
       
  3380                 }
       
  3381             case EApHasProxySettings:
       
  3382                 {
       
  3383                 __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  3384                 retval = KErrNotSupported;
       
  3385                 break;
       
  3386                 }
       
  3387             case EApIP6DNSAddrFromServer:
       
  3388                 {
       
  3389                 if ( iExt->iIsIpv6Supported )
       
  3390                     {
       
  3391                     iExt->iIpv6GetDNSIPFromServer = aValue;
       
  3392                     }
       
  3393                 else
       
  3394                     {
       
  3395                     retval = KErrNotSupported;
       
  3396                     }
       
  3397                 break;
       
  3398                 }
       
  3399             // CDMA2000
       
  3400             case EApCdmaMip:
       
  3401                 {
       
  3402                 __ASSERT_ALWAYS ( iExt->iCdmaData, \
       
  3403                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3404                 iExt->iCdmaData->iMip = aValue;
       
  3405                 break;
       
  3406                 }
       
  3407             // END CDMA2000
       
  3408             // WLAN
       
  3409             case EApWlanScanSSID:
       
  3410                 {
       
  3411                 __ASSERT_ALWAYS ( iExt->iWlanData, \
       
  3412                     ApCommons::Panic( ESanityCheckFailed ) );
       
  3413                 iExt->iWlanData->iScanSSID = aValue;
       
  3414                 break;
       
  3415                 }
       
  3416             // END WLAN
       
  3417             default :
       
  3418                 {
       
  3419                 __ASSERT_DEBUG( EFalse, ApCommons::Panic( EInvalidColumn ) );
       
  3420                 retval = KErrInvalidColumn;
       
  3421                 break;
       
  3422                 }
       
  3423             }
       
  3424         }
       
  3425 
       
  3426     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::WriteBool" ) ) );
       
  3427     return retval;
       
  3428     }
       
  3429 
       
  3430 
       
  3431 
       
  3432 // Query
       
  3433 // COMMON
       
  3434 
       
  3435 // ---------------------------------------------------------
       
  3436 // CApAccessPointItem::Uid
       
  3437 // ---------------------------------------------------------
       
  3438 //
       
  3439 EXPORT_C TUint32 CApAccessPointItem::WapUid() const
       
  3440     {
       
  3441     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::WapUid" ) ) );
       
  3442 
       
  3443     return iWapUid;
       
  3444     }
       
  3445 
       
  3446 
       
  3447 // ---------------------------------------------------------
       
  3448 // CApAccessPointItem::ConnectionName
       
  3449 // ---------------------------------------------------------
       
  3450 //
       
  3451 EXPORT_C const TDesC& CApAccessPointItem::ConnectionName() const
       
  3452     {
       
  3453     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::ConnectionName" ) ) );
       
  3454 
       
  3455     return *iWapAccessPointName;
       
  3456     }
       
  3457 
       
  3458 
       
  3459 // WAP-spec.
       
  3460 // ---------------------------------------------------------
       
  3461 // CApAccessPointItem::WapBearer
       
  3462 // ---------------------------------------------------------
       
  3463 //
       
  3464 EXPORT_C const TDesC& CApAccessPointItem::WapBearer() const
       
  3465     {
       
  3466     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::WapBearer" ) ) );
       
  3467 
       
  3468     return *iWapBearer;
       
  3469     }
       
  3470 
       
  3471 
       
  3472 
       
  3473 // WAP-spec.
       
  3474 // ---------------------------------------------------------
       
  3475 // CApAccessPointItem::BearerTypeL
       
  3476 // ---------------------------------------------------------
       
  3477 //
       
  3478 EXPORT_C TApBearerType CApAccessPointItem::BearerTypeL()
       
  3479     {
       
  3480     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::BearerTypeL" ) ) );
       
  3481 
       
  3482     TApBearerType retval( EApBearerTypeAllBearers );
       
  3483     // decide which bearer, read bearer spec. data.
       
  3484     if ( *iWapBearer == TPtrC(WAP_IP_BEARER) )
       
  3485         {
       
  3486         if ( ( *iIapServiceType == TPtrC(DIAL_OUT_ISP) ) ||
       
  3487              ( *iIapServiceType == TPtrC(DIAL_IN_ISP) ) )
       
  3488             {
       
  3489             // now check speed
       
  3490             if ( iIspBearerType == EBearerTypeCSD )
       
  3491                 {
       
  3492                 retval = EApBearerTypeCSD;
       
  3493                 }
       
  3494             else
       
  3495                 {
       
  3496                 if ( iIspBearerType == EBearerTypeHSCSD )
       
  3497                     {
       
  3498                     retval = EApBearerTypeHSCSD;
       
  3499                     }
       
  3500                 else
       
  3501                     {
       
  3502                     User::Leave( KErrInvalidBearer );
       
  3503                     }
       
  3504                 }
       
  3505             }
       
  3506         else
       
  3507             {
       
  3508             if ( ( *iIapServiceType == TPtrC(OUTGOING_WCDMA) ) ||
       
  3509                  ( *iIapServiceType == TPtrC(INCOMING_WCDMA) ) )
       
  3510                 {
       
  3511                 retval = EApBearerTypeGPRS;
       
  3512                 }
       
  3513             else
       
  3514                 { // some other bearer, currently only VPN...
       
  3515                 if ( iExt->iIsVpnAp )
       
  3516                     {
       
  3517                     // in this case get REAL IAP's bearer type...
       
  3518                     retval = iExt->iVPnRealIapBearerType;
       
  3519                     }
       
  3520                 else
       
  3521                     {
       
  3522                     if ( iExt->iWlanData )
       
  3523                         {                        
       
  3524                         // check if it is WLAN...
       
  3525                         if ( *iIapServiceType == TPtrC(LAN_SERVICE) )
       
  3526                             {
       
  3527                             if ( IsWlan() )
       
  3528                                 {
       
  3529                                 retval = EApBearerTypeWLAN;
       
  3530                                 }
       
  3531                             else
       
  3532                                 {
       
  3533                                 if ( *iExt->iLanBearerModemName == 
       
  3534                                         KModemBearerLANModem )
       
  3535                                     {// IPPass Through
       
  3536                                     retval = EApBearerTypeLANModem;
       
  3537                                     }
       
  3538                                 else
       
  3539                                     {                                
       
  3540                         #ifdef __TEST_LAN_BEARER
       
  3541                                     retval = EApBearerTypeLAN;
       
  3542                         #else
       
  3543                                     User::Leave( KErrInvalidBearer );
       
  3544                         #endif // __TEST_LAN_BEARER
       
  3545                                     }
       
  3546                                 }
       
  3547                             }
       
  3548                         else
       
  3549                             { // otherwise, it is not known, invalid...
       
  3550                             User::Leave( KErrInvalidBearer );
       
  3551                             }
       
  3552                         }
       
  3553                     else
       
  3554                         {
       
  3555                         if ( *iExt->iLanBearerModemName == 
       
  3556                                 KModemBearerLANModem )
       
  3557                             {// IPPass Through
       
  3558                             retval = EApBearerTypeLANModem;
       
  3559                             }
       
  3560                         else
       
  3561                             {
       
  3562                     #ifdef __TEST_LAN_BEARER
       
  3563                         retval = EApBearerTypeLAN;
       
  3564                     #else // __TEST_LAN_BEARER
       
  3565                         User::Leave( KErrInvalidBearer );
       
  3566                     #endif // __TEST_LAN_BEARER
       
  3567                             }
       
  3568                         }
       
  3569                     }
       
  3570                 }
       
  3571             }
       
  3572         }
       
  3573     else
       
  3574         {
       
  3575         User::Leave( KErrInvalidBearer );
       
  3576         }
       
  3577     if ( retval == EApBearerTypeAllBearers )
       
  3578         {
       
  3579         User::Leave( KErrInvalidBearer );
       
  3580         }
       
  3581 
       
  3582     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::BearerTypeL" ) ) );
       
  3583     return retval;
       
  3584     }
       
  3585 
       
  3586 
       
  3587 
       
  3588 // ---------------------------------------------------------
       
  3589 // CApAccessPointItem::SetBearerTypeL
       
  3590 // ---------------------------------------------------------
       
  3591 //
       
  3592 EXPORT_C void CApAccessPointItem::SetBearerTypeL( TApBearerType aBearer )
       
  3593     {    
       
  3594     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SetBearerTypeL" ) ) );
       
  3595 
       
  3596     HBufC* tmpbuf;
       
  3597     switch ( aBearer )
       
  3598         {
       
  3599         case EApBearerTypeGPRS: // GPRS
       
  3600             {
       
  3601             tmpbuf = TPtrC(WAP_IP_BEARER).AllocL();
       
  3602             delete iWapBearer;
       
  3603             iWapBearer = tmpbuf;
       
  3604             WriteTextL( EApIapServiceType, TPtrC(OUTGOING_WCDMA) );
       
  3605             WriteTextL( EApIspIfParams, KDefGprsIfParams );      // required !
       
  3606             if( iExt->iWlanData )
       
  3607                 {
       
  3608                 iExt->iWlanData->iIsWlan = EFalse;
       
  3609                 }
       
  3610             WriteTextL( EApLanBearerName, KModemBearerGPRS );
       
  3611             break;
       
  3612             }
       
  3613         case EApBearerTypeCSD: // CSD
       
  3614             {
       
  3615             if ( !iExt->iIsAppCsdSupport )
       
  3616                 {
       
  3617                 User::Leave( KErrNotSupported );
       
  3618                 }
       
  3619 
       
  3620             tmpbuf = TPtrC(WAP_IP_BEARER).AllocL();
       
  3621             delete iWapBearer;
       
  3622             iWapBearer = tmpbuf;
       
  3623             WriteTextL( EApIapServiceType, TPtrC(DIAL_OUT_ISP) );            
       
  3624             WriteTextL( EApIspIfParams, KEmpty );             // required !
       
  3625             iIspBearerType = EBearerTypeCSD;            
       
  3626             if( iExt->iWlanData )
       
  3627                 {
       
  3628                 iExt->iWlanData->iIsWlan = EFalse;
       
  3629                 }            
       
  3630             WriteTextL( EApLanBearerName, KModemBearerCSD );
       
  3631             LimitIp6DNSL();            
       
  3632             break;
       
  3633             }
       
  3634         case EApBearerTypeHSCSD: // HSCSD
       
  3635             {
       
  3636             if ( !iExt->iIsAppHscsdSupport || !iExt->iIsAppCsdSupport )
       
  3637                 {
       
  3638                 User::Leave( KErrNotSupported );
       
  3639                 }
       
  3640             tmpbuf = TPtrC(WAP_IP_BEARER).AllocL();
       
  3641             delete iWapBearer;
       
  3642             iWapBearer = tmpbuf;
       
  3643             WriteTextL( EApIapServiceType, TPtrC(DIAL_OUT_ISP) );
       
  3644             WriteTextL( EApIspIfParams, KEmpty );             // required !
       
  3645             iIspBearerType = EBearerTypeHSCSD;
       
  3646             if( iExt->iWlanData )
       
  3647                 {
       
  3648                 iExt->iWlanData->iIsWlan = EFalse;
       
  3649                 }            
       
  3650             WriteTextL( EApLanBearerName, KModemBearerCSD );
       
  3651             LimitIp6DNSL();
       
  3652             break;
       
  3653             }
       
  3654         case EApBearerTypeWLAN: // WLAN
       
  3655             { 
       
  3656             if( !iExt->iWlanData )
       
  3657                 {
       
  3658                 User::Leave( KErrNotSupported );
       
  3659                 }
       
  3660             tmpbuf = TPtrC(WAP_IP_BEARER).AllocL();
       
  3661             delete iWapBearer;
       
  3662             iWapBearer = tmpbuf;
       
  3663             WriteTextL( EApIapServiceType, TPtrC(LAN_SERVICE) );
       
  3664             WriteTextL( EApIspIfParams, KEmpty );             // required !
       
  3665             WriteTextL( EApLanBearerName, KModemBearerWLAN );
       
  3666             iExt->iWlanData->iIsWlan = ETrue;
       
  3667             break;
       
  3668             }
       
  3669 #ifdef __TEST_LAN_BEARER
       
  3670         case EApBearerTypeLAN: // LAN
       
  3671             { 
       
  3672             tmpbuf = TPtrC(WAP_IP_BEARER).AllocL();
       
  3673             delete iWapBearer;
       
  3674             iWapBearer = tmpbuf;
       
  3675             WriteTextL( EApIapServiceType, TPtrC(LAN_SERVICE) );
       
  3676             WriteTextL( EApIspIfParams, KEmpty );             // required !
       
  3677             if( iExt->iWlanData )
       
  3678                 {
       
  3679                 iExt->iWlanData->iIsWlan = EFalse;
       
  3680                 }            
       
  3681             WriteTextL( EApLanBearerName, KModemBearerLAN );
       
  3682             break;
       
  3683             }
       
  3684 #endif // __TEST_LAN_BEARER
       
  3685         case EApBearerTypeLANModem: // LAN modem
       
  3686             { 
       
  3687             tmpbuf = TPtrC(WAP_IP_BEARER).AllocL();
       
  3688             delete iWapBearer;
       
  3689             iWapBearer = tmpbuf;
       
  3690             WriteTextL( EApIapServiceType, TPtrC(LAN_SERVICE) );
       
  3691             WriteTextL( EApIspIfParams, KEmpty );             // required !
       
  3692             if( iExt->iWlanData )
       
  3693                 {
       
  3694                 iExt->iWlanData->iIsWlan = EFalse;
       
  3695                 }            
       
  3696             WriteTextL( EApLanBearerName, KModemBearerLANModem );
       
  3697             break;
       
  3698             }            
       
  3699         default:
       
  3700             {
       
  3701             User::Leave( KErrInvalidBearer );
       
  3702             break;
       
  3703             }
       
  3704         }
       
  3705     LimitSpeedL();
       
  3706 
       
  3707     SetIfNetworksL();
       
  3708 
       
  3709     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SetBearerTypeL" ) ) );
       
  3710     }
       
  3711 
       
  3712 
       
  3713 
       
  3714 // ---------------------------------------------------------
       
  3715 // CApAccessPointItem::SetNamesL
       
  3716 // ---------------------------------------------------------
       
  3717 //
       
  3718 EXPORT_C void CApAccessPointItem::SetNamesL( const TDesC16& aValue )
       
  3719     {
       
  3720     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SetNamesL" ) ) );
       
  3721 
       
  3722     WriteTextL( EApWapAccessPointName, aValue );
       
  3723     WriteTextL( EApIapName, aValue );
       
  3724     WriteTextL( EApIspName, aValue );
       
  3725     WriteTextL( EApNetworkName, aValue );
       
  3726 
       
  3727     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SetNamesL" ) ) );
       
  3728     }
       
  3729 
       
  3730 
       
  3731 
       
  3732 // ---------------------------------------------------------
       
  3733 // CApAccessPointItem::SanityCheckOk
       
  3734 // ---------------------------------------------------------
       
  3735 //
       
  3736 EXPORT_C TBool CApAccessPointItem::SanityCheckOk()
       
  3737     {
       
  3738     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::SanityCheckOk" ) ) );
       
  3739 
       
  3740     TBool retval( ETrue );
       
  3741     // as iWApIspType had been deprecated, this method also...
       
  3742     return retval;
       
  3743     }
       
  3744 
       
  3745 
       
  3746 
       
  3747 // ---------------------------------------------------------
       
  3748 // CApAccessPointItem::HasSameIspAndBearer
       
  3749 // ---------------------------------------------------------
       
  3750 //
       
  3751 EXPORT_C TBool CApAccessPointItem::HasSameIspAndBearerL(
       
  3752                                  CApAccessPointItem& aItem )
       
  3753     {
       
  3754     CLOG( ( EApItem, 0, 
       
  3755             _L( "-> CApAccessPointItem::HasSameIspAndBearerL" ) ) );
       
  3756 
       
  3757     TBool retval( EFalse );
       
  3758     TApBearerType bearer = BearerTypeL();
       
  3759     if ( bearer == aItem.BearerTypeL() )
       
  3760         {
       
  3761         switch ( bearer )
       
  3762             {
       
  3763             case EApBearerTypeCSD:
       
  3764             case EApBearerTypeHSCSD:
       
  3765                 {
       
  3766                 // compare phone number, username, pwd
       
  3767                 // first compare phone numbers
       
  3768                 if ( IsSamePhoneNumberL( aItem ) )
       
  3769                     {
       
  3770                     TBool pwd1;
       
  3771                     ReadBool( EApIspPromptForLogin, pwd1 );
       
  3772                     TBool pwd2;
       
  3773                     aItem.ReadBool( EApIspPromptForLogin, pwd2 );
       
  3774                     if ( ( !pwd1 ) && ( !pwd2 ) )
       
  3775                         {
       
  3776                         HBufC* tmpuser = HBufC::NewLC( 
       
  3777                                 aItem.ReadTextLengthL( EApIspLoginName ) );
       
  3778                         HBufC* tmppwd = HBufC::NewLC( 
       
  3779                                 aItem.ReadTextLengthL( EApIspLoginPass ) );
       
  3780                         TPtr16 tmpptruser( tmpuser->Des() );
       
  3781                         TPtr16 tmpptrpwd( tmppwd->Des() );
       
  3782                         aItem.ReadTextL( EApIspLoginName, tmpptruser );
       
  3783                         aItem.ReadTextL( EApIspLoginPass, tmpptrpwd );
       
  3784                         if ( ( iUserName->Compare( *tmpuser ) == 0 )
       
  3785                             && (iPassword->Compare( *tmppwd ) == 0 ) )
       
  3786                             {
       
  3787                             retval = ETrue;
       
  3788                             }
       
  3789                         // tmpuser, tmppw
       
  3790                         CleanupStack::PopAndDestroy( 2, tmpuser ); 
       
  3791                         }
       
  3792                     }
       
  3793                 break;
       
  3794                 }
       
  3795             case EApBearerTypeGPRS:
       
  3796                 {
       
  3797                 // compare APN, (username/pwd?)
       
  3798                 if ( aItem.ReadConstLongTextL( EApGprsAccessPointName )
       
  3799                     ->Compare( *iGprsAccessPointName ) == 0 )
       
  3800                     {
       
  3801                     retval = ETrue;
       
  3802                     }
       
  3803                 break;
       
  3804                 }
       
  3805             case EApBearerTypeCDMA:
       
  3806                 {
       
  3807                 retval = ETrue;
       
  3808                 break;
       
  3809                 }
       
  3810             case EApBearerTypeWLAN:
       
  3811                 {
       
  3812                 if( iExt->iWlanData )
       
  3813                     {                    
       
  3814                     retval = ETrue;
       
  3815                     }
       
  3816                 else
       
  3817                     {
       
  3818                     User::Leave( KErrNotSupported );
       
  3819                     }
       
  3820                 break;
       
  3821                 }
       
  3822 #ifdef __TEST_LAN_BEARER
       
  3823             case EApBearerTypeLAN:
       
  3824                 {
       
  3825                 retval = ETrue;
       
  3826                 break;
       
  3827                 }
       
  3828 #endif // __TEST_LAN_BEARER
       
  3829             case EApBearerTypeLANModem:
       
  3830                 {
       
  3831                 retval = ETrue;
       
  3832                 break;
       
  3833                 }
       
  3834             default:
       
  3835                 {
       
  3836                 User::Leave( KErrInvalidBearer );
       
  3837                 break;
       
  3838                 }
       
  3839             }
       
  3840         }
       
  3841 
       
  3842     CLOG( ( EApItem, 1, 
       
  3843             _L( "<- CApAccessPointItem::HasSameIspAndBearerL" ) ) );
       
  3844     return retval;
       
  3845     }
       
  3846 
       
  3847 
       
  3848 // ---------------------------------------------------------
       
  3849 // CApAccessPointItem::IsReadOnly
       
  3850 // ---------------------------------------------------------
       
  3851 //
       
  3852 EXPORT_C TBool CApAccessPointItem::IsReadOnly() const
       
  3853     {
       
  3854     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::IsReadOnly" ) ) );
       
  3855 
       
  3856     return iIsReadOnly;
       
  3857     }
       
  3858 
       
  3859 
       
  3860 
       
  3861 
       
  3862 // ================= OTHER EXPORTED FUNCTIONS ==============
       
  3863 
       
  3864 
       
  3865 // =============== OTHER NON - EXPORTED FUNCTIONS ============
       
  3866 // ---------------------------------------------------------
       
  3867 // CApAccessPointItem::IsVpnAp
       
  3868 // ---------------------------------------------------------
       
  3869 //
       
  3870 TBool CApAccessPointItem::IsVpnAp() const
       
  3871     {
       
  3872     return iExt->iIsVpnAp;
       
  3873     }
       
  3874 
       
  3875 
       
  3876 // ---------------------------------------------------------
       
  3877 // CApAccessPointItem::SetVpnAp
       
  3878 // ---------------------------------------------------------
       
  3879 //
       
  3880 void CApAccessPointItem::SetVpnAp( TBool aIsVpn )
       
  3881     {
       
  3882     iExt->iIsVpnAp = aIsVpn;
       
  3883     }
       
  3884 
       
  3885 // ---------------------------------------------------------
       
  3886 // CApAccessPointItem::Specified
       
  3887 // ---------------------------------------------------------
       
  3888 //
       
  3889 TBool CApAccessPointItem::Specified( TApMember aMember )
       
  3890     {
       
  3891     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::Specified" ) ) );
       
  3892 
       
  3893     return iSpecified->At( aMember );
       
  3894     }
       
  3895 
       
  3896 
       
  3897 // ---------------------------------------------------------
       
  3898 // CApAccessPointItem::Specify
       
  3899 // ---------------------------------------------------------
       
  3900 //
       
  3901 void CApAccessPointItem::Specify( TApMember aMember, TBool aOn )
       
  3902     {
       
  3903     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::Specify" ) ) );
       
  3904 
       
  3905     iSpecified->At( aMember ) = aOn;
       
  3906     }
       
  3907 
       
  3908 
       
  3909 // ---------------------------------------------------------
       
  3910 // CApAccessPointItem::SpecifyAll
       
  3911 // ---------------------------------------------------------
       
  3912 //
       
  3913 void CApAccessPointItem::SpecifyAll( TBool aOn )
       
  3914     {
       
  3915     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyAll" ) ) );
       
  3916 
       
  3917     for( TInt i=0; i< KApMembers; i++ )
       
  3918         {
       
  3919         iSpecified->At( i ) = aOn;
       
  3920         }
       
  3921 
       
  3922     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyAll" ) ) );
       
  3923     }
       
  3924 
       
  3925 
       
  3926 
       
  3927 // ---------------------------------------------------------
       
  3928 // CApAccessPointItem::SpecifyWap
       
  3929 // ---------------------------------------------------------
       
  3930 //
       
  3931 void CApAccessPointItem::SpecifyWap( TBool aOn )
       
  3932     {
       
  3933     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyWap" ) ) );
       
  3934 
       
  3935     iSpecified->At( EApWapAccessPointID ) = aOn;
       
  3936     iSpecified->At( EApWapAccessPointName ) = aOn;
       
  3937     iSpecified->At( EApWapCurrentBearer ) = aOn;
       
  3938     iSpecified->At( EApWapStartPage ) = aOn;
       
  3939     iSpecified->At( EApWapGatewayAddress ) = aOn;
       
  3940     iSpecified->At( EApWapWspOption ) = aOn;
       
  3941     iSpecified->At( EApWapSecurity ) = aOn;
       
  3942 
       
  3943     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyWap" ) ) );
       
  3944     }
       
  3945 
       
  3946 
       
  3947 
       
  3948 // ---------------------------------------------------------
       
  3949 // CApAccessPointItem::SpecifyIpBearer
       
  3950 // ---------------------------------------------------------
       
  3951 //
       
  3952 void CApAccessPointItem::SpecifyIpBearer( TBool aOn )
       
  3953     {
       
  3954     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyIpBearer" ) ) );
       
  3955 
       
  3956 //* DEPRECATED
       
  3957     iSpecified->At( EApWapIsp ) = EFalse;
       
  3958 //* DEPRECATED
       
  3959     iSpecified->At( EApWapChargecard ) = EFalse;
       
  3960     iSpecified->At( EApWapIap ) = aOn;
       
  3961 //* DEPRECATED
       
  3962     iSpecified->At( EApWapIspType ) = EFalse;
       
  3963 
       
  3964     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyIpBearer" ) ) );
       
  3965     }
       
  3966 
       
  3967 
       
  3968 // ---------------------------------------------------------
       
  3969 // CApAccessPointItem::SpecifyIAP
       
  3970 // ---------------------------------------------------------
       
  3971 //
       
  3972 void CApAccessPointItem::SpecifyIAP( TBool aOn )
       
  3973     {
       
  3974     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyIAP" ) ) );
       
  3975 
       
  3976     iSpecified->At( EApWapIap ) = aOn;
       
  3977     iSpecified->At( EApIapName ) = aOn;
       
  3978     iSpecified->At( EApIapServiceType ) = aOn;
       
  3979     iSpecified->At( EApIapServiceId ) = aOn;
       
  3980     iSpecified->At( EApIapChargecard ) = aOn;
       
  3981 
       
  3982     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyIAP" ) ) );
       
  3983     }
       
  3984 
       
  3985 
       
  3986 // ---------------------------------------------------------
       
  3987 // CApAccessPointItem::SpecifyISP
       
  3988 // ---------------------------------------------------------
       
  3989 //
       
  3990 void CApAccessPointItem::SpecifyISP( TBool aOn )
       
  3991     {
       
  3992     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyISP" ) ) );
       
  3993 
       
  3994     iSpecified->At( EApIspName ) = aOn;
       
  3995     iSpecified->At( EApIspDescription ) = aOn;
       
  3996     iSpecified->At( EApIspIspType ) = aOn;
       
  3997 
       
  3998     iSpecified->At( EApIspDefaultTelNumber ) = aOn;
       
  3999     iSpecified->At( EApIspDialResolution ) = aOn;
       
  4000     iSpecified->At( EApIspUseLoginScript ) = aOn;
       
  4001     iSpecified->At( EApIspLoginScript ) = aOn;
       
  4002     iSpecified->At( EApIspPromptForLogin ) = aOn;
       
  4003     iSpecified->At( EApIspLoginName ) = aOn;
       
  4004     iSpecified->At( EApIspLoginPass ) = aOn;
       
  4005     iSpecified->At( EApIspDisplayPCT ) = aOn;
       
  4006     iSpecified->At( EApIspIfName ) = aOn;
       
  4007     iSpecified->At( EApIspIfParams ) = aOn;
       
  4008     iSpecified->At( EApIspIfNetworks ) = aOn;
       
  4009     iSpecified->At( EApIspIfPromptForAuth ) = aOn;
       
  4010     iSpecified->At( EApIspIfAuthName ) = aOn;
       
  4011     iSpecified->At( EApIspIfAuthPass ) = aOn;
       
  4012     iSpecified->At( EApIspAuthRetries ) = aOn;
       
  4013     iSpecified->At( EApIspIfCallbackEnabled ) = aOn;
       
  4014     iSpecified->At( EApIspIfCallbackType ) = aOn;
       
  4015     iSpecified->At( EApIspIfCallbackInfo ) = aOn;
       
  4016     iSpecified->At( EApIspCallBackTimeOut ) = aOn;
       
  4017     iSpecified->At( EApIspIPAddrFromServer ) = aOn;
       
  4018     iSpecified->At( EApIspIPAddr ) = aOn;
       
  4019     iSpecified->At( EApIspIPNetMask ) = aOn;
       
  4020     iSpecified->At( EApIspIPGateway ) = aOn;
       
  4021     iSpecified->At( EApIspIPDnsAddrFromServer ) = aOn;
       
  4022     iSpecified->At( EApIspIPNameServer1 ) = aOn;
       
  4023     iSpecified->At( EApIspIPNameServer2 ) = aOn;
       
  4024     iSpecified->At( EApIspEnableIpHeaderComp ) = aOn;
       
  4025     iSpecified->At( EApIspEnableLCPExtensions ) = aOn;
       
  4026     iSpecified->At( EApIspDisablePlainTextAuth ) = aOn;
       
  4027     iSpecified->At( EApIspEnableSWCompression ) = aOn;
       
  4028     iSpecified->At( EApIspBearerName ) = aOn;
       
  4029     iSpecified->At( EApIspBearerSpeed ) = aOn;
       
  4030     iSpecified->At( EApIspBearerCallTypeIsdn ) = aOn;
       
  4031     iSpecified->At( EApIspBearerCE ) = aOn;
       
  4032     iSpecified->At( EApIspInitString ) = aOn;
       
  4033     iSpecified->At( EApIspBearerType ) = aOn;
       
  4034     iSpecified->At( EApIspChannelCoding ) = aOn;
       
  4035     iSpecified->At( EApIspAIUR ) = aOn;
       
  4036     iSpecified->At( EApIspRequestedTimeSlots ) = aOn;
       
  4037     iSpecified->At( EApIspMaximumTimeSlots ) = aOn;
       
  4038 
       
  4039     if ( iExt->iIsIpv6Supported )
       
  4040         {
       
  4041         iSpecified->At( EApIP6DNSAddrFromServer ) = aOn;
       
  4042         iSpecified->At( EApIP6NameServer1 ) = aOn;
       
  4043         iSpecified->At( EApIP6NameServer2 ) = aOn;
       
  4044         }
       
  4045 
       
  4046     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyISP" ) ) );
       
  4047     }
       
  4048 
       
  4049 
       
  4050 // ---------------------------------------------------------
       
  4051 // CApAccessPointItem::SpecifyGPRS
       
  4052 // ---------------------------------------------------------
       
  4053 //
       
  4054 void CApAccessPointItem::SpecifyGPRS( TBool aOn )
       
  4055     {
       
  4056     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyGPRS" ) ) );
       
  4057 
       
  4058     iSpecified->At( EApGprsAccessPointName ) = aOn;
       
  4059     iSpecified->At( EApGprsPdpType ) = aOn;
       
  4060     iSpecified->At( EApGprsPdpAddress ) = aOn;
       
  4061     iSpecified->At( EApGprsReqPrecedence ) = aOn;
       
  4062     iSpecified->At( EApGprsReqDelay ) = aOn;
       
  4063     iSpecified->At( EApGprsReqReliability ) = aOn;
       
  4064     iSpecified->At( EApGprsReqPeakThroughput ) = aOn;
       
  4065     iSpecified->At( EApGprsReqMeanPeakThroughput ) = aOn;
       
  4066     iSpecified->At( EApGprsMinPrecedence ) = aOn;
       
  4067     iSpecified->At( EApGprsMinDelay ) = aOn;
       
  4068     iSpecified->At( EApGprsMinReliability ) = aOn;
       
  4069     iSpecified->At( EApGprsMinPeakThroughput ) = aOn;
       
  4070     iSpecified->At( EApGprsMinMeanThroughput ) = aOn;
       
  4071     iSpecified->At( EApGprsUseAnonymAccess ) = aOn;
       
  4072 
       
  4073     // followings are mapped to ISP... fields
       
  4074     iSpecified->At( EApGprsDataCompression ) = aOn;
       
  4075     iSpecified->At( EApGprsHeaderCompression ) = aOn;
       
  4076     iSpecified->At( EApGprsIfName ) = aOn;
       
  4077     iSpecified->At( EApGprsIfParams ) = aOn;
       
  4078     iSpecified->At( EApGprsIfNetworks ) = aOn;
       
  4079     iSpecified->At( EApGprsIfPromptForAuth ) = aOn;
       
  4080     iSpecified->At( EApGprsIfAuthName ) = aOn;
       
  4081     iSpecified->At( EApGprsIfAuthPassword ) = aOn;
       
  4082     iSpecified->At( EApGprsIfAuthRetries ) = aOn;
       
  4083     iSpecified->At( EApGprsIpNetMask ) = aOn;
       
  4084     iSpecified->At( EApGprsIpGateway ) = aOn;
       
  4085     iSpecified->At( EApGprsIpAddrFromServer ) = aOn;
       
  4086     iSpecified->At( EApGprsIpAddr ) = aOn;
       
  4087     iSpecified->At( EApGprsIpDnsAddrFromServer ) = aOn;
       
  4088     iSpecified->At( EApGprsIPNameServer1 ) = aOn;
       
  4089     iSpecified->At( EApGprsIPNameServer2 ) = aOn;
       
  4090     iSpecified->At( EApGprsEnableLCPExtensions ) = aOn;
       
  4091     iSpecified->At( EApGprsDisablePlainTextAuth ) = aOn;
       
  4092 
       
  4093     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyGPRS" ) ) );
       
  4094     }
       
  4095 
       
  4096 
       
  4097 // ---------------------------------------------------------
       
  4098 // CApAccessPointItem::SpecifyCDMA
       
  4099 // ---------------------------------------------------------
       
  4100 //
       
  4101 void CApAccessPointItem::SpecifyCDMA( TBool aOn )
       
  4102     {
       
  4103     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyCDMA" ) ) );
       
  4104 
       
  4105     __ASSERT_DEBUG( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  4106 
       
  4107     iSpecified->At( EApCdmaIwfName ) = aOn;
       
  4108     iSpecified->At( EApCdmaServiceOption ) = aOn;
       
  4109     iSpecified->At( EApCdmaPdpType ) = aOn;
       
  4110     iSpecified->At( EApCdmaPdpAddress ) = aOn;
       
  4111     iSpecified->At( EApCdmaReqFwdPriority ) = aOn;
       
  4112     iSpecified->At( EApCdmaReqRevPriority ) = aOn;
       
  4113     iSpecified->At( EApCdmaReqFwdBitrate ) = aOn;
       
  4114     iSpecified->At( EApCdmaReqRevBitrate ) = aOn;
       
  4115     iSpecified->At( EApCdmaReqFwdLoss ) = aOn;
       
  4116     iSpecified->At( EApCdmaReqRevLoss ) = aOn;
       
  4117     iSpecified->At( EApCdmaReqFwdMaxDelay ) = aOn;
       
  4118     iSpecified->At( EApCdmaReqRevMaxDelay ) = aOn;
       
  4119     iSpecified->At( EApCdmaMinFwdBitrate ) = aOn;
       
  4120     iSpecified->At( EApCdmaMinRevBitrate ) = aOn;
       
  4121     iSpecified->At( EApCdmaAccptFwdLoss ) = aOn;
       
  4122     iSpecified->At( EApCdmaAccptRevLoss ) = aOn;
       
  4123     iSpecified->At( EApCdmaAccptFwdMaxDelay ) = aOn;
       
  4124     iSpecified->At( EApCdmaAccptRevMaxDelay ) = aOn;
       
  4125     // CDMA2000, mapped to ISP... fields
       
  4126     iSpecified->At( EApCdmaDataCompression ) = aOn;
       
  4127     iSpecified->At( EApCdmaHeaderCompression ) = aOn;
       
  4128     iSpecified->At( EApCdmaAnonymousAccess ) = aOn;
       
  4129     iSpecified->At( EApCdmaIfName ) = aOn;
       
  4130     iSpecified->At( EApCdmaIfParams ) = aOn;
       
  4131     iSpecified->At( EApCdmaIfNetworks ) = aOn;
       
  4132     iSpecified->At( EApCdmaIfPromptForAuth ) = aOn;
       
  4133     iSpecified->At( EApCdmaIfAuthName ) = aOn;
       
  4134     iSpecified->At( EApCdmaIfAuthPassword ) = aOn;
       
  4135     iSpecified->At( EApCdmaIfAuthRetries ) = aOn;
       
  4136     iSpecified->At( EApCdmaIpNetMask ) = aOn;
       
  4137     iSpecified->At( EApCdmaIpGateway ) = aOn;
       
  4138     iSpecified->At( EApCdmaIpAddrFromServer ) = aOn;
       
  4139     iSpecified->At( EApCdmaIpAddr ) = aOn;
       
  4140     iSpecified->At( EApCdmaIpDnsAddrFromServer ) = aOn;
       
  4141     iSpecified->At( EApCdmaIPNameServer1 ) = aOn;
       
  4142     iSpecified->At( EApCdmaIPNameServer2 ) = aOn;
       
  4143     iSpecified->At( EApCdmaEnableLCPExtensions ) = aOn;
       
  4144     iSpecified->At( EApCdmaDisablePlainTextAuth ) = aOn;
       
  4145     // CDMA2000
       
  4146     iSpecified->At( EApCdmaApType ) = aOn;
       
  4147     iSpecified->At( EApCdmaQosWarningTimeout ) = aOn;
       
  4148     iSpecified->At( EApCdmaRlpMode ) = aOn;
       
  4149     // CDMA2000 deprecated Mobile IP fields
       
  4150     iSpecified->At( EApCdmaMip ) = aOn;
       
  4151     iSpecified->At( EApCdmaHomeAgentAddress ) = aOn;
       
  4152     iSpecified->At( EApCdmaMipTimeout ) = aOn;
       
  4153     // CDMA2000 specific CDMA parameters provisioned through OTA
       
  4154     iSpecified->At( EApCdmaNaiType ) = aOn;
       
  4155     iSpecified->At( EApCdmaSimpleIpAuthAlgorithm ) = aOn;
       
  4156     iSpecified->At( EApCdmaSimpleIpPapSsHandle ) = aOn;
       
  4157     iSpecified->At( EApCdmaSimpleIpChapSsHandle ) = aOn;
       
  4158     iSpecified->At( EApCdmaMipTBit ) = aOn;
       
  4159     iSpecified->At( EApCdmaMipHomeAddress ) = aOn;
       
  4160     iSpecified->At( EApCdmaMipPrimaryHomeAgent ) = aOn;
       
  4161     iSpecified->At( EApCdmaMipSecondaryHomeAgent ) = aOn;
       
  4162     iSpecified->At( EApCdmaMipMnAaaAuthAlgorithm ) = aOn;
       
  4163     iSpecified->At( EApCdmaMipMnAaaSpi ) = aOn;
       
  4164     iSpecified->At( EApCdmaMipMnAaaSsHandle ) = aOn;
       
  4165     iSpecified->At( EApCdmaMipMnHaAuthAlgorithm ) = aOn;
       
  4166     iSpecified->At( EApCdmaMipMnHaSpi ) = aOn;
       
  4167     iSpecified->At( EApCdmaMipMnHaSsHandle ) = aOn;
       
  4168 
       
  4169     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyCDMA" ) ) );
       
  4170     }
       
  4171 
       
  4172 
       
  4173 // ---------------------------------------------------------
       
  4174 // CApAccessPointItem::SpecifyWLAN
       
  4175 // ---------------------------------------------------------
       
  4176 //
       
  4177 void CApAccessPointItem::SpecifyWLAN( TBool aOn )
       
  4178     {
       
  4179     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SpecifyWLAN" ) ) );
       
  4180 
       
  4181     __ASSERT_DEBUG( iExt->iWlanData, ApCommons::Panic( ESanityCheckFailed ) );
       
  4182 
       
  4183     // WLAN, mapped to ISP... fields
       
  4184     iSpecified->At( EApWlanIfNetworks ) = aOn;
       
  4185     iSpecified->At( EApWlanIfPromptForAuth ) = aOn;
       
  4186     iSpecified->At( EApWlanIfAuthName ) = aOn;
       
  4187     iSpecified->At( EApWlanIfAuthPassword ) = aOn;
       
  4188     iSpecified->At( EApWlanIfAuthRetries ) = aOn;
       
  4189     iSpecified->At( EApWlanIpNetMask ) = aOn;
       
  4190     iSpecified->At( EApWlanIpGateway ) = aOn;
       
  4191     iSpecified->At( EApWlanIpAddrFromServer ) = aOn;
       
  4192     iSpecified->At( EApWlanIpAddr ) = aOn;
       
  4193     iSpecified->At( EApWlanIpDnsAddrFromServer ) = aOn;
       
  4194     iSpecified->At( EApWlanIPNameServer1 ) = aOn;
       
  4195     iSpecified->At( EApWlanIPNameServer2 ) = aOn;
       
  4196 
       
  4197     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SpecifyWLAN" ) ) );
       
  4198     }
       
  4199 
       
  4200 
       
  4201 // ---------------------------------------------------------
       
  4202 // CApAccessPointItem::SetDnsIpFromServer
       
  4203 // ---------------------------------------------------------
       
  4204 //
       
  4205 void CApAccessPointItem::SetDnsIpFromServer()
       
  4206     {
       
  4207     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SetDnsIpFromServer" ) ) );
       
  4208 
       
  4209     if ( ( iPrimaryDNS->Compare( KDynIpAddress ) == 0 ) &&
       
  4210          ( iSecondaryDNS->Compare( KDynIpAddress ) == 0 ) )
       
  4211         {
       
  4212         iGetDNSIPFromServer = ETrue;
       
  4213         }
       
  4214     else
       
  4215         {
       
  4216         iGetDNSIPFromServer = EFalse;
       
  4217         }
       
  4218 
       
  4219     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SetDnsIpFromServer" ) ) );
       
  4220     }
       
  4221 
       
  4222 
       
  4223 
       
  4224 // ---------------------------------------------------------
       
  4225 // CApAccessPointItem::SetIpFromServer
       
  4226 // ---------------------------------------------------------
       
  4227 //
       
  4228 void CApAccessPointItem::SetIpFromServer()
       
  4229     {
       
  4230     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SetIpFromServer" ) ) );
       
  4231 
       
  4232     if ( iIspIPAddr->Compare( KDynIpAddress ) == 0 )
       
  4233         {
       
  4234         iIspIPAddrFromServer = ETrue;
       
  4235         }
       
  4236     else
       
  4237         {
       
  4238         iIspIPAddrFromServer = EFalse;
       
  4239         }
       
  4240 
       
  4241     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SetIpFromServer" ) ) );
       
  4242     }
       
  4243 
       
  4244 
       
  4245 
       
  4246 // ---------------------------------------------------------
       
  4247 // CApAccessPointItem::SetDns6IpFromServer
       
  4248 // ---------------------------------------------------------
       
  4249 //
       
  4250 void CApAccessPointItem::SetDns6IpFromServer()
       
  4251     {
       
  4252     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SetDns6IpFromServer" ) ) );
       
  4253 
       
  4254     if ( iExt->iIsIpv6Supported )
       
  4255         {
       
  4256         if ( ( iExt->iIpv6PrimaryDNS->Compare( KDynIpv6Address ) == 0 ) &&
       
  4257              ( iExt->iIpv6SecondaryDNS->Compare( KDynIpv6Address ) == 0 ) )
       
  4258             {
       
  4259             
       
  4260             TApBearerType bt(EApBearerTypeGPRS);
       
  4261             TInt err(KErrNone);
       
  4262             TRAP( err, bt = BearerTypeL() );
       
  4263             if ( err == KErrNone )
       
  4264                 {
       
  4265                 switch (bt) 
       
  4266                     {
       
  4267                     case EApBearerTypeCSD:
       
  4268                     case EApBearerTypeHSCSD:
       
  4269                         { // consider it user defined
       
  4270                         iExt->iIpv6GetDNSIPFromServer = EFalse; 
       
  4271                         break;
       
  4272                         }
       
  4273                     default:
       
  4274                         {
       
  4275                         iExt->iIpv6GetDNSIPFromServer = ETrue;
       
  4276                         break;
       
  4277                         }
       
  4278                     }
       
  4279                 }
       
  4280             }
       
  4281         else
       
  4282             {
       
  4283             iExt->iIpv6GetDNSIPFromServer = EFalse;
       
  4284             }
       
  4285         }
       
  4286 
       
  4287     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SetDns6IpFromServer" ) ) );
       
  4288     }
       
  4289 
       
  4290 
       
  4291 // ---------------------------------------------------------
       
  4292 // CApAccessPointItem::ReAllocL
       
  4293 // ---------------------------------------------------------
       
  4294 //
       
  4295 void CApAccessPointItem::ReAllocL(HBufC8*& aDes, const TDesC8& aValue)
       
  4296     {
       
  4297     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReAllocL8" ) ) );
       
  4298 
       
  4299     // now remove 'invalid' chars (TABs) as they cause problems
       
  4300     // in other places, like listboxes...
       
  4301     HBufC8* tmp = RemoveInvalidCharsLC( aValue );
       
  4302     delete aDes;
       
  4303     aDes = tmp;
       
  4304     CleanupStack::Pop( tmp );
       
  4305 
       
  4306     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReAllocL8" ) ) );
       
  4307     }
       
  4308 
       
  4309 
       
  4310 // ---------------------------------------------------------
       
  4311 // CApAccessPointItem::ReAllocL
       
  4312 // ---------------------------------------------------------
       
  4313 //
       
  4314 void CApAccessPointItem::ReAllocL(HBufC*& aDes, const TDesC16& aValue)
       
  4315     {
       
  4316     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::ReAllocL" ) ) );
       
  4317 
       
  4318     // now remove 'invalid' chars (TABs) as they cause problems
       
  4319     // in other places, like listboxes...
       
  4320     HBufC* tmp = RemoveInvalidCharsLC( aValue );
       
  4321     delete aDes;
       
  4322     aDes = tmp;
       
  4323     CleanupStack::Pop( tmp );
       
  4324 
       
  4325     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::ReAllocL" ) ) );
       
  4326     }
       
  4327 
       
  4328 
       
  4329 
       
  4330 // ---------------------------------------------------------
       
  4331 // CApAccessPointItem::DoCompareApL
       
  4332 // ---------------------------------------------------------
       
  4333 //
       
  4334 TBool CApAccessPointItem::DoCompareApL( const CApAccessPointItem& aItem )const
       
  4335     {
       
  4336     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::DoCompareApL" ) ) );
       
  4337 
       
  4338     TBool retval( EFalse );
       
  4339     // sorry for those CONST_CASTS, but could not do it otherwise
       
  4340     // without API breask....
       
  4341     CApAccessPointItem* thisitem = CONST_CAST( CApAccessPointItem*, this );
       
  4342     CApAccessPointItem* otheritem = CONST_CAST( CApAccessPointItem*, &aItem );
       
  4343 
       
  4344     TApBearerType thisbearer = thisitem->BearerTypeL();
       
  4345     if ( thisbearer == otheritem->BearerTypeL() )
       
  4346         { // if diff. bearers, compareing might give false results
       
  4347         // compare WAP:
       
  4348             // expect IAP ID
       
  4349         if ( CompareWap( aItem ) )
       
  4350             {
       
  4351             switch ( thisbearer )
       
  4352                 {
       
  4353                 case EApBearerTypeCSD:
       
  4354                 case EApBearerTypeHSCSD:
       
  4355                     {
       
  4356                     // compare IAP
       
  4357                     if ( CompareIap( aItem ) )
       
  4358                         {
       
  4359                         // compare ISP
       
  4360                         if ( CompareIsp( aItem ) )
       
  4361                             {
       
  4362                             if ( CompareProxy( aItem ) )
       
  4363                                 {
       
  4364                                 retval = ETrue;
       
  4365                                 }
       
  4366                             }
       
  4367                         }
       
  4368                     break;
       
  4369                     }
       
  4370                 case EApBearerTypeGPRS:
       
  4371                     {
       
  4372                     // compare IAP
       
  4373                     if ( CompareIap( aItem ) )
       
  4374                         {
       
  4375                         // comapre GPRS
       
  4376                         if ( CompareGprs( aItem ) )
       
  4377                             {
       
  4378                             if ( CompareProxy( aItem ) )
       
  4379                                 {
       
  4380                                 retval = ETrue;
       
  4381                                 }
       
  4382                             }
       
  4383                         }
       
  4384                     break;
       
  4385                     }
       
  4386                 case EApBearerTypeCDMA:
       
  4387                     {
       
  4388                     // compare IAP
       
  4389                     if ( CompareIap( aItem ) )
       
  4390                         {
       
  4391                         // comapre CDMA
       
  4392                         if ( CompareCdma( aItem ) )
       
  4393                             {
       
  4394                             if ( CompareProxy( aItem ) )
       
  4395                                 {
       
  4396                                 retval = ETrue;
       
  4397                                 }
       
  4398                             }
       
  4399                         }
       
  4400                     break;
       
  4401                     }
       
  4402                 case EApBearerTypeWLAN:
       
  4403                     { 
       
  4404                     if ( iExt->iWlanData )
       
  4405                         {
       
  4406                         // Compare Iap
       
  4407                         if ( CompareIap( aItem ) )
       
  4408                             {
       
  4409                             // Check compareing for WLAN and LAN!!!
       
  4410                             // Compare WLAN
       
  4411                             if ( CompareWlan( aItem ) )
       
  4412                                 {
       
  4413                                 if ( CompareProxy( aItem ) )
       
  4414                                     {
       
  4415                                     retval = ETrue;
       
  4416                                     }
       
  4417                                 }
       
  4418                             }
       
  4419                         }
       
  4420                     else
       
  4421                         {
       
  4422                         User::Leave( KErrNotSupported );
       
  4423                         }
       
  4424                     break;
       
  4425                     }
       
  4426                 default:
       
  4427                     {
       
  4428                     // KErrInvalidBearer, but can not Leave here,
       
  4429                     // so just return False
       
  4430                     // retval is already False, nothing to do
       
  4431                     break;
       
  4432                     }
       
  4433                 }
       
  4434             }
       
  4435         }
       
  4436 
       
  4437     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::DoCompareApL" ) ) );
       
  4438     return retval;
       
  4439     }
       
  4440 
       
  4441 
       
  4442 
       
  4443 // ---------------------------------------------------------
       
  4444 // CApAccessPointItem::CompareWap
       
  4445 // ---------------------------------------------------------
       
  4446 //
       
  4447 TBool CApAccessPointItem::CompareWap( const CApAccessPointItem& aItem ) const
       
  4448     {
       
  4449     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CompareWap" ) ) );
       
  4450 
       
  4451     TBool retval( EFalse );
       
  4452 // WAP AP Table
       
  4453 /*
       
  4454 WAP_CURRENT_BEARER
       
  4455 WAP_START_PAGE
       
  4456 */
       
  4457 
       
  4458 // WAP IP Bearer Table
       
  4459 /*
       
  4460     -- WAP_ACCESS_POINT_ID
       
  4461 WAP_GATEWAY_ADDRESS
       
  4462     -- WAP_IAP
       
  4463     -- WAP_ISP
       
  4464     -- WAP_CHARGECARD
       
  4465 WAP_ISP_TYPE
       
  4466 WAP_WSP_OPTION
       
  4467 WAP_SECURITY
       
  4468 */
       
  4469 
       
  4470     if ( BOOL_COMPARE( iIsWTLSSecurityOn, aItem.iIsWTLSSecurityOn )
       
  4471        && ( iIsConnectionTypeContinuous == aItem.iIsConnectionTypeContinuous )
       
  4472        )
       
  4473         {
       
  4474         if (
       
  4475            ( iWapAccessPointName->Compare( *aItem.iWapAccessPointName ) == 0 )
       
  4476            && ( iWapBearer->Compare( *aItem.iWapBearer ) == 0 )
       
  4477            && ( iStartingPage->Compare( *aItem.iStartingPage ) == 0 )
       
  4478            && ( iWapGatewayAddress->Compare( *aItem.iWapGatewayAddress ) == 0 )
       
  4479            && ( iWapProxyLoginName->Compare(
       
  4480                                         *aItem.iWapProxyLoginName ) == 0 )
       
  4481            && ( iWapProxyLoginPass->Compare(
       
  4482                                         *aItem.iWapProxyLoginPass ) == 0 )
       
  4483             )
       
  4484             {
       
  4485             retval = ETrue;
       
  4486             }
       
  4487         }
       
  4488 
       
  4489     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CompareWap" ) ) );
       
  4490     return retval;
       
  4491     }
       
  4492 
       
  4493 
       
  4494 
       
  4495 // ---------------------------------------------------------
       
  4496 // CApAccessPointItem::CompareIap
       
  4497 // ---------------------------------------------------------
       
  4498 //
       
  4499 TBool CApAccessPointItem::CompareIap( const CApAccessPointItem& aItem ) const
       
  4500     {
       
  4501     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CompareIap" ) ) );
       
  4502 
       
  4503     TBool retval( EFalse );
       
  4504 // WAP IAP Table
       
  4505 /*
       
  4506 COMMDB_NAME
       
  4507 -- IAP_SERVICE                                      _S("IAPService")
       
  4508 IAP_SERVICE_TYPE                                _S("IAPServiceType")
       
  4509 -- IAP_CHARGECARD                                   _S("Chargecard")
       
  4510 */
       
  4511     if (
       
  4512        ( iIapName->Compare( *aItem.iIapName ) == 0 )
       
  4513         && ( iIapServiceType->Compare( *aItem.iIapServiceType ) == 0 )
       
  4514         && ( iNetworkName->Compare( *aItem.iNetworkName ) == 0 )
       
  4515         && ( iNetworkId == aItem.iNetworkId )
       
  4516         )
       
  4517         {
       
  4518         retval = ETrue;
       
  4519         }
       
  4520 
       
  4521     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CompareIap" ) ) );
       
  4522     return retval;
       
  4523     }
       
  4524 
       
  4525 
       
  4526 
       
  4527 
       
  4528 // ---------------------------------------------------------
       
  4529 // CApAccessPointItem::CompareIsp
       
  4530 // ---------------------------------------------------------
       
  4531 //
       
  4532 TBool CApAccessPointItem::CompareIsp( const CApAccessPointItem& aItem ) const
       
  4533     {
       
  4534     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CompareIsp" ) ) );
       
  4535 
       
  4536     TBool retval( EFalse );
       
  4537     if (
       
  4538         BOOL_COMPARE( iIspDialResolution , aItem.iIspDialResolution )
       
  4539         && BOOL_COMPARE( iUseLoginScript, aItem.iUseLoginScript )
       
  4540         && BOOL_COMPARE( iPromptPassword, aItem.iPromptPassword )
       
  4541         && BOOL_COMPARE( iDisplayTerminalWindow, aItem.iDisplayTerminalWindow )
       
  4542         && BOOL_COMPARE( iIspIfPromptForAuth, aItem.iIspIfPromptForAuth )
       
  4543         && iIspIfAuthRetries == aItem.iIspIfAuthRetries
       
  4544         && BOOL_COMPARE( iUseCallBack, aItem.iUseCallBack )
       
  4545         && iCallBackTypeIsServerNum == aItem.iCallBackTypeIsServerNum
       
  4546         && iIspCallbackTimeOut == aItem.iIspCallbackTimeOut
       
  4547         && BOOL_COMPARE( iIspIPAddrFromServer, aItem.iIspIPAddrFromServer )
       
  4548         && BOOL_COMPARE( iGetDNSIPFromServer, aItem.iGetDNSIPFromServer )
       
  4549         && BOOL_COMPARE( iEnablePPPCompression, aItem.iEnablePPPCompression )
       
  4550         && BOOL_COMPARE( iIspEnableLCPExtensions,
       
  4551                                 aItem.iIspEnableLCPExtensions )
       
  4552         && BOOL_COMPARE( iIsPasswordAuthenticationSecure,
       
  4553                                 aItem.iIsPasswordAuthenticationSecure )
       
  4554         && BOOL_COMPARE( iIspEnableSwCompression, 
       
  4555                                 aItem.iIspEnableSwCompression )
       
  4556         && iIspBearerName == aItem.iIspBearerName
       
  4557         && iMaxConnSpeed == aItem.iMaxConnSpeed
       
  4558         && iIspBearerCE == aItem.iIspBearerCE
       
  4559         && iApIapBearerService == aItem.iApIapBearerService
       
  4560         && iIspBearerType == aItem.iIspBearerType
       
  4561         && iBearerCallTypeIsdn == aItem.iBearerCallTypeIsdn
       
  4562         && iIspChannelCoding == aItem.iIspChannelCoding
       
  4563         && iIspAIUR == aItem.iIspAIUR
       
  4564         && iIspRequestedTimeSlots == aItem.iIspRequestedTimeSlots
       
  4565         && iIspMaximumTimeSlots == aItem.iIspMaximumTimeSlots
       
  4566         && ( 
       
  4567             ( iExt->iIsIpv6Supported 
       
  4568             && ( BOOL_COMPARE( iExt->iIpv6GetDNSIPFromServer,
       
  4569                                  aItem.iExt->iIpv6GetDNSIPFromServer ) ) )
       
  4570             || !iExt->iIsIpv6Supported )
       
  4571         )
       
  4572         {
       
  4573         if (
       
  4574             ( iIspName->Compare( *aItem.iIspName ) == 0 )
       
  4575             && ( iIspDescription->Compare( *aItem.iIspDescription ) == 0 )
       
  4576             &&
       
  4577             ( iIspDefaultTelNumber->Compare( 
       
  4578                         *aItem.iIspDefaultTelNumber ) == 0 )
       
  4579             && ( iLoginScript->Compare( *aItem.iLoginScript ) == 0 )
       
  4580             && ( iUserName->Compare( *aItem.iUserName ) == 0 )
       
  4581             && ( iPassword->Compare( *aItem.iPassword ) == 0 )
       
  4582             && ( iIspIfName->Compare( *aItem.iIspIfName ) == 0 )
       
  4583             && ( iIspIfParams->Compare( *aItem.iIspIfParams ) == 0 )
       
  4584             && ( iIspIfNetworks->Compare( *aItem.iIspIfNetworks ) == 0 )
       
  4585             && ( iIspIfAuthName->Compare( *aItem.iIspIfAuthName ) == 0 )
       
  4586             && ( iIspIfAuthPass->Compare( *aItem.iIspIfAuthPass ) == 0 )
       
  4587             &&
       
  4588             ( iIspIfCallbackInfo->Compare( *aItem.iIspIfCallbackInfo ) == 0 )
       
  4589             && ( iIspIPAddr->Compare( *aItem.iIspIPAddr ) == 0 )
       
  4590             && ( iIspIPNetMask->Compare( *aItem.iIspIPNetMask ) == 0 )
       
  4591             && ( iIspGateway->Compare( *aItem.iIspGateway ) == 0 )
       
  4592             && ( iPrimaryDNS->Compare( *aItem.iPrimaryDNS ) == 0 )
       
  4593             && ( iSecondaryDNS->Compare( *aItem.iSecondaryDNS ) == 0 )
       
  4594             && ( iIspInitString->Compare( *aItem.iIspInitString ) == 0 )
       
  4595             && (
       
  4596                ( iExt->iIsIpv6Supported && 
       
  4597                     ( 
       
  4598                         ( iExt->iIpv6PrimaryDNS->Compare( 
       
  4599                                 *aItem.iExt->iIpv6PrimaryDNS ) == 0 )
       
  4600                         && 
       
  4601                         ( iExt->iIpv6SecondaryDNS->Compare( 
       
  4602                                 *aItem.iExt->iIpv6SecondaryDNS ) == 0 )
       
  4603                     )
       
  4604                 || !iExt->iIsIpv6Supported )
       
  4605                 )
       
  4606             )
       
  4607             {
       
  4608             retval = ETrue;
       
  4609             }
       
  4610         }
       
  4611 
       
  4612     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CompareIsp" ) ) );
       
  4613     return retval;
       
  4614     }
       
  4615 
       
  4616 
       
  4617 
       
  4618 
       
  4619 // ---------------------------------------------------------
       
  4620 // CApAccessPointItem::CompareGprs
       
  4621 // ---------------------------------------------------------
       
  4622 //
       
  4623 TBool CApAccessPointItem::CompareGprs( const CApAccessPointItem& aItem ) const
       
  4624     {
       
  4625     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CompareGprs" ) ) );
       
  4626 
       
  4627     TBool retval( EFalse );
       
  4628 
       
  4629     if (
       
  4630         iGprsPdpType == aItem.iGprsPdpType
       
  4631 //
       
  4632         && BOOL_COMPARE( iIspIfPromptForAuth, aItem.iIspIfPromptForAuth )
       
  4633         && iIspIfAuthRetries == aItem.iIspIfAuthRetries
       
  4634         && BOOL_COMPARE( iIspIPAddrFromServer, aItem.iIspIPAddrFromServer )
       
  4635         && BOOL_COMPARE( iGetDNSIPFromServer, aItem.iGetDNSIPFromServer )
       
  4636         && BOOL_COMPARE( iEnablePPPCompression, aItem.iEnablePPPCompression )
       
  4637         && BOOL_COMPARE( iIspEnableLCPExtensions, 
       
  4638                                 aItem.iIspEnableLCPExtensions )
       
  4639         && BOOL_COMPARE( iIsPasswordAuthenticationSecure,
       
  4640                                 aItem.iIsPasswordAuthenticationSecure )
       
  4641         && BOOL_COMPARE( iIspEnableSwCompression, 
       
  4642                                 aItem.iIspEnableSwCompression )
       
  4643 //
       
  4644         && iGprsReqPrecedence == aItem.iGprsReqPrecedence
       
  4645         && iGprsReqDelay == aItem.iGprsReqDelay
       
  4646         && iGprsReqReliability == aItem.iGprsReqReliability
       
  4647         && iGprsReqPeakThroughput == aItem.iGprsReqPeakThroughput
       
  4648         && iGprsReqMeanPeakThroughput == aItem.iGprsReqMeanPeakThroughput
       
  4649         && iGprsMinPrecedence == aItem.iGprsMinPrecedence
       
  4650         && iGprsMinDelay == aItem.iGprsMinDelay
       
  4651         && iGprsMinReliability == aItem.iGprsMinReliability
       
  4652         && iGprsMinPeakThroughput == aItem.iGprsMinPeakThroughput
       
  4653         && iGprsMinMeanThroughput == aItem.iGprsMinMeanThroughput
       
  4654         && BOOL_COMPARE( iGprsUseAnonymAccess, aItem.iGprsUseAnonymAccess )
       
  4655         && ( 
       
  4656             ( iExt->iIsIpv6Supported 
       
  4657             && (BOOL_COMPARE( iExt->iIpv6GetDNSIPFromServer,
       
  4658                                  aItem.iExt->iIpv6GetDNSIPFromServer ) ) )
       
  4659             || ( !iExt->iIsIpv6Supported ) )
       
  4660         )
       
  4661         {
       
  4662         if (
       
  4663             ( iGprsAccessPointName->Compare( 
       
  4664                         *aItem.iGprsAccessPointName ) == 0 )
       
  4665 //
       
  4666             && ( iIspIfName->Compare( *aItem.iIspIfName ) == 0 )
       
  4667             && ( iIspIfParams->Compare( *aItem.iIspIfParams ) == 0 )
       
  4668             && ( iIspIfNetworks->Compare( *aItem.iIspIfNetworks ) == 0 )
       
  4669             && ( iIspIfAuthName->Compare( *aItem.iIspIfAuthName ) == 0 )
       
  4670             && ( iIspIfAuthPass->Compare( *aItem.iIspIfAuthPass ) == 0 )
       
  4671             && ( iIspIPAddr->Compare( *aItem.iIspIPAddr ) == 0 )
       
  4672             && ( iIspIPNetMask->Compare( *aItem.iIspIPNetMask ) == 0 )
       
  4673             && ( iIspGateway->Compare( *aItem.iIspGateway ) == 0 )
       
  4674             && ( iPrimaryDNS->Compare( *aItem.iPrimaryDNS ) == 0 )
       
  4675             && ( iSecondaryDNS->Compare( *aItem.iSecondaryDNS ) == 0 )
       
  4676 //
       
  4677             && ( iGprsPdpAddress->Compare( *aItem.iGprsPdpAddress ) == 0 )  
       
  4678             && (
       
  4679                ( iExt->iIsIpv6Supported && 
       
  4680                     ( 
       
  4681                         ( iExt->iIpv6PrimaryDNS->Compare( 
       
  4682                                 *aItem.iExt->iIpv6PrimaryDNS ) == 0 )
       
  4683                         && 
       
  4684                         ( iExt->iIpv6SecondaryDNS->Compare( 
       
  4685                                 *aItem.iExt->iIpv6SecondaryDNS ) == 0 )
       
  4686                     )
       
  4687                 || !iExt->iIsIpv6Supported )
       
  4688                 )
       
  4689             )
       
  4690             {
       
  4691             retval = ETrue;
       
  4692             }
       
  4693         }
       
  4694 
       
  4695     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CompareGprs" ) ) );
       
  4696     return retval;
       
  4697     }
       
  4698 
       
  4699 
       
  4700 
       
  4701 // ---------------------------------------------------------
       
  4702 // CApAccessPointItem::CompareCdma
       
  4703 // ---------------------------------------------------------
       
  4704 //
       
  4705 TBool CApAccessPointItem::CompareCdma( const CApAccessPointItem& aItem ) const
       
  4706     {
       
  4707     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CompareCdma" ) ) );
       
  4708 
       
  4709     TBool retval( EFalse );
       
  4710 
       
  4711     __ASSERT_ALWAYS( iExt->iCdmaData, ApCommons::Panic( ESanityCheckFailed ) );
       
  4712 
       
  4713     if (
       
  4714            iExt->iCdmaData->iServiceOption == 
       
  4715                                 aItem.iExt->iCdmaData->iServiceOption
       
  4716         && iExt->iCdmaData->iPdpType == aItem.iExt->iCdmaData->iPdpType
       
  4717         && iExt->iCdmaData->iReqFwdPriority == 
       
  4718                                 aItem.iExt->iCdmaData->iReqFwdPriority
       
  4719         && iExt->iCdmaData->iReqRevPriority == 
       
  4720                                 aItem.iExt->iCdmaData->iReqRevPriority
       
  4721         && iExt->iCdmaData->iReqFwdBitrate == 
       
  4722                                 aItem.iExt->iCdmaData->iReqFwdBitrate
       
  4723         && iExt->iCdmaData->iReqRevBitrate == 
       
  4724                                 aItem.iExt->iCdmaData->iReqRevBitrate
       
  4725         && iExt->iCdmaData->iReqFwdLoss == aItem.iExt->iCdmaData->iReqFwdLoss
       
  4726         && iExt->iCdmaData->iReqRevLoss == aItem.iExt->iCdmaData->iReqRevLoss
       
  4727         && iExt->iCdmaData->iReqFwdMaxDelay == 
       
  4728                                 aItem.iExt->iCdmaData->iReqFwdMaxDelay
       
  4729         && iExt->iCdmaData->iReqRevMaxDelay == 
       
  4730                                 aItem.iExt->iCdmaData->iReqRevMaxDelay
       
  4731         && iExt->iCdmaData->iMinFwdBitrate == 
       
  4732                                 aItem.iExt->iCdmaData->iMinFwdBitrate
       
  4733         && iExt->iCdmaData->iMinRevBitrate == 
       
  4734                                 aItem.iExt->iCdmaData->iMinRevBitrate
       
  4735         && iExt->iCdmaData->iAccptFwdLoss == 
       
  4736                                 aItem.iExt->iCdmaData->iAccptFwdLoss
       
  4737         && iExt->iCdmaData->iAccptRevLoss == 
       
  4738                                 aItem.iExt->iCdmaData->iAccptRevLoss
       
  4739         && iExt->iCdmaData->iAccptFwdMaxDelay == 
       
  4740                                 aItem.iExt->iCdmaData->iAccptFwdMaxDelay
       
  4741         && iExt->iCdmaData->iAccptRevMaxDelay == 
       
  4742                                 aItem.iExt->iCdmaData->iAccptRevMaxDelay
       
  4743 //
       
  4744         && BOOL_COMPARE( iIspIfPromptForAuth, aItem.iIspIfPromptForAuth )
       
  4745         && iIspIfAuthRetries == aItem.iIspIfAuthRetries
       
  4746         && BOOL_COMPARE( iIspIPAddrFromServer, aItem.iIspIPAddrFromServer )
       
  4747         && BOOL_COMPARE( iGetDNSIPFromServer, aItem.iGetDNSIPFromServer )
       
  4748         && BOOL_COMPARE( iEnablePPPCompression, aItem.iEnablePPPCompression )
       
  4749         && BOOL_COMPARE( iIspEnableLCPExtensions, 
       
  4750                                 aItem.iIspEnableLCPExtensions )
       
  4751         && BOOL_COMPARE( iIsPasswordAuthenticationSecure,
       
  4752                                 aItem.iIsPasswordAuthenticationSecure )
       
  4753         && BOOL_COMPARE( iIspEnableSwCompression, 
       
  4754                                 aItem.iIspEnableSwCompression )
       
  4755 //
       
  4756         && iIspType == aItem.iIspType
       
  4757         && iExt->iCdmaData->iQosWarningTimeout == 
       
  4758                                 aItem.iExt->iCdmaData->iQosWarningTimeout
       
  4759         && iExt->iCdmaData->iRlpMode == aItem.iExt->iCdmaData->iRlpMode
       
  4760         && BOOL_COMPARE( iExt->iCdmaData->iMip, aItem.iExt->iCdmaData->iMip )
       
  4761         && iExt->iCdmaData->iMipTimeout == aItem.iExt->iCdmaData->iMipTimeout
       
  4762         && iExt->iCdmaData->iNaiType == aItem.iExt->iCdmaData->iNaiType
       
  4763         && iExt->iCdmaData->iSimpleIpAuthAlgorithm == 
       
  4764                                 aItem.iExt->iCdmaData->iSimpleIpAuthAlgorithm
       
  4765         && iExt->iCdmaData->iSimpleIpPapSsHandle == 
       
  4766                                 aItem.iExt->iCdmaData->iSimpleIpPapSsHandle
       
  4767         && iExt->iCdmaData->iSimpleIpChapSsHandle == 
       
  4768                                 aItem.iExt->iCdmaData->iSimpleIpChapSsHandle
       
  4769         && iExt->iCdmaData->iMipTBit == aItem.iExt->iCdmaData->iMipTBit
       
  4770         && iExt->iCdmaData->iMipMnAaaAuthAlgorithm == 
       
  4771                                 aItem.iExt->iCdmaData->iMipMnAaaAuthAlgorithm
       
  4772         && iExt->iCdmaData->iMipMnAaaSpi == 
       
  4773                                 aItem.iExt->iCdmaData->iMipMnAaaSpi
       
  4774         && iExt->iCdmaData->iMipMnAaaSsHandle == 
       
  4775                                 aItem.iExt->iCdmaData->iMipMnAaaSsHandle
       
  4776         && iExt->iCdmaData->iMipMnHaAuthAlgorithm == 
       
  4777                                 aItem.iExt->iCdmaData->iMipMnHaAuthAlgorithm
       
  4778         && iExt->iCdmaData->iMipMnHaSpi == aItem.iExt->iCdmaData->iMipMnHaSpi
       
  4779         && iExt->iCdmaData->iMipMnHaSsHandle == 
       
  4780                                 aItem.iExt->iCdmaData->iMipMnHaSsHandle
       
  4781 //
       
  4782         && BOOL_COMPARE( iGprsUseAnonymAccess, aItem.iGprsUseAnonymAccess )
       
  4783         && ( 
       
  4784             ( iExt->iIsIpv6Supported 
       
  4785             && ( BOOL_COMPARE( iExt->iIpv6GetDNSIPFromServer, 
       
  4786                                  aItem.iExt->iIpv6GetDNSIPFromServer ) ) )
       
  4787             || ( !iExt->iIsIpv6Supported ) )
       
  4788         )
       
  4789         {
       
  4790         if (
       
  4791                ( iExt->iCdmaData->iIwfName->Compare( 
       
  4792                         *aItem.iExt->iCdmaData->iIwfName ) == 0 )
       
  4793             && ( iExt->iCdmaData->iPdpAddress->Compare( 
       
  4794                         *aItem.iExt->iCdmaData->iPdpAddress ) == 0 )
       
  4795             && ( iExt->iCdmaData->iHomeAgentAddress->Compare( 
       
  4796                         *aItem.iExt->iCdmaData->iHomeAgentAddress ) == 0 )
       
  4797             && ( iExt->iCdmaData->iMipHomeAddress->Compare( 
       
  4798                         *aItem.iExt->iCdmaData->iMipHomeAddress ) == 0 )
       
  4799             && ( iExt->iCdmaData->iMipPrimaryHomeAgent->Compare( 
       
  4800                         *aItem.iExt->iCdmaData->iMipPrimaryHomeAgent ) == 0 )
       
  4801             && ( iExt->iCdmaData->iMipSecondaryHomeAgent->Compare( 
       
  4802                         *aItem.iExt->iCdmaData->iMipSecondaryHomeAgent ) == 0 )
       
  4803 //
       
  4804             && ( iIspIfName->Compare( *aItem.iIspIfName ) == 0 )
       
  4805             && ( iIspIfParams->Compare( *aItem.iIspIfParams ) == 0 )
       
  4806             && ( iIspIfNetworks->Compare( *aItem.iIspIfNetworks ) == 0 )
       
  4807             && ( iIspIfAuthName->Compare( *aItem.iIspIfAuthName ) == 0 )
       
  4808             && ( iIspIfAuthPass->Compare( *aItem.iIspIfAuthPass ) == 0 )
       
  4809             && ( iIspIPAddr->Compare( *aItem.iIspIPAddr ) == 0 )
       
  4810             && ( iIspIPNetMask->Compare( *aItem.iIspIPNetMask ) == 0 )
       
  4811             && ( iIspGateway->Compare( *aItem.iIspGateway ) == 0 )
       
  4812             && ( iPrimaryDNS->Compare( *aItem.iPrimaryDNS ) == 0 )
       
  4813             && ( iSecondaryDNS->Compare( *aItem.iSecondaryDNS ) == 0 )
       
  4814 //
       
  4815             && (
       
  4816                ( iExt->iIsIpv6Supported && 
       
  4817                     ( 
       
  4818                         ( iExt->iIpv6PrimaryDNS->Compare( 
       
  4819                                 *aItem.iExt->iIpv6PrimaryDNS ) == 0 )
       
  4820                         && 
       
  4821                         ( iExt->iIpv6SecondaryDNS->Compare( 
       
  4822                                 *aItem.iExt->iIpv6SecondaryDNS ) == 0 )
       
  4823                     )
       
  4824                 || !iExt->iIsIpv6Supported )
       
  4825                 )
       
  4826             )
       
  4827             {
       
  4828             retval = ETrue;
       
  4829             }
       
  4830         }
       
  4831 
       
  4832     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CompareCdma" ) ) );
       
  4833     return retval;
       
  4834     }
       
  4835 
       
  4836 
       
  4837 
       
  4838 // ---------------------------------------------------------
       
  4839 // CApAccessPointItem::CompareWlan
       
  4840 // ---------------------------------------------------------
       
  4841 //
       
  4842 TBool CApAccessPointItem::CompareWlan( const CApAccessPointItem& aItem ) const
       
  4843     {
       
  4844     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CompareWlan" ) ) );
       
  4845 
       
  4846     TBool retval( EFalse );
       
  4847 
       
  4848     __ASSERT_ALWAYS( iExt->iWlanData, ApCommons::Panic( ESanityCheckFailed ) );
       
  4849     __ASSERT_ALWAYS( aItem.iExt->iWlanData, 
       
  4850                      ApCommons::Panic( ESanityCheckFailed ) );
       
  4851 
       
  4852     if (  
       
  4853          iExt->iWlanData->iWlanNetworkMode == 
       
  4854                                 aItem.iExt->iWlanData->iWlanNetworkMode
       
  4855          && iExt->iWlanData->iScanSSID == aItem.iExt->iWlanData->iScanSSID
       
  4856          && iExt->iWlanData->iWlanSecurityMode == 
       
  4857                                 aItem.iExt->iWlanData->iWlanSecurityMode
       
  4858          && iExt->iWlanData->iChannelId == 
       
  4859                                 aItem.iExt->iWlanData->iChannelId
       
  4860         && BOOL_COMPARE( iGetDNSIPFromServer, aItem.iGetDNSIPFromServer )
       
  4861         )        
       
  4862         {
       
  4863         if (   ( iExt->iWlanData->iWlanNetworkName->Compare( 
       
  4864                     *aItem.iExt->iWlanData->iWlanNetworkName ) == 0 )
       
  4865             && ( iIspIPAddr->Compare( *aItem.iIspIPAddr ) == 0 )
       
  4866             && ( iIspIPNetMask->Compare( *aItem.iIspIPNetMask ) == 0 )
       
  4867             && ( iIspGateway->Compare( *aItem.iIspGateway ) == 0 )
       
  4868             && ( iPrimaryDNS->Compare( *aItem.iPrimaryDNS ) == 0 )
       
  4869             && ( iSecondaryDNS->Compare( *aItem.iSecondaryDNS ) == 0 )
       
  4870 // Check if AuthName is needed or not
       
  4871 //            && ( iIspIfAuthName->Compare( *aItem.iIspIfAuthName ) == 0 )
       
  4872             )
       
  4873             {
       
  4874             retval = ETrue;
       
  4875             }
       
  4876         }
       
  4877 
       
  4878     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CompareWlan" ) ) );
       
  4879     return retval;
       
  4880     }
       
  4881 
       
  4882 
       
  4883 // ---------------------------------------------------------
       
  4884 // CApAccessPointItem::GetCleanIpAddressLC
       
  4885 // ---------------------------------------------------------
       
  4886 //
       
  4887 HBufC* CApAccessPointItem::GetCleanIpAddressLC( const TDesC& aValue )
       
  4888     {
       
  4889     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::GetCleanIpAddressLC" ) ) );
       
  4890 
       
  4891     TBuf<256> buf;
       
  4892     TInetAddr in;
       
  4893     User::LeaveIfError( in.Input( aValue ) );
       
  4894     in.Output( buf );
       
  4895 
       
  4896     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::GetCleanIpAddressLC" ) ) );
       
  4897     return buf.AllocLC();
       
  4898     }
       
  4899 
       
  4900 
       
  4901 
       
  4902 // ---------------------------------------------------------
       
  4903 // CApAccessPointItem::GetPlainPhoneNumberLC
       
  4904 // ---------------------------------------------------------
       
  4905 //
       
  4906 HBufC* CApAccessPointItem::GetPlainPhoneNumberLC( const TDesC& aNumber )
       
  4907     {
       
  4908     CLOG( ( EApItem, 0, 
       
  4909             _L( "-> CApAccessPointItem::GetPlainPhoneNumberLC" ) ) );
       
  4910 
       
  4911     // Removes invalid chars e.g. space, () from the passed phone number.
       
  4912     // (valid are 0,1,2,..9,p,w,+,*,#)
       
  4913     // Strips pre- and postfixes, prefix separator is#,
       
  4914     // postfix separators are p, w or +
       
  4915     HBufC* retval = NULL;
       
  4916 
       
  4917     HBufC* numbuf = RemoveInvalidPhoneCharsLC( aNumber );
       
  4918     TPtr16 num( numbuf->Des() );
       
  4919 
       
  4920     TInt prefixpos( 0 );
       
  4921     TInt postfixpos( 0 );
       
  4922     TInt lasthashmark = num.LocateReverse('#');
       
  4923     if ( lasthashmark != KErrNotFound )
       
  4924         { // has prefix
       
  4925         prefixpos = ++lasthashmark;
       
  4926         }
       
  4927     else
       
  4928         { // no prefix
       
  4929         prefixpos = 0;
       
  4930         }
       
  4931     // now get postfixes, if any
       
  4932     // be carefull not to say postfix for the international code...
       
  4933     // as can be more than one postfix, get each postfix-separator type's
       
  4934     // position and use the lowest one
       
  4935     TInt ppos( 0 );
       
  4936     TInt wpos( 0 );
       
  4937     TInt pluspos( 0 );
       
  4938     TInt tmppos( 0 );
       
  4939 
       
  4940     tmppos = num.Locate( '+' );
       
  4941     if ( tmppos != KErrNotFound )
       
  4942         {
       
  4943         pluspos = tmppos;
       
  4944         if ( tmppos == 0 )
       
  4945             { // possibly country code comes, get next if any
       
  4946             // also inc. prefixpos
       
  4947             prefixpos++;
       
  4948             num = num.Right( num.Length() - 1 );
       
  4949             tmppos = num.Locate( '+' );
       
  4950             if ( tmppos != KErrNotFound )
       
  4951                 {
       
  4952                 tmppos = pluspos;
       
  4953                 }
       
  4954             }
       
  4955         }
       
  4956 
       
  4957     tmppos = num.Locate( 'p' );
       
  4958     if ( tmppos != KErrNotFound )
       
  4959         {
       
  4960         ppos = tmppos;
       
  4961         num = num.Left( num.Length() - ppos );
       
  4962         }
       
  4963     tmppos = num.LocateReverse( 'w' );
       
  4964     if ( tmppos != KErrNotFound )
       
  4965         {
       
  4966         wpos = tmppos;
       
  4967         num = num.Left( num.Length() - wpos );
       
  4968         }
       
  4969     // now we have 3 positions,
       
  4970     // decide which is the smallest but greater than 0
       
  4971     // if all is 0, it is 0...
       
  4972     if ( wpos )
       
  4973         {
       
  4974         postfixpos = wpos;
       
  4975         }
       
  4976     else
       
  4977         {
       
  4978         if ( ppos )
       
  4979             {
       
  4980             postfixpos = ppos;
       
  4981             }
       
  4982         else
       
  4983             {
       
  4984             if ( pluspos )
       
  4985                 {
       
  4986                 postfixpos = pluspos;
       
  4987                 }
       
  4988             }
       
  4989         }
       
  4990     // now we have pre- and postfix positions, get the resulting string
       
  4991     if ( postfixpos == 0 )
       
  4992         {
       
  4993         postfixpos = aNumber.Length();
       
  4994         }
       
  4995     retval = aNumber.Mid( prefixpos, postfixpos-prefixpos ).AllocLC();
       
  4996     CleanupStack::Pop( retval ); // retval
       
  4997     CleanupStack::PopAndDestroy( numbuf ); // numbuf
       
  4998     CleanupStack::PushL( retval );
       
  4999 
       
  5000     CLOG( ( EApItem, 1, 
       
  5001             _L( "<- CApAccessPointItem::GetPlainPhoneNumberLC" ) ) );
       
  5002     return retval;
       
  5003     }
       
  5004 
       
  5005 
       
  5006 
       
  5007 
       
  5008 
       
  5009 // ---------------------------------------------------------
       
  5010 // CApAccessPointItem::IsSamePhoneNumber
       
  5011 // ---------------------------------------------------------
       
  5012 //
       
  5013 TBool CApAccessPointItem::IsSamePhoneNumberL( CApAccessPointItem& aItem )
       
  5014     {
       
  5015     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::IsSamePhoneNumberL" ) ) );
       
  5016 
       
  5017     TBool retval( EFalse );
       
  5018 
       
  5019     HBufC* tmpphone = 
       
  5020         HBufC::NewLC( aItem.ReadTextLengthL( EApIspDefaultTelNumber ) );
       
  5021     TPtr16 tmpptr( tmpphone->Des() );
       
  5022     aItem.ReadTextL( EApIspDefaultTelNumber, tmpptr );
       
  5023 
       
  5024     HBufC* ph1 = GetPlainPhoneNumberLC( *iIspDefaultTelNumber );
       
  5025     HBufC* ph2 = GetPlainPhoneNumberLC( tmpptr );
       
  5026     TInt cl ( 7 );
       
  5027     cl = Min( cl, ph1->Length() );
       
  5028     cl = Min( cl, ph2->Length() );
       
  5029     TPtrC16 ptr1 = ph1->Right( cl );
       
  5030     TPtrC16 ptr2 = ph2->Right( cl );
       
  5031     if ( ptr1.Compare( ptr2 ) == 0 )
       
  5032         {
       
  5033         retval = ETrue;
       
  5034         }
       
  5035     CleanupStack::PopAndDestroy( 3, tmpphone ); // ph1, ph2, tmpphone
       
  5036 
       
  5037     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::IsSamePhoneNumberL" ) ) );
       
  5038     return retval;
       
  5039     }
       
  5040 
       
  5041 
       
  5042 
       
  5043 // ---------------------------------------------------------
       
  5044 // CApAccessPointItem::RemoveInvalidPhoneCharsLC
       
  5045 // ---------------------------------------------------------
       
  5046 //
       
  5047 HBufC* CApAccessPointItem::RemoveInvalidPhoneCharsLC( const TDesC16& aInText )
       
  5048     {
       
  5049     CLOG( ( EApItem, 0, 
       
  5050             _L( "-> CApAccessPointItem::RemoveInvalidPhoneCharsLC" ) ) );
       
  5051 
       
  5052     // valid are 0,1,2,..9,p,w,+,*,#
       
  5053     TInt size = aInText.Length();
       
  5054     HBufC* aOutText = HBufC::NewLC( size );
       
  5055     TPtr ptr = aOutText->Des();
       
  5056 
       
  5057     for(TInt i = 0; i< size; i++)
       
  5058         {
       
  5059         //TText ch = aInText[i];
       
  5060         TChar ch = aInText[i];
       
  5061         if ( ( ch == 'p' ) || ( ch == 'P' ) || ( ch == 'W' ) || ( ch == 'W' )
       
  5062             || ( ch == '+' ) || ( ch == '0' ) || ( ch == '1' ) || ( ch == '2' )
       
  5063             || ( ch == '3' ) || ( ch == '4' ) || ( ch == '5' ) || ( ch == '6' )
       
  5064             || ( ch == '7' ) || ( ch == '8' ) || ( ch == '9' ) || ( ch == '*' )
       
  5065             || ( ch == '#' )
       
  5066             )
       
  5067             {
       
  5068             ptr.Append( ch );
       
  5069             }
       
  5070         }
       
  5071 
       
  5072     CLOG( ( EApItem, 1, 
       
  5073             _L( "<- CApAccessPointItem::RemoveInvalidPhoneCharsLC" ) ) );
       
  5074     return aOutText;
       
  5075     }
       
  5076 
       
  5077 
       
  5078 
       
  5079 // ---------------------------------------------------------
       
  5080 // CApAccessPointItem::RemoveInvalidCharsLC
       
  5081 // ---------------------------------------------------------
       
  5082 //
       
  5083 HBufC* CApAccessPointItem::RemoveInvalidCharsLC( const TDesC16& aInText )
       
  5084     {
       
  5085     CLOG( ( EApItem, 0, 
       
  5086             _L( "-> CApAccessPointItem::RemoveInvalidCharsLC" ) ) );
       
  5087 
       
  5088     TInt size = aInText.Length();
       
  5089     HBufC* aOutText = HBufC::NewLC( size );
       
  5090     TPtr ptr = aOutText->Des();
       
  5091 
       
  5092     for ( TInt ii=0; ii<size; ++ii )
       
  5093         {
       
  5094         TText ch = aInText[ii];
       
  5095         if ( ch == CEditableText::ETabCharacter )
       
  5096             {
       
  5097             ch = ' ';
       
  5098             }
       
  5099         ptr.Append( ch );
       
  5100         }
       
  5101 
       
  5102     CLOG( ( EApItem, 1, 
       
  5103             _L( "<- CApAccessPointItem::RemoveInvalidCharsLC" ) ) );
       
  5104     return aOutText;
       
  5105     }
       
  5106 
       
  5107 
       
  5108 
       
  5109 // ---------------------------------------------------------
       
  5110 // CApAccessPointItem::RemoveInvalidCharsLC
       
  5111 // ---------------------------------------------------------
       
  5112 //
       
  5113 HBufC8* CApAccessPointItem::RemoveInvalidCharsLC( const TDesC8& aInText )
       
  5114     {
       
  5115     CLOG( ( EApItem, 0, 
       
  5116             _L( "-> CApAccessPointItem::RemoveInvalidCharsLC8" ) ) );
       
  5117 
       
  5118     TInt size = aInText.Length();
       
  5119     HBufC8* aOutText = HBufC8::NewLC( size );
       
  5120     TPtr8 ptr = aOutText->Des();
       
  5121 
       
  5122     for ( TInt ii=0; ii<size; ++ii )
       
  5123         {
       
  5124         TText ch = aInText[ii];
       
  5125         if ( ch == CEditableText::ETabCharacter )
       
  5126             {
       
  5127             ch = ' ';
       
  5128             }
       
  5129         ptr.Append( ch );
       
  5130         }
       
  5131 
       
  5132     CLOG( ( EApItem, 1, 
       
  5133             _L( "<- CApAccessPointItem::RemoveInvalidCharsLC8" ) ) );
       
  5134     return aOutText;
       
  5135     }
       
  5136 
       
  5137 
       
  5138 // ---------------------------------------------------------
       
  5139 // CApAccessPointItem::CompareProxy
       
  5140 // ---------------------------------------------------------
       
  5141 //
       
  5142 TBool CApAccessPointItem::CompareProxy( const CApAccessPointItem& aItem ) const
       
  5143     {
       
  5144     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::CompareProxy" ) ) );
       
  5145 
       
  5146     TBool retval( EFalse );
       
  5147     if ( BOOL_COMPARE( iApHasProxySettings, aItem.iApHasProxySettings )
       
  5148          && iApProxyPortNumber == aItem.iApProxyPortNumber
       
  5149          && BOOL_COMPARE( iApProxyUseProxy, iApProxyUseProxy )
       
  5150          && ( iApProxyProtocolName->Compare( 
       
  5151                         *aItem.iApProxyProtocolName ) == 0 )
       
  5152          && ( iApProxyServerAddress->Compare( 
       
  5153                         *aItem.iApProxyServerAddress ) == 0 )
       
  5154          && ( iApProxyExceptions->Compare( *aItem.iApProxyExceptions ) == 0 ) )
       
  5155         {
       
  5156         retval = ETrue;
       
  5157         }
       
  5158 
       
  5159     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::CompareProxy" ) ) );
       
  5160     return retval;
       
  5161     }
       
  5162 
       
  5163 
       
  5164 // ---------------------------------------------------------
       
  5165 // CApAccessPointItem::HasProxy
       
  5166 // ---------------------------------------------------------
       
  5167 //
       
  5168 TBool CApAccessPointItem::HasProxy() const
       
  5169     {
       
  5170     CLOG( ( EApItem, 0, _L( "<-> CApAccessPointItem::HasProxy" ) ) );
       
  5171 
       
  5172     return iApHasProxySettings;
       
  5173     }
       
  5174 
       
  5175 
       
  5176 
       
  5177 // ---------------------------------------------------------
       
  5178 // CApAccessPointItem::SetProxyFlag
       
  5179 // ---------------------------------------------------------
       
  5180 //
       
  5181 void CApAccessPointItem::SetProxyFlag()
       
  5182     {
       
  5183     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::SetProxyFlag" ) ) );
       
  5184 
       
  5185     if ( ( iApProxyServerAddress->Compare( KDynIpAddress ) 
       
  5186          && iApProxyServerAddress->Compare( KEmpty ) )
       
  5187          || ( iApProxyPortNumber != 0 ) )
       
  5188         {
       
  5189         iApHasProxySettings = ETrue;
       
  5190         }
       
  5191     else
       
  5192         {
       
  5193         iApHasProxySettings = EFalse;
       
  5194         }
       
  5195     // BY DEFAULT, as it is not accessible on the UI,
       
  5196     // we set the USE PROXY flag if ANY proxy setting is defined...
       
  5197     iApProxyUseProxy = iApHasProxySettings;
       
  5198 
       
  5199     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::SetProxyFlag" ) ) );
       
  5200     }
       
  5201 
       
  5202 
       
  5203 
       
  5204 
       
  5205 //----------------------------------------------------------
       
  5206 // CApAccessPointItem::LimitSpeed
       
  5207 //----------------------------------------------------------
       
  5208 //
       
  5209 void CApAccessPointItem::LimitSpeedL()
       
  5210     {
       
  5211     CLOG( ( EApItem, 0, _L( "-> CApAccessPointItem::LimitSpeedL" ) ) );
       
  5212 
       
  5213     TBool isWcdma = iExt->iIsWcdma;
       
  5214     TApBearerType bearer = BearerTypeL();
       
  5215     const TInt* actSpeeds = NULL;
       
  5216     switch ( bearer )
       
  5217         {
       
  5218         case EApBearerTypeCSD:
       
  5219             {
       
  5220             switch ( iBearerCallTypeIsdn )
       
  5221                 {
       
  5222                 case ECallTypeISDNv110:
       
  5223                     {
       
  5224                     isWcdma ? actSpeeds = KCsdIsdn110Wcdma :
       
  5225                               actSpeeds = KCsdIsdn110;
       
  5226                     break;
       
  5227                     }
       
  5228                 case ECallTypeISDNv120:
       
  5229                     {
       
  5230                     isWcdma ? actSpeeds = KCsdIsdn120Wcdma :
       
  5231                               actSpeeds = KCsdIsdn120;
       
  5232                     break;
       
  5233                     }
       
  5234                 case ECallTypeAnalogue:
       
  5235                 default:
       
  5236                     {
       
  5237                     isWcdma ? actSpeeds = KCsdAnalogueWcdma :
       
  5238                               actSpeeds = KCsdAnalogue;
       
  5239                     break;
       
  5240                     }
       
  5241                 }
       
  5242             break;
       
  5243             }
       
  5244         case EApBearerTypeHSCSD:
       
  5245             {
       
  5246             switch ( iBearerCallTypeIsdn )
       
  5247                 {
       
  5248                 case ECallTypeISDNv110:
       
  5249                     {
       
  5250                     actSpeeds = KHcsdIsdn110;
       
  5251                     break;
       
  5252                     }
       
  5253                 case ECallTypeISDNv120:
       
  5254                     {
       
  5255                     actSpeeds = KHcsdIsdn120;
       
  5256                     break;
       
  5257                     }
       
  5258                 case ECallTypeAnalogue:
       
  5259                 default:
       
  5260                     {
       
  5261                     actSpeeds = KHcsdAnal;
       
  5262                     break;
       
  5263                     }
       
  5264                 }
       
  5265             break;
       
  5266             }
       
  5267         default:
       
  5268             {
       
  5269             break;
       
  5270             }
       
  5271         }
       
  5272 
       
  5273 
       
  5274     if( actSpeeds )
       
  5275         {
       
  5276         TInt tempSpeed = *actSpeeds;
       
  5277         TInt nextSpeed = *( actSpeeds + 1);
       
  5278         while ( ( nextSpeed != KEndOfArray ) 
       
  5279                 && ( tempSpeed < ( TInt )iMaxConnSpeed ) 
       
  5280                 && ( nextSpeed <= ( TInt )iMaxConnSpeed ) )
       
  5281             {
       
  5282             tempSpeed = *( ++actSpeeds );
       
  5283             nextSpeed = *( actSpeeds + 1);
       
  5284             }
       
  5285         iMaxConnSpeed = ( TApCallSpeed )tempSpeed ;
       
  5286         }
       
  5287 
       
  5288     CLOG( ( EApItem, 1, _L( "<- CApAccessPointItem::LimitSpeedL" ) ) );
       
  5289     }
       
  5290 
       
  5291 
       
  5292 
       
  5293 //----------------------------------------------------------
       
  5294 // CApAccessPointItem::SetIfNetworksL
       
  5295 //----------------------------------------------------------
       
  5296 //
       
  5297 void CApAccessPointItem::SetIfNetworksL()
       
  5298     {
       
  5299     // Check if Wlan affects this one!!!
       
  5300     // Check if Lan affects this one!!!
       
  5301     TApBearerType bearertype = BearerTypeL();
       
  5302     if ( iExt->iIsIpv6Supported )
       
  5303         {
       
  5304         if ( bearertype == EApBearerTypeGPRS )
       
  5305             {
       
  5306             if ( iGprsPdpType  == EIPv6 )
       
  5307                 {
       
  5308                 WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv6 );
       
  5309                 }
       
  5310             else
       
  5311                 {
       
  5312                 WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv4 );
       
  5313                 }
       
  5314             }
       
  5315         else if ( bearertype == EApBearerTypeCDMA )
       
  5316             {
       
  5317             __ASSERT_ALWAYS( iExt->iCdmaData, \
       
  5318                 ApCommons::Panic( ESanityCheckFailed ) );
       
  5319             if ( iExt->iCdmaData->iPdpType  == EIPv6 )
       
  5320                 {
       
  5321                 WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv6 );
       
  5322                 }
       
  5323             else
       
  5324                 {
       
  5325                 WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv4 );
       
  5326                 }
       
  5327             }
       
  5328         else 
       
  5329             {
       
  5330 #ifdef __TEST_LAN_BEARER
       
  5331             if ( bearertype == EApBearerTypeLAN )
       
  5332                 {
       
  5333                 WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv4IPv6LAN );
       
  5334                 }            
       
  5335 #endif// __TEST_LAN_BEARER
       
  5336             if ( ( bearertype == EApBearerTypeWLAN ) 
       
  5337                 || ( bearertype == EApBearerTypeLANModem ) )
       
  5338                 {
       
  5339                 WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv4IPv6LAN );
       
  5340                 }
       
  5341             else
       
  5342                 { // CSD, HSCSD
       
  5343                 WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv4IPv6 );
       
  5344                 }
       
  5345             }
       
  5346         }
       
  5347     else
       
  5348         {
       
  5349         WriteTextL( EApIspIfNetworks, KDefIspIfNetworksIPv4 );
       
  5350         }
       
  5351     }
       
  5352 
       
  5353 
       
  5354 //----------------------------------------------------------
       
  5355 // CApAccessPointItem::IsSupported
       
  5356 //----------------------------------------------------------
       
  5357 //
       
  5358 TBool CApAccessPointItem::IsSupported( TApMember aColumn )
       
  5359     {
       
  5360     TBool ret( ETrue );
       
  5361 
       
  5362     switch ( aColumn )
       
  5363         {
       
  5364         case EApCdmaIwfName:
       
  5365         case EApCdmaServiceOption:
       
  5366         case EApCdmaPdpType:
       
  5367         case EApCdmaPdpAddress:
       
  5368         case EApCdmaReqFwdPriority:
       
  5369         case EApCdmaReqRevPriority:
       
  5370         case EApCdmaReqFwdBitrate:
       
  5371         case EApCdmaReqRevBitrate:
       
  5372         case EApCdmaReqFwdLoss:
       
  5373         case EApCdmaReqRevLoss:
       
  5374         case EApCdmaReqFwdMaxDelay:
       
  5375         case EApCdmaReqRevMaxDelay:
       
  5376         case EApCdmaMinFwdBitrate:
       
  5377         case EApCdmaMinRevBitrate:
       
  5378         case EApCdmaAccptFwdLoss:
       
  5379         case EApCdmaAccptRevLoss:
       
  5380         case EApCdmaAccptFwdMaxDelay:
       
  5381         case EApCdmaAccptRevMaxDelay:
       
  5382         case EApCdmaDataCompression:
       
  5383         case EApCdmaHeaderCompression:
       
  5384         case EApCdmaAnonymousAccess:
       
  5385         case EApCdmaIfName:
       
  5386         case EApCdmaIfParams:
       
  5387         case EApCdmaIfNetworks:
       
  5388         case EApCdmaIfPromptForAuth:
       
  5389         case EApCdmaIfAuthName:
       
  5390         case EApCdmaIfAuthPassword:
       
  5391         case EApCdmaIfAuthRetries:
       
  5392         case EApCdmaIpNetMask:
       
  5393         case EApCdmaIpGateway:
       
  5394         case EApCdmaIpAddrFromServer:
       
  5395         case EApCdmaIpAddr:
       
  5396         case EApCdmaIpDnsAddrFromServer:
       
  5397         case EApCdmaIPNameServer1:
       
  5398         case EApCdmaIPNameServer2:
       
  5399         case EApCdmaEnableLCPExtensions:
       
  5400         case EApCdmaDisablePlainTextAuth:
       
  5401         case EApCdmaApType:
       
  5402         case EApCdmaQosWarningTimeout:
       
  5403         case EApCdmaRlpMode:
       
  5404         case EApCdmaMip:
       
  5405         case EApCdmaHomeAgentAddress:
       
  5406         case EApCdmaMipTimeout:
       
  5407         case EApCdmaNaiType:
       
  5408         case EApCdmaSimpleIpAuthAlgorithm:
       
  5409         case EApCdmaSimpleIpPapSsHandle:
       
  5410         case EApCdmaSimpleIpChapSsHandle:
       
  5411         case EApCdmaMipTBit:
       
  5412         case EApCdmaMipHomeAddress:
       
  5413         case EApCdmaMipPrimaryHomeAgent:
       
  5414         case EApCdmaMipSecondaryHomeAgent:
       
  5415         case EApCdmaMipMnAaaAuthAlgorithm:
       
  5416         case EApCdmaMipMnAaaSpi:
       
  5417         case EApCdmaMipMnAaaSsHandle:
       
  5418         case EApCdmaMipMnHaAuthAlgorithm:
       
  5419         case EApCdmaMipMnHaSpi:
       
  5420         case EApCdmaMipMnHaSsHandle:
       
  5421             {
       
  5422             ret = iExt->iCdmaData != NULL;
       
  5423             break;
       
  5424             }
       
  5425         case EApWlanNetworkName:
       
  5426         case EApWlanNetworkMode:
       
  5427         case EApWlanSecurityMode:
       
  5428         case EApWlanScanSSID:
       
  5429         case EApWlanChannelId:
       
  5430             {
       
  5431             ret = iExt->iWlanData != NULL;
       
  5432             break;
       
  5433             }
       
  5434 
       
  5435         default:
       
  5436             {
       
  5437             break;
       
  5438             }
       
  5439         }
       
  5440 
       
  5441     return ret;
       
  5442     }
       
  5443 
       
  5444 //----------------------------------------------------------
       
  5445 // CApAccessPointItem::LeaveIfUnsupportedL
       
  5446 //----------------------------------------------------------
       
  5447 //
       
  5448 void CApAccessPointItem::LeaveIfUnsupportedL( TApMember aColumn )
       
  5449     {
       
  5450     if( !IsSupported( aColumn ) )
       
  5451         {
       
  5452         User::Leave( KErrNotSupported );
       
  5453         }
       
  5454     }
       
  5455 
       
  5456 
       
  5457 
       
  5458 
       
  5459 //----------------------------------------------------------
       
  5460 // CApAccessPointItem::IsWlan
       
  5461 //----------------------------------------------------------
       
  5462 //
       
  5463 TBool CApAccessPointItem::IsWlan()
       
  5464     {
       
  5465     TBool retval( EFalse );
       
  5466     if ( iExt->iWlanData )
       
  5467         {
       
  5468         retval = iExt->iWlanData->iIsWlan;
       
  5469         }
       
  5470     return retval;
       
  5471     }
       
  5472 
       
  5473 
       
  5474 //----------------------------------------------------------
       
  5475 // CApAccessPointItem::LimitIp6DNSL
       
  5476 //----------------------------------------------------------
       
  5477 //
       
  5478 void CApAccessPointItem::LimitIp6DNSL()
       
  5479     {
       
  5480     if ( iExt->iIsIpv6Supported )
       
  5481         {
       
  5482         if ( ( iExt->iIpv6PrimaryDNS->Compare( KDynIpv6Address ) == 0 ) &&
       
  5483              ( iExt->iIpv6SecondaryDNS->Compare( KDynIpv6Address ) == 0 ) )
       
  5484             {
       
  5485             WriteTextL( EApIP6NameServer1, KWellKnownIp6PrimaryNameServer );
       
  5486             WriteTextL( EApIP6NameServer2, KWellKnownIp6SecondaryNameServer );
       
  5487             }
       
  5488         }
       
  5489     
       
  5490     }
       
  5491     
       
  5492 //  End of File