sdkcreationmw/sdkruntimes/wsock/inc/WinsockHostResolver.h
author rajpuroh
Wed, 21 Apr 2010 09:56:53 +0530
changeset 1 ac50fd48361b
parent 0 b26acd06ea60
permissions -rw-r--r--
Second Contribution
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
* which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
* Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
* Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
* Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
#ifndef _WSOCK_HOST_RESOLVER_H_
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
#define _WSOCK_HOST_RESOLVER_H_
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
#include <es_prot.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
class CWinsockHostResolver : public CHostResolvProvdBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
    enum TResolveErr {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
        EResolveOK,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
        EResolveNoMore,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
        EResolveFailed
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
    };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
    HBufC* iHostName;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
    const TWinProtocolDesc* iProtocolDesc;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
public:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
    static CWinsockHostResolver* NewL(const TWinProtocolDesc* aProtocolDesc);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
    virtual ~CWinsockHostResolver();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
    // CHostResolvProvdBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
    virtual void GetByName(TNameRecord& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
    virtual void GetByAddress(TNameRecord& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
    virtual void SetHostName(TDes& aNameBuf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
    virtual void GetHostName(TDes& aNameBuf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
    // CResolverProvdBase
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
    virtual void CancelCurrentOperation();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
private:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
    CWinsockHostResolver(const TWinProtocolDesc* aProtocolDesc);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
    void ConstructL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
    TResolveErr Resolve6(const char* aName, TInt aIndex, TInetAddr* aAddr);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
    TInt Resolve(const char* aName, TInt aIndex, TInetAddr* aAddr);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
    TInt GetHostNameFromAddr6(const TIp6Addr& aAddr, THostName& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
    TInt GetHostNameFromAddr(TUint32 aAddr, THostName& aName);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
#endif // _WSOCK_HOST_RESOLVER_H_