|
1 /* |
|
2 * Copyright (c) 2004-2005 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 |
|
18 |
|
19 #ifndef _WSOCK_HOST_RESOLVER_H_ |
|
20 #define _WSOCK_HOST_RESOLVER_H_ |
|
21 |
|
22 #include <es_prot.h> |
|
23 |
|
24 class CWinsockHostResolver : public CHostResolvProvdBase |
|
25 { |
|
26 enum TResolveErr { |
|
27 EResolveOK, |
|
28 EResolveNoMore, |
|
29 EResolveFailed |
|
30 }; |
|
31 |
|
32 private: |
|
33 HBufC* iHostName; |
|
34 const TWinProtocolDesc* iProtocolDesc; |
|
35 |
|
36 public: |
|
37 static CWinsockHostResolver* NewL(const TWinProtocolDesc* aProtocolDesc); |
|
38 virtual ~CWinsockHostResolver(); |
|
39 |
|
40 // CHostResolvProvdBase |
|
41 virtual void GetByName(TNameRecord& aName); |
|
42 virtual void GetByAddress(TNameRecord& aName); |
|
43 virtual void SetHostName(TDes& aNameBuf); |
|
44 virtual void GetHostName(TDes& aNameBuf); |
|
45 |
|
46 // CResolverProvdBase |
|
47 virtual void CancelCurrentOperation(); |
|
48 |
|
49 private: |
|
50 CWinsockHostResolver(const TWinProtocolDesc* aProtocolDesc); |
|
51 void ConstructL(); |
|
52 TResolveErr Resolve6(const char* aName, TInt aIndex, TInetAddr* aAddr); |
|
53 TInt Resolve(const char* aName, TInt aIndex, TInetAddr* aAddr); |
|
54 TInt GetHostNameFromAddr6(const TIp6Addr& aAddr, THostName& aName); |
|
55 TInt GetHostNameFromAddr(TUint32 aAddr, THostName& aName); |
|
56 }; |
|
57 |
|
58 #endif // _WSOCK_HOST_RESOLVER_H_ |