/* *Structuresreturnedbynetworkdatabaselibrary.Alladdressesare *suppliedinhostorder,andreturnedinnetworkorder(suitablefor *useinsystemcalls).
*/ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullability-completeness" struct hostent { char *h_name; /* official name of host */ char **h_aliases; /* alias list */ int h_addrtype; /* host address type */ int h_length; /* length of address */ char **h_addr_list; /* list of addresses from name server */ #define h_addr h_addr_list[0] /* address, for backward compatibility */
};
struct netent { char *n_name; /* official name of net */ char **n_aliases; /* alias list */ int n_addrtype; /* net address type */
uint32_t n_net; /* network # */
};
struct servent { char *s_name; /* official service name */ char **s_aliases; /* alias list */ int s_port; /* port # */ char * _Nullable s_proto; /* protocol to use */
};
struct protoent { char *p_name; /* official protocol name */ char **p_aliases; /* alias list */ int p_proto; /* protocol # */
};
struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */ int ai_family; /* PF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
socklen_t ai_addrlen; /* length of ai_addr */ char *ai_canonname; /* canonical name for hostname */ struct sockaddr *ai_addr; /* binary address */ struct addrinfo *ai_next; /* next structure in linked list */
}; #pragma clang diagnostic pop
#define NETDB_INTERNAL -1/* see errno */ #define NETDB_SUCCESS 0/* no problem */ #define HOST_NOT_FOUND 1/* Authoritative Answer Host not found */ #define TRY_AGAIN 2/* Non-Authoritative Host not found, or SERVERFAIL */ #define NO_RECOVERY 3/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ #define NO_DATA 4/* Valid name, no data record of requested type */ #define NO_ADDRESS NO_DATA /* no address, look for MX record */
/* *Errorreturncodesfromgetaddrinfo()
*/ #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/* invalid value for hints */ #define EAI_PROTOCOL 13/* resolved protocol is unknown */ #define EAI_OVERFLOW 14/* argument buffer overflow */ #define EAI_MAX 15
/* *Flagvaluesforgetaddrinfo()
*/ #define AI_PASSIVE 0x00000001 /* get address to use bind() */ #define AI_CANONNAME 0x00000002 /* fill ai_canonname */ #define AI_NUMERICHOST 0x00000004 /* prevent host name resolution */ #define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */ /* valid flags for addrinfo (not a standard def, apps should not use it) */ #define AI_MASK \
(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
AI_ADDRCONFIG)
#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 */ /* special recommended flags for getipnodebyname */ #define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.