Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Functions
addrinfo.h File Reference

Go to the source code of this file.

## Data Structures
struct | addrinfo

## Macros
#define | __P(args) ()
#define | EAI_ADDRFAMILY 1 /* address family for hostname not supported */
#define | EAI_AGAIN 2 /* temporary failure in name resolution */
#define | EAI_BADFLAGS 3 /* invalid value for ai_flags */
#define | EAI_FAIL 4 /* non-recoverable failure in name resolution */
#define | EAI_FAMILY 5 /* ai_family not supported */
#define | EAI_MEMORY 6 /* memory allocation failure */
#define | EAI_NODATA 7 /* no address associated with hostname */
#define | EAI_NONAME 8 /* hostname nor servname provided, or not known */
#define | EAI_SERVICE 9 /* servname not supported for ai_socktype */
#define | EAI_SOCKTYPE 10 /* ai_socktype not supported */
#define | EAI_SYSTEM 11 /* system error returned in errno */
#define | EAI_BADHINTS 12
#define | EAI_PROTOCOL 13
#define | EAI_MAX 14
#define | AI_PASSIVE 0x00000001 /* get address to use bind() */
#define | AI_CANONNAME 0x00000002 /* fill ai_canonname */
#define | AI_NUMERICHOST 0x00000004 /* prevent name resolution */
#define | AI_NUMERICSERV 0x00000008 /* prevent service name resolution */
#define | AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV)
#define | AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
#define | AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
#define | AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
#define | AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
#define | AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)
#define | NI_MAXHOST 1025
#define | NI_MAXSERV 32
#define | NI_NOFQDN 0x00000001
#define | NI_NUMERICHOST 0x00000002
#define | NI_NAMEREQD 0x00000004
#define | NI_NUMERICSERV 0x00000008
#define | NI_DGRAM 0x00000010
#define | getaddrinfo getaddrinfo__compat
#define | getnameinfo getnameinfo__compat
#define | freehostent freehostent__compat
#define | freeaddrinfo freeaddrinfo__compat
#define | offsetof(p_type, field) ((size_t)&(((p_type *)0)->field))

## Functions
int getaddrinfo | __P ((const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res))
int getnameinfo | __P ((const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags))
void freehostent | __P ((struct hostent *))
void freeaddrinfo | __P ((struct addrinfo *))
char *gai_strerror | __P ((int))

## Macro Definition Documentation

## ◆ __P

#define __P | ( |  | args | ) | ()

Definition at line 68 of file addrinfo.h.

## ◆ AI_ADDRCONFIG

#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */

Definition at line 108 of file addrinfo.h.

## ◆ AI_ALL

#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */

Definition at line 106 of file addrinfo.h.

## ◆ AI_CANONNAME

#define AI_CANONNAME 0x00000002 /* fill ai_canonname */

Definition at line 97 of file addrinfo.h.

## ◆ AI_DEFAULT

#define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)

Definition at line 111 of file addrinfo.h.

## ◆ AI_MASK

#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV)

Definition at line 103 of file addrinfo.h.

## ◆ AI_NUMERICHOST

#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */

Definition at line 98 of file addrinfo.h.

## ◆ AI_NUMERICSERV

#define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */

Definition at line 99 of file addrinfo.h.

## ◆ AI_PASSIVE

#define AI_PASSIVE 0x00000001 /* get address to use bind() */

Definition at line 96 of file addrinfo.h.

## ◆ AI_V4MAPPED

#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */

Definition at line 109 of file addrinfo.h.

## ◆ AI_V4MAPPED_CFG

#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */

Definition at line 107 of file addrinfo.h.

## ◆ EAI_ADDRFAMILY

#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */

Definition at line 78 of file addrinfo.h.

## ◆ EAI_AGAIN

#define EAI_AGAIN 2 /* temporary failure in name resolution */

Definition at line 79 of file addrinfo.h.

## ◆ EAI_BADFLAGS

#define EAI_BADFLAGS 3 /* invalid value for ai_flags */

Definition at line 80 of file addrinfo.h.

## ◆ EAI_BADHINTS

#define EAI_BADHINTS 12

Definition at line 89 of file addrinfo.h.

## ◆ EAI_FAIL

#define EAI_FAIL 4 /* non-recoverable failure in name resolution */

Definition at line 81 of file addrinfo.h.

## ◆ EAI_FAMILY

#define EAI_FAMILY 5 /* ai_family not supported */

Definition at line 82 of file addrinfo.h.

## ◆ EAI_MAX

#define EAI_MAX 14

Definition at line 91 of file addrinfo.h.

## ◆ EAI_MEMORY

#define EAI_MEMORY 6 /* memory allocation failure */

Definition at line 83 of file addrinfo.h.

## ◆ EAI_NODATA

#define EAI_NODATA 7 /* no address associated with hostname */

Definition at line 84 of file addrinfo.h.

## ◆ EAI_NONAME

#define EAI_NONAME 8 /* hostname nor servname provided, or not known */

Definition at line 85 of file addrinfo.h.

## ◆ EAI_PROTOCOL

#define EAI_PROTOCOL 13

Definition at line 90 of file addrinfo.h.

## ◆ EAI_SERVICE

#define EAI_SERVICE 9 /* servname not supported for ai_socktype */

Definition at line 86 of file addrinfo.h.

## ◆ EAI_SOCKTYPE

#define EAI_SOCKTYPE 10 /* ai_socktype not supported */

Definition at line 87 of file addrinfo.h.

## ◆ EAI_SYSTEM

#define EAI_SYSTEM 11 /* system error returned in errno */

Definition at line 88 of file addrinfo.h.

## ◆ freeaddrinfo

#define freeaddrinfo freeaddrinfo__compat

Definition at line 157 of file addrinfo.h.

## ◆ freehostent

#define freehostent freehostent__compat

Definition at line 153 of file addrinfo.h.

## ◆ getaddrinfo

#define getaddrinfo getaddrinfo__compat

Definition at line 145 of file addrinfo.h.

## ◆ getnameinfo

#define getnameinfo getnameinfo__compat

Definition at line 149 of file addrinfo.h.

## ◆ NI_DGRAM

#define NI_DGRAM 0x00000010

Definition at line 128 of file addrinfo.h.

## ◆ NI_MAXHOST

#define NI_MAXHOST 1025

Definition at line 117 of file addrinfo.h.

## ◆ NI_MAXSERV

#define NI_MAXSERV 32

Definition at line 118 of file addrinfo.h.

## ◆ NI_NAMEREQD

#define NI_NAMEREQD 0x00000004

Definition at line 126 of file addrinfo.h.

## ◆ NI_NOFQDN

#define NI_NOFQDN 0x00000001

Definition at line 124 of file addrinfo.h.

## ◆ NI_NUMERICHOST

#define NI_NUMERICHOST 0x00000002

Definition at line 125 of file addrinfo.h.

## ◆ NI_NUMERICSERV

#define NI_NUMERICSERV 0x00000008

Definition at line 127 of file addrinfo.h.

## ◆ offsetof

#define offsetof | ( |  | p_type,
|  |  | field
| ) |  | ((size_t)&(((p_type *)0)->field))

Definition at line 186 of file addrinfo.h.

## Function Documentation

## ◆ __P() [1/5]

int getaddrinfo __P | ( | (const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) |  | ) |

## ◆ __P() [2/5]

int getnameinfo __P | ( | (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags) |  | ) |

## ◆ __P() [3/5]

char* gai_strerror __P | ( | (int) |  | ) |

## ◆ __P() [4/5]

void freeaddrinfo __P | ( | (struct addrinfo *) |  | ) |

## ◆ __P() [5/5]

void freehostent __P | ( | (struct hostent *) |  | ) |