diff options
Diffstat (limited to 'system/include/netdb.h')
-rw-r--r-- | system/include/netdb.h | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/system/include/netdb.h b/system/include/netdb.h index 6e069448..147cdff4 100644 --- a/system/include/netdb.h +++ b/system/include/netdb.h @@ -11,6 +11,22 @@ extern "C" { #define NO_DATA 4 #define NO_ADDRESS 5 +#define EAI_ADDRFAMILY 1 +#define EAI_AGAIN 2 +#define EAI_BADFLAGS 3 +#define EAI_FAIL 4 +#define EAI_FAMILY 5 +#define EAI_MEMORY 6 +#define EAI_NODATA 7 +#define EAI_NONAME 8 +#define EAI_SERVICE 9 +#define EAI_SOCKTYPE 10 +#define EAI_SYSTEM 11 +#define EAI_BADHINTS 12 +#define EAI_PROTOCOL 13 +#define EAI_OVERFLOW 14 +#define EAI_MAX 15 + #define IP_TOS 1 #define IP_TTL 2 #define IP_HDRINCL 3 @@ -33,12 +49,30 @@ extern "C" { typedef int socklen_t; -struct hostent { - char* h_name; - char** h_aliases; +struct addrinfo +{ + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + socklen_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; + +extern int getaddrinfo(const char *name, const char *service, const struct addrinfo *req, struct addrinfo **pai); +extern void freeaddrinfo(struct addrinfo *ai); +extern int getnameinfo (struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags); +const char *gai_strerror(int ecode); + +struct hostent +{ + char *h_name; + char **h_aliases; int h_addrtype; int h_length; - char** h_addr_list; + char **h_addr_list; }; #define h_addr h_addr_list[0] |