sdkcreationmw/sdkruntimes/new_wsock_3pc/src/winsockprovision.cpp
author rajpuroh
Wed, 21 Apr 2010 10:32:25 +0530
changeset 2 82fb8aa91b2c
permissions -rw-r--r--
Winsock 3 PC Arch Contribution

// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "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:
// TunnelMCPR.CPP
// Tunnel MCPR
// 
//

/**
 @file
 @internalComponent
*/

#include "winsockprovision.h"
#include <comms-infras/ss_tiermanagerutils.h>
#include <commsdattypeinfov1_1.h>

using namespace ESock;
using namespace CommsDat;

void TWinsockProvision::InitialiseConfigL(CCommsDatIapView* aIapView)
    {
	iInfo.iLocalIap = aIapView->IapId();					// IAP

	TUint32 val;

    aIapView->GetIntL(KCDTIdIAPNetwork, val);					// Network Id
	iInfo.iLocalNetwork = val;

    TInt err;
	err = aIapView->GetInt(KCDTIdVPNIAPRecord, val); // VPN IAP
    if(err == KErrNotFound)
    	val = 0; /* Hard code to 0 for SNAP, should be backed up by appropriate configuration*/
    else if(err != KErrNone)
    	User::Leave(err);
    val = (val & KCDMaskShowRecordId) >> 8;
    
	// form the Tunnel CFProtocol name
	_LIT(KNifNameFormat, "tunnelnif[0x%08x][%d:%d]");
	
	iInfo.iIfName.Format(KNifNameFormat, this, iInfo.iLocalIap, val);
    }

//
// Attribute table for provisioning structure passed to CFProtocol
//

START_ATTRIBUTE_TABLE(TWinsockProvision, TWinsockProvision::EUid, TWinsockProvision::ETypeId)
// No attributes defined - no serialisation performed
END_ATTRIBUTE_TABLE()