12 #define __NEED_socklen_t
13 #define __NEED_uint32_t
15 #include <bits/alltypes.h>
24 struct sockaddr *ai_addr;
26 struct addrinfo *ai_next;
29 #define IPPORT_RESERVED 1024
31 #define AI_PASSIVE 0x01
32 #define AI_CANONNAME 0x02
33 #define AI_NUMERICHOST 0x04
34 #define AI_V4MAPPED 0x08
36 #define AI_ADDRCONFIG 0x20
37 #define AI_NUMERICSERV 0x400
40 #define NI_NUMERICHOST 0x01
41 #define NI_NUMERICSERV 0x02
42 #define NI_NOFQDN 0x04
43 #define NI_NAMEREQD 0x08
45 /*#define NI_NUMERICSCOPE */
47 #define NI_MAXHOST 255
50 #define EAI_BADFLAGS -1
55 #define EAI_SOCKTYPE -7
56 #define EAI_SERVICE -8
57 #define EAI_MEMORY -10
58 #define EAI_SYSTEM -11
59 #define EAI_OVERFLOW -12
61 int getaddrinfo (const char *, const char *, const struct addrinfo *, struct addrinfo **);
62 void freeaddrinfo (struct addrinfo *);
63 int getnameinfo (const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int);
64 const char *gai_strerror(int);
67 /* Legacy functions follow (marked OBsolete in SUS) */
85 #define h_addr h_addr_list[0]
104 #define HOST_NOT_FOUND 1
106 #define NO_RECOVERY 3
109 void sethostent (int);
110 void endhostent (void);
111 struct hostent *gethostent (void);
112 struct hostent *gethostbyaddr (const void *, socklen_t, int);
113 struct hostent *gethostbyname (const char *);
115 void setnetent (int);
116 void endnetent (void);
117 struct netent *getnetent (void);
118 struct netent *getnetbyaddr (uint32_t, int);
119 struct netent *getnetbyname (const char *);
121 void setservent (int);
122 void endservent (void);
123 struct servent *getservent (void);
124 struct servent *getservbyname (const char *, const char *);
125 struct servent *getservbyport (int, const char *);
127 void setprotoent (int);
128 void endprotoent (void);
129 struct protoent *getprotoent (void);
130 struct protoent *getprotobyname (const char *);
131 struct protoent *getprotobynumber (int);
134 const char *hstrerror(int);
135 int gethostbyname_r(const char *, struct hostent *, char *, size_t, struct hostent **, int *);
136 int gethostbyname2_r(const char *, int, struct hostent *, char *, size_t, struct hostent **, int *);
137 struct hostent *gethostbyname2(const char *, int);
138 int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, char *, size_t, struct hostent **, int *);
139 int getservbyport_r(int, const char *, struct servent *, char *, size_t, struct servent **);
140 int getservbyname_r(const char *, const char *, struct servent *, char *, size_t, struct servent **);
141 #define EAI_NODATA -5
142 #define EAI_ADDRFAMILY -9
143 #define EAI_INPROGRESS -100
144 #define EAI_CANCELED -101
145 #define EAI_NOTCANCELED -102
146 #define EAI_ALLDONE -103
147 #define EAI_INTR -104
148 #define EAI_IDN_ENCODE -105