Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
netdb.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Linaro Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_INCLUDE_POSIX_NETDB_H_
7#define ZEPHYR_INCLUDE_POSIX_NETDB_H_
8
9#include <net/socket.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define addrinfo zsock_addrinfo
16
17static inline int getaddrinfo(const char *host, const char *service,
18 const struct zsock_addrinfo *hints,
19 struct zsock_addrinfo **res)
20{
21 return zsock_getaddrinfo(host, service, hints, res);
22}
23
24static inline void freeaddrinfo(struct zsock_addrinfo *ai)
25{
27}
28
29static inline const char *gai_strerror(int errcode)
30{
31 return zsock_gai_strerror(errcode);
32}
33
34static inline int getnameinfo(const struct sockaddr *addr, socklen_t addrlen,
35 char *host, socklen_t hostlen,
36 char *serv, socklen_t servlen, int flags)
37{
38 return zsock_getnameinfo(addr, addrlen, host, hostlen,
39 serv, servlen, flags);
40}
41
42#ifdef __cplusplus
43}
44#endif
45
46#endif /* ZEPHYR_INCLUDE_POSIX_NETDB_H_ */
void zsock_freeaddrinfo(struct zsock_addrinfo *ai)
Free results returned by zsock_getaddrinfo()
const char * zsock_gai_strerror(int errcode)
Convert zsock_getaddrinfo() error code to textual message.
int zsock_getnameinfo(const struct sockaddr *addr, socklen_t addrlen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
Resolve a network address to a domain name or ASCII address.
int zsock_getaddrinfo(const char *host, const char *service, const struct zsock_addrinfo *hints, struct zsock_addrinfo **res)
Resolve a domain name to one or more network addresses.
size_t socklen_t
Definition: net_ip.h:161
flags
Definition: http_parser.h:131
BSD Sockets compatible API definitions.
static int getaddrinfo(const char *host, const char *service, const struct zsock_addrinfo *hints, struct zsock_addrinfo **res)
Definition: netdb.h:17
static int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)
Definition: netdb.h:34
static const char * gai_strerror(int errcode)
Definition: netdb.h:29
static void freeaddrinfo(struct zsock_addrinfo *ai)
Definition: netdb.h:24
Definition: net_ip.h:335
Definition: socket.h:153