1 // Copyright (c) 2002-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 "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 // This file defines the CIPv6ProtocolIf class, which handles the transmission |
|
15 // of IPv6 data to and from the TCP/IP stack. |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 */ |
|
22 |
|
23 #ifndef IPV6PROTOCOLIF_H__ |
|
24 #define IPV6PROTOCOLIF_H__ |
|
25 |
|
26 #include "ProtocolIfBase.h" |
|
27 #include <eui_addr.h> |
|
28 |
|
29 class CBttLogger; |
|
30 |
|
31 class CIPv6ProtocolIf : public CProtocolIfBase |
|
32 { |
|
33 public: |
|
34 CIPv6ProtocolIf(CRawIPNifMain& aNifMain, CBttLogger* aTheLogger); |
|
35 ~CIPv6ProtocolIf(); |
|
36 |
|
37 public: //NifIfBase support. |
|
38 virtual void BindL(TAny *aId); |
|
39 virtual TInt Control(TUint aLevel,TUint aName,TDes8& aOption, TAny* aSource); |
|
40 virtual TInt Send(RMBufChain& aPdu, TAny* aSource); |
|
41 virtual void Info(TNifIfInfo& aInfo) const; |
|
42 virtual TInt Notification(TAgentToNifEventType aEvent, void * aInfo); |
|
43 virtual void StartSending(CProtocolBase* aProtocol); // It seems not needed for ipv6 |
|
44 |
|
45 virtual TBool WantsProtocol(TUint16 aProtocolCode); |
|
46 virtual void Process(RMBufChain& aPdu); |
|
47 |
|
48 |
|
49 virtual void UpdateContextConfigL(const RPacketContext::TContextConfigGPRS& |
|
50 aConfig); |
|
51 virtual void UpdateConnectionSpeed(TUint aConnectionSpeed); |
|
52 |
|
53 // Define the class that will hold the IPv6 setting required by the Nif. |
|
54 class TIPv6Settings |
|
55 { |
|
56 public: |
|
57 TIp6Addr iLocalAddr; |
|
58 TIp6Addr iPrimaryDns; |
|
59 TIp6Addr iSecondaryDns; |
|
60 TBool iGetDnsFromServer; |
|
61 TBool iGetIpFromServer; |
|
62 TE64Addr iLocalIfId; |
|
63 //TE64Addr iRemoteIfId; |
|
64 }; |
|
65 |
|
66 private: |
|
67 void ReadCommDbGprsSettingsL(); |
|
68 // This method is only used to get GPRS_IP_ADDR. |
|
69 void ReadIPv4SettingL(const TDesC& aFieldName, TUint32& aIpAddr); |
|
70 void ReadIPv6SettingL(const TDesC& aFieldName, TIp6Addr& aIpAddr); |
|
71 |
|
72 TInt WriteIfConfig(TDes8& aIfConfig); |
|
73 TInt WriteIfInfo(TDes8& aIfInfo); |
|
74 |
|
75 TInt WriteConnectionInfo(TDes8& aConnectionInfo); |
|
76 #ifdef WCDMA_STUB |
|
77 TInt DeleteContext(TDes8& aContextParameters); |
|
78 #endif |
|
79 inline void WriteIfName(TDes& aName) const; |
|
80 |
|
81 #ifdef __BTT_LOGGING__ |
|
82 void LogPacket(const RMBufChain& aPacket); |
|
83 #endif // __BTT_LOGGING__ |
|
84 |
|
85 private: //unowned |
|
86 CBttLogger* iTheLogger; |
|
87 |
|
88 private: //owned |
|
89 TIPv6Settings iSettings; |
|
90 TUint iSpeedMetric; |
|
91 }; |
|
92 |
|
93 void CIPv6ProtocolIf::WriteIfName(TDes& aName) const |
|
94 /** |
|
95 * Used to uniquely identify the current Nif instance |
|
96 * |
|
97 * @param aName Descriptor that will be initialised. |
|
98 */ |
|
99 { |
|
100 aName.Format(_L("%S[0x%X]"), &KIPv6ProtocolIfName, this); |
|
101 } |
|
102 |
|
103 #endif // IPV6PROTOCOLIF_H__ |
|