sdkcreationmw/sdkruntimes/wsock/inc/WinsockHostResolver.h
author rajpuroh
Mon, 08 Mar 2010 12:09:11 +0530
changeset 0 b26acd06ea60
child 1 ac50fd48361b
permissions -rw-r--r--
First Contribution of SDK components
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
/*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
* All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
* This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
* which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
* Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
* Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
* Description: 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
#ifndef _WSOCK_HOST_RESOLVER_H_
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
#define _WSOCK_HOST_RESOLVER_H_
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
#include <es_prot.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
class CWinsockHostResolver : public CHostResolvProvdBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
    enum TResolveErr {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
        EResolveOK,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
        EResolveNoMore,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
        EResolveFailed
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
    };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
    HBufC* iHostName;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
    const TWinProtocolDesc* iProtocolDesc;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
public:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
    static CWinsockHostResolver* NewL(const TWinProtocolDesc* aProtocolDesc);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
    virtual ~CWinsockHostResolver();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
    // CHostResolvProvdBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
    virtual void GetByName(TNameRecord& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
    virtual void GetByAddress(TNameRecord& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
    virtual void SetHostName(TDes& aNameBuf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
    virtual void GetHostName(TDes& aNameBuf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
    // CResolverProvdBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
    virtual void CancelCurrentOperation();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
    CWinsockHostResolver(const TWinProtocolDesc* aProtocolDesc);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
    void ConstructL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
    TResolveErr Resolve6(const char* aName, TInt aIndex, TInetAddr* aAddr);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
    TInt Resolve(const char* aName, TInt aIndex, TInetAddr* aAddr);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
    TInt GetHostNameFromAddr6(const TIp6Addr& aAddr, THostName& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
    TInt GetHostNameFromAddr(TUint32 aAddr, THostName& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
#endif // _WSOCK_HOST_RESOLVER_H_