KallistiOS
##version##
|
Network address database functionality. More...
Go to the source code of this file.
Data Structures | |
struct | hostent |
Network host entry. More... | |
struct | addrinfo |
Network address information structure. More... | |
Macros | |
#define | h_addr h_addr_list[0] |
Primary network address. More... | |
#define | HOST_NOT_FOUND 1 |
Hostname not found. More... | |
#define | TRY_AGAIN 2 |
Try the request again. More... | |
#define | NO_RECOVERY 3 |
A non-recoverable error. More... | |
#define | NO_DATA 4 |
Host found, but no data. More... | |
#define | EAI_AGAIN 1 |
Try the request again. More... | |
#define | EAI_BADFLAGS 2 |
Invalid hint flags. More... | |
#define | EAI_FAIL 3 |
A non-recoverable error. More... | |
#define | EAI_FAMILY 4 |
Invalid address family. More... | |
#define | EAI_MEMORY 5 |
Memory allocation error. More... | |
#define | EAI_NONAME 6 |
Hostname not found. More... | |
#define | EAI_SERVICE 7 |
Invalid service value. More... | |
#define | EAI_SOCKTYPE 8 |
Invalid socket type. More... | |
#define | EAI_SYSTEM 9 |
System error, check errno. More... | |
#define | EAI_OVERFLOW 10 |
Argument buffer overflow. More... | |
#define | AI_PASSIVE 0x00000001 |
Address intended for bind(). More... | |
#define | AI_CANONNAME 0x00000002 |
Request canonical name. More... | |
#define | AI_NUMERICHOST 0x00000004 |
Inhibit host resolution. More... | |
#define | AI_NUMERICSERV 0x00000008 |
Inhibit service resolution. More... | |
#define | AI_V4MAPPED 0x00000010 |
Return v4-mapped IPv6 addrs. More... | |
#define | AI_ALL 0x00000020 |
Query for both IPv4 and IPv6. More... | |
#define | AI_ADDRCONFIG 0x00000040 |
Only query for IPv4/IPv6 addrs the system has a valid addr. More... | |
Functions | |
void | freeaddrinfo (struct addrinfo *ai) |
Free an address information structure returned by getaddrinfo(). More... | |
int | getaddrinfo (const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res) |
Get information about a specified addresss. More... | |
struct hostent * | gethostbyname (const char *name) |
Look up a host by its name. More... | |
struct hostent * | gethostbyname2 (const char *name, int af) |
Look up a host by its name and address family. More... | |
Variables | |
int | h_errno |
Error value for gethostbyname(). More... | |
Network address database functionality.
This file contains functions related to network address lookups, usually performed through DNS.
#define h_addr h_addr_list[0] |
Primary network address.
void freeaddrinfo | ( | struct addrinfo * | ai | ) |
Free an address information structure returned by getaddrinfo().
This function cleans up any memory associated with the specified struct addrinfo, which was returned previously by a call to getaddrinfo().
ai | The struct addrinfo to clean up. |
int getaddrinfo | ( | const char * | nodename, |
const char * | servname, | ||
const struct addrinfo * | hints, | ||
struct addrinfo ** | res | ||
) |
Get information about a specified addresss.
This function translates the name of a host and service into a set of socket addresses and related information to be used in creating a socket. This includes potentially looking up the host information in the network address database (and thus in DNS possibly as well).
nodename | The host to look up. |
servname | The service to look up. |
hints | Hints used in aiding lookup. |
res | The resulting address information. |
struct hostent* gethostbyname | ( | const char * | name | ) |
Look up a host by its name.
This function queries the network address database (possibly recursively) for the network address of the specified hostname. This will first search any local databases before querying remote databases (such as a DNS server) for the host specified.
name | The hostname to look up. |
struct hostent* gethostbyname2 | ( | const char * | name, |
int | af | ||
) |
Look up a host by its name and address family.
This function queries the network address database (possibly recursively) for the network address of the specified hostname. This will first search any local databases before querying remote databases (such as a DNS server) for the host specified.
This function allows you to specify the address family that you wish the returned hostent to contain. This function is a GNU extension and has not been specified by any POSIX specification.
name | The hostname to look up. |
af | The address family to use for lookups (AF_INET or AF_INET6). |
int h_errno |
Error value for gethostbyname().