commsfwutils/commsbufs/reference/loopback_bearer/src/provision.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     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: 
       
    15 *
       
    16 */
       
    17 #include <comms-infras/ss_log.h>
       
    18 #include <in_sock.h>
       
    19 #include <comms-infras/metadata.h>
       
    20 #include <comms-infras/coremcpractivities.h>
       
    21 #include <comms-infras/ss_tiermanagerutils.h>
       
    22 #include "mcpr.h"
       
    23 #include "provision.h"
       
    24 
       
    25 using namespace ESock;
       
    26 
       
    27 void CLegacyLoopbackProvision::InitialiseConfigL(CCommsDatIapView* aIapView)
       
    28 	{
       
    29 	// We can ignore traps because valid values will be always be returned by callee. 
       
    30 	TRAP_IGNORE(iIp6Provision.InitialiseConfigL(aIapView));
       
    31 	}
       
    32 
       
    33 
       
    34 void TLegacyLoopbackIp6Provision::GetIp6AddrL(CCommsDatIapView* aIapView, CommsDat::TMDBElementId aElementId, TIp6Addr& aAddr)
       
    35 	{
       
    36 	CAgentMetaConnectionProvider::GetIp6AddrL(aIapView, aElementId, aAddr);
       
    37 	}
       
    38 
       
    39 void TLegacyLoopbackIp6Provision::InitialiseConfigL(CCommsDatIapView* aIapView)
       
    40 	{
       
    41 	//
       
    42 	// Setup default values - these values will be used in the event that we leave
       
    43 	// due to an error when reading CommsDat.
       
    44 	//
       
    45 	
       
    46 	SetIp6DNSAddrFromServer(ETrue);
       
    47 	SetIp6NameServer1(KInet6AddrNone);
       
    48 	SetIp6NameServer2(KInet6AddrNone);	
       
    49 	
       
    50 	//
       
    51 	// Read CommsDat fields
       
    52 	//
       
    53 	
       
    54 	TBool boolVal;
       
    55 
       
    56 	aIapView->GetBoolL(KCDTIdIp6DNSAddrFromServer, boolVal);
       
    57 
       
    58 	SetIp6DNSAddrFromServer(boolVal);
       
    59 
       
    60 	if (!Ip6DNSAddrFromServer())
       
    61 		{
       
    62 		TIp6Addr addr;
       
    63 		GetIp6AddrL(aIapView, KCDTIdIp6NameServer1, addr);
       
    64 		SetIp6NameServer1(addr);
       
    65 		GetIp6AddrL(aIapView, KCDTIdIp6NameServer2, addr);
       
    66 		SetIp6NameServer2(addr);
       
    67 		}
       
    68 	else
       
    69 		{
       
    70 		SetIp6NameServer1(KInet6AddrNone);
       
    71 		SetIp6NameServer2(KInet6AddrNone);	
       
    72 		}
       
    73 	}
       
    74 
       
    75 //
       
    76 // Attribute table for provisioning structures passed to CFProtocol
       
    77 //
       
    78 
       
    79 START_ATTRIBUTE_TABLE(CLegacyLoopbackProvision, CLegacyLoopbackProvision::EUid, CLegacyLoopbackProvision::ETypeId)
       
    80 // no attributes defined as no serialisation takes place.
       
    81 END_ATTRIBUTE_TABLE()
       
    82 
       
    83 START_ATTRIBUTE_TABLE(TLegacyLoopBackAgentProvision, TLegacyLoopBackAgentProvision::EUid, TLegacyLoopBackAgentProvision::ETypeId)
       
    84 // no attributes defined as no serialisation takes place.
       
    85 END_ATTRIBUTE_TABLE()
       
    86