65 #ifndef __INCLUDE_NETDB_H 66 #define __INCLUDE_NETDB_H 72 #include <tinyara/config.h> 73 #include <tinyara/compiler.h> 81 #include <netinet/in.h> 92 #define IPPORT_RESERVED 0xffff 111 #define AI_PASSIVE (1 << 0) 112 #define AI_CANONNAME (1 << 1) 113 #define AI_NUMERICHOST (1 << 2) 114 #define AI_NUMERICSERV (1 << 3) 115 #define AI_V4MAPPED (1 << 4) 116 #define AI_ALL (1 << 5) 117 #define AI_ADDRCONFIG (1 << 6) 137 #define NI_NOFQDN (1 << 0) 138 #define NI_NUMERICHOST (1 << 1) 139 #define NI_NAMEREQD (1 << 2) 140 #define NI_NUMERICSERV (1 << 3) 141 #define NI_NUMERICSCOPE (1 << 4) 142 #define NI_DGRAM (1 << 5) 148 #define HOST_NOT_FOUND 1 150 #define NO_RECOVERY 3 177 #define EAI_BADFLAGS 2 181 #define EAI_SERVICE 6 182 #define EAI_SOCKTYPE 7 184 #define EAI_OVERFLOW 9 203 #define HOST_NOT_FOUND 1 205 #define NO_RECOVERY 3 208 #define _PATH_SERVICES "/etc/services" 225 #define h_addr h_addr_list[0] 280 #define EXTERN extern "C" 283 #define EXTERN extern 298 #ifdef CONFIG_LIBC_NETDB 301 void endhostent(
void);
302 void endnetent(
void);
303 void endprotoent(
void);
305 FAR
const char *gai_strerror(
int);
310 void endservent(
void);
349 FAR
struct hostent *gethostent(
void);
351 FAR
struct netent *getnetbyaddr(uint32_t,
int);
352 FAR
struct netent *getnetbyname(FAR
const char *);
353 FAR
struct netent *getnetent(
void);
354 FAR
struct protoent *getprotobyname(FAR
const char *);
355 FAR
struct protoent *getprotobynumber(
int);
356 FAR
struct protoent *getprotoent(
void);
357 FAR
struct servent *getservbyport(
int, FAR
const char *);
358 void sethostent(
int);
360 void setprotoent(
int);
365 FAR
struct servent *getservbyname(FAR
const char *, FAR
const char *);
366 FAR
struct servent *getservent(
void);
367 void setservent(
int);
369 int getnameinfo(
const struct sockaddr *sa,
size_t salen,
char *host,
size_t hostlen,
char *serv,
size_t servlen,
int flags);
373 int gethostbyaddr_r(FAR
const void *addr, socklen_t len,
int type, FAR
struct hostent *host, FAR
char *buf,
size_t buflen,
int *h_errnop);
374 int gethostbyname_r(FAR
const char *name, FAR
struct hostent *host, FAR
char *buf,
size_t buflen,
int *h_errnop);
int getaddrinfo(const char *host, const char *service, const struct addrinfo *hints, struct addrinfo **res)
getaddrinfo() is a function that returns information on a particular host name (such as its IP addres...
FAR struct hostent * gethostbyname(FAR const char *name)
gethostbyname() is the function sending DNS query to DNS server with hostname
FAR struct hostent * gethostbyaddr(FAR const void *addr, socklen_t len, int type)
gethostbyaddr() is the function returns a corresponding hostname with given IP addresses ...
FAR struct addrinfo * ai_next
void freeaddrinfo(FAR struct addrinfo *ai)
freeaddrinfo() frees the memory allocated by the getaddrinfo() function.
FAR struct sockaddr * ai_addr