|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // TunnelMCPR.CPP |
|
15 // Tunnel MCPR |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #include "winsockprovision.h" |
|
25 #include <comms-infras/ss_tiermanagerutils.h> |
|
26 #include <commsdattypeinfov1_1.h> |
|
27 |
|
28 using namespace ESock; |
|
29 using namespace CommsDat; |
|
30 |
|
31 void TWinsockProvision::InitialiseConfigL(CCommsDatIapView* aIapView) |
|
32 { |
|
33 iInfo.iLocalIap = aIapView->IapId(); // IAP |
|
34 |
|
35 TUint32 val; |
|
36 |
|
37 aIapView->GetIntL(KCDTIdIAPNetwork, val); // Network Id |
|
38 iInfo.iLocalNetwork = val; |
|
39 |
|
40 TInt err; |
|
41 err = aIapView->GetInt(KCDTIdVPNIAPRecord, val); // VPN IAP |
|
42 if(err == KErrNotFound) |
|
43 val = 0; /* Hard code to 0 for SNAP, should be backed up by appropriate configuration*/ |
|
44 else if(err != KErrNone) |
|
45 User::Leave(err); |
|
46 val = (val & KCDMaskShowRecordId) >> 8; |
|
47 |
|
48 // form the Tunnel CFProtocol name |
|
49 _LIT(KNifNameFormat, "tunnelnif[0x%08x][%d:%d]"); |
|
50 |
|
51 iInfo.iIfName.Format(KNifNameFormat, this, iInfo.iLocalIap, val); |
|
52 } |
|
53 |
|
54 // |
|
55 // Attribute table for provisioning structure passed to CFProtocol |
|
56 // |
|
57 |
|
58 START_ATTRIBUTE_TABLE(TWinsockProvision, TWinsockProvision::EUid, TWinsockProvision::ETypeId) |
|
59 // No attributes defined - no serialisation performed |
|
60 END_ATTRIBUTE_TABLE() |