IFWXFirewall::GetHostByAddr method

Applies to: desktop apps only

The GetHostByAddr method retrieves host information corresponding to an address.

Syntax

HRESULT GetHostByAddr(
  [in]       const char *addr,
  [in]       int len,
  [in]       int type,
  [out]      char *buf,
  [in, out]  int *buflen
);

Parameters

  • addr [in]
    Pointer to the network address for the host. Host addresses are stored in network byte order.

  • len [in]
    Length of the address.

  • type [in]
    Type of the address.

  • buf [out]
    Pointer to the data area to receive the hostent data. The data area must be larger than the size of a hostent structure because the supplied data area is used by Windows Sockets to contain a hostent structure and all of the data referenced by members of the hostent structure. A buffer of MAXGETHOSTSTRUCT bytes is recommended.

  • buflen [in, out]
    On input, specifies the size of the data area for the buf parameter. If the buffer is too small, the error code HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) is returned and the buflen parameter receives the size of the required buffer.

Return value

This method can return one of these values.

  • S_OK
    Success, the buffer was filled with the host information.

  • HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
    Insufficient buffer space was provided. That is, the buffer pointed to by the buf parameter is not large enough to contain the host information. For more information, see the description of the buflen parameter.

  • HRESULT_FROM_WIN32(WSAHOST_NOT_FOUND)
    The address specified could not be found in the relevant database.

  • HRESULT_FROM_WIN32(WSATRY_AGAIN)
    No response was received from an authoritative server.

  • HRESULT_FROM_WIN32(WSANO_DATA)
    The address specified is valid and was found in the database, but no information of the type requested is associated with it.

Remarks

Unlike the IFWXSession::GetHostByAddr method, this method does not check permissions or policy rules, does not log the name resolution, and cannot use autodial to dial out for the name resolution.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only)

Version

Forefront Threat Management Gateway (TMG) 2010

Header

Wspfwext.idl

DLL

Wspsrv.exe

See also

IFWXFirewall

IFWXSession::GetHostByAddr

 

 

Build date: 7/12/2010