Assume always working getaddrinfo/getnameinfo implemenation

This commit is contained in:
Ondřej Surý
2018-08-21 14:54:36 +02:00
parent 29c853f500
commit 62fb0759e9
18 changed files with 113 additions and 1527 deletions

View File

@@ -17,24 +17,6 @@
#include <stddef.h> /* Required on FreeBSD (and others?) for size_t. */
#include <netdb.h> /* Contractual provision. */
/*
* Define if <netdb.h> does not declare struct addrinfo.
*/
@ISC_IRS_NEEDADDRINFO@
#ifdef ISC_IRS_NEEDADDRINFO
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
size_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 */
};
#endif
/*
* Undefine all #defines we are interested in as <netdb.h> may or may not have
* defined them.
@@ -187,17 +169,17 @@ getaddrinfo(const char *hostname, const char *servname,
const struct addrinfo *hints, struct addrinfo **res);
int
getnameinfo(const struct sockaddr *sa, IRS_GETNAMEINFO_SOCKLEN_T salen,
char *host, IRS_GETNAMEINFO_BUFLEN_T hostlen,
char *serv, IRS_GETNAMEINFO_BUFLEN_T servlen,
IRS_GETNAMEINFO_FLAGS_T flags);
getnameinfo(const struct sockaddr *sa, socklen_t salen,
char *host, socklen_t hostlen,
char *serv, socklen_t servlen,
int flags);
void freeaddrinfo (struct addrinfo *ai);
IRS_GAISTRERROR_RETURN_T
const char *
gai_strerror(int ecode);
#endif
#endif /* IRS_NAMESPACE */
/*
* Tell Emacs to use C mode on this file.