49#define h_addr h_addr_list[0]
87#define HOST_NOT_FOUND 1
102#define EAI_BADFLAGS 2
108#define EAI_SOCKTYPE 8
110#define EAI_OVERFLOW 10
125#define AI_PASSIVE 0x00000001
126#define AI_CANONNAME 0x00000002
127#define AI_NUMERICHOST 0x00000004
128#define AI_NUMERICSERV 0x00000008
129#define AI_V4MAPPED 0x00000010
130#define AI_ALL 0x00000020
131#define AI_ADDRCONFIG 0x00000040
int h_errno
Error value for gethostbyname().
void freeaddrinfo(struct addrinfo *ai)
Free an address information structure returned by getaddrinfo().
struct hostent * gethostbyname2(const char *name, int af)
Look up a host by its name and address family.
int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
Get information about a specified address.
struct hostent * gethostbyname(const char *name)
Look up a host by its name.
__uint32_t socklen_t
Socket length type.
Definition socket.h:39
Definitions for the Internet address family.
Network address information structure.
Definition netdb.h:61
struct sockaddr * ai_addr
Address structure.
Definition netdb.h:68
char * ai_canonname
Canonical name.
Definition netdb.h:69
int ai_socktype
Socket type.
Definition netdb.h:65
int ai_protocol
Socket protocol.
Definition netdb.h:66
socklen_t ai_addrlen
Address length.
Definition netdb.h:67
struct addrinfo * ai_next
Next address entry (if any).
Definition netdb.h:70
int ai_flags
Input flags.
Definition netdb.h:62
int ai_family
Socket address family.
Definition netdb.h:64
Network host entry.
Definition netdb.h:43
int h_addrtype
Address type.
Definition netdb.h:46
char * h_name
Official name of the host.
Definition netdb.h:44
char ** h_addr_list
Network addresses of host.
Definition netdb.h:48
int h_length
Length of address, in bytes.
Definition netdb.h:47
char ** h_aliases
Alternative host names.
Definition netdb.h:45
Socket address structure.
Definition socket.h:47