commsfwutils/commsbufs/reference/loopback_bearer/src/provision.cpp
changeset 0 dfb7c4ff071f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commsfwutils/commsbufs/reference/loopback_bearer/src/provision.cpp	Thu Dec 17 09:22:25 2009 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#include <comms-infras/ss_log.h>
+#include <in_sock.h>
+#include <comms-infras/metadata.h>
+#include <comms-infras/coremcpractivities.h>
+#include <comms-infras/ss_tiermanagerutils.h>
+#include "mcpr.h"
+#include "provision.h"
+
+using namespace ESock;
+
+void CLegacyLoopbackProvision::InitialiseConfigL(CCommsDatIapView* aIapView)
+	{
+	// We can ignore traps because valid values will be always be returned by callee. 
+	TRAP_IGNORE(iIp6Provision.InitialiseConfigL(aIapView));
+	}
+
+
+void TLegacyLoopbackIp6Provision::GetIp6AddrL(CCommsDatIapView* aIapView, CommsDat::TMDBElementId aElementId, TIp6Addr& aAddr)
+	{
+	CAgentMetaConnectionProvider::GetIp6AddrL(aIapView, aElementId, aAddr);
+	}
+
+void TLegacyLoopbackIp6Provision::InitialiseConfigL(CCommsDatIapView* aIapView)
+	{
+	//
+	// Setup default values - these values will be used in the event that we leave
+	// due to an error when reading CommsDat.
+	//
+	
+	SetIp6DNSAddrFromServer(ETrue);
+	SetIp6NameServer1(KInet6AddrNone);
+	SetIp6NameServer2(KInet6AddrNone);	
+	
+	//
+	// Read CommsDat fields
+	//
+	
+	TBool boolVal;
+
+	aIapView->GetBoolL(KCDTIdIp6DNSAddrFromServer, boolVal);
+
+	SetIp6DNSAddrFromServer(boolVal);
+
+	if (!Ip6DNSAddrFromServer())
+		{
+		TIp6Addr addr;
+		GetIp6AddrL(aIapView, KCDTIdIp6NameServer1, addr);
+		SetIp6NameServer1(addr);
+		GetIp6AddrL(aIapView, KCDTIdIp6NameServer2, addr);
+		SetIp6NameServer2(addr);
+		}
+	else
+		{
+		SetIp6NameServer1(KInet6AddrNone);
+		SetIp6NameServer2(KInet6AddrNone);	
+		}
+	}
+
+//
+// Attribute table for provisioning structures passed to CFProtocol
+//
+
+START_ATTRIBUTE_TABLE(CLegacyLoopbackProvision, CLegacyLoopbackProvision::EUid, CLegacyLoopbackProvision::ETypeId)
+// no attributes defined as no serialisation takes place.
+END_ATTRIBUTE_TABLE()
+
+START_ATTRIBUTE_TABLE(TLegacyLoopBackAgentProvision, TLegacyLoopBackAgentProvision::EUid, TLegacyLoopBackAgentProvision::ETypeId)
+// no attributes defined as no serialisation takes place.
+END_ATTRIBUTE_TABLE()
+