SOGetHostByAddr / SOGetHostByName

Syntax

#include <cafe.h>
#include <cafe/network.h>

struct hostent * SOGetHostByAddr( const void* addr, int len, int type);

struct hostent * SOGetHostByName( const char* name);

Parameters

addr Address in network byte order.
len Length of address pointed to by addr.
name Fully qualified domain name or dotted-decimal string.
type The family type of the address. (AF_INET for an IPv4 address).

Return Values

Returns a pointer to a hostent structure describing an internet host referenced by name or by address, as the function names indicate if the requested entry was found, otherwise NULL.

NOTE:
The returned pointer value points to static memory and can be overwritten by subsequent calls.

Description

SOGetHostByAddr returns information about the host with address addr.

SOGetHostByName returns information about the host named name.

CAUTION:
This function may return pointers to static data which may be overwritten by later calls. Since it contains pointers, copying the hostent struct does not suffice; a deep copy is required.

Do Not Call From

SOGetHostByAddr

Multiple threads This function is not thread-safe.
Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

SOGetHostByName

Multiple threads This function is not thread-safe.
Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

Revision History

2012/08/16 Cleanup pass.
2011/08/21 Initial version.


CONFIDENTIAL