20 #include <sys/cdefs.h>
42 #define h_addr h_addr_list[0]
76 #define HOST_NOT_FOUND 1
89 #define EAI_BADFLAGS 2
95 #define EAI_SOCKTYPE 8
97 #define EAI_OVERFLOW 10
110 #define AI_PASSIVE 0x00000001
111 #define AI_CANONNAME 0x00000002
112 #define AI_NUMERICHOST 0x00000004
113 #define AI_NUMERICSERV 0x00000008
114 #define AI_V4MAPPED 0x00000010
115 #define AI_ALL 0x00000020
116 #define AI_ADDRCONFIG 0x00000040
143 int getaddrinfo(
const char *nodename,
const char *servname,
socklen_t ai_addrlen
Address length.
Definition: netdb.h:59
void freeaddrinfo(struct addrinfo *ai)
Free an address information structure returned by getaddrinfo().
char ** h_addr_list
Network addresses of host.
Definition: netdb.h:41
Network host entry.
Definition: netdb.h:36
int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
Get information about a specified addresss.
Definitions for the Internet address family.
struct hostent * gethostbyname2(const char *name, int af)
Look up a host by its name and address family.
char * ai_canonname
Canonical name.
Definition: netdb.h:61
Socket address structure.
Definition: socket.h:38
char ** h_aliases
Alternative host names.
Definition: netdb.h:38
__uint32_t socklen_t
Socket length type.
Definition: socket.h:30
int ai_protocol
Socket protocol.
Definition: netdb.h:58
char * h_name
Official name of the host.
Definition: netdb.h:37
int h_length
Length of address, in bytes.
Definition: netdb.h:40
int ai_socktype
Socket type.
Definition: netdb.h:57
int h_addrtype
Address type.
Definition: netdb.h:39
struct addrinfo * ai_next
Next address entry (if any).
Definition: netdb.h:62
struct hostent * gethostbyname(const char *name)
Look up a host by its name.
Network address information structure.
Definition: netdb.h:53
int ai_flags
Input flags.
Definition: netdb.h:54
struct sockaddr * ai_addr
Address structure.
Definition: netdb.h:60
int h_errno
Error value for gethostbyname().
int ai_family
Socket address family.
Definition: netdb.h:56