vpnengine/ikeutils/src/internaladdress.cpp
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Internal address structure
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // CLASS HEADER
       
    20 #include "internaladdress.h"
       
    21 
       
    22 EXPORT_C CInternalAddress::CInternalAddress( TInt aGranularity )
       
    23  : CArrayPtrFlat<TInetAddr>( aGranularity )
       
    24     {    
       
    25     }
       
    26 
       
    27 CInternalAddress::~CInternalAddress()
       
    28     {
       
    29     ResetAndDestroy();
       
    30     }
       
    31 
       
    32 EXPORT_C CInternalAddress* CInternalAddress::NewL( const CInternalAddress& aData )
       
    33     {
       
    34     CInternalAddress* internalAddr = new (ELeave) CInternalAddress(1);
       
    35     internalAddr->CopyL(aData);
       
    36     return internalAddr;
       
    37     }   
       
    38 
       
    39 EXPORT_C void CInternalAddress::CopyL( const CInternalAddress& aData )
       
    40     {
       
    41     for ( TInt i=0; i<aData.Count(); i++ )
       
    42         {
       
    43         TInetAddr* dns_addr = new (ELeave) TInetAddr(*(aData.At(i)));
       
    44         CleanupStack::PushL(dns_addr);
       
    45         AppendL(dns_addr);
       
    46         CleanupStack::Pop();
       
    47         }
       
    48     iClientIntAddr = aData.iClientIntAddr;
       
    49     }