Zephyr API Documentation  3.6.0
A Scalable Open Source RTOS
3.6.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
inet.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_ARPA_INET_H_
7#define ZEPHYR_INCLUDE_POSIX_ARPA_INET_H_
8
9#include <stddef.h>
10
13
14#include <zephyr/net/socket.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES
21
22static inline char *inet_ntop(sa_family_t family, const void *src, char *dst,
23 size_t size)
24{
25 return zsock_inet_ntop(family, src, dst, size);
26}
27
28static inline int inet_pton(sa_family_t family, const char *src, void *dst)
29{
30 return zsock_inet_pton(family, src, dst);
31}
32
33#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */
34
35#ifdef __cplusplus
36}
37#endif
38
39#endif /* ZEPHYR_INCLUDE_POSIX_ARPA_INET_H_ */
static int inet_pton(sa_family_t family, const char *src, void *dst)
POSIX wrapper for zsock_inet_pton.
Definition: socket.h:1026
static char * zsock_inet_ntop(sa_family_t family, const void *src, char *dst, size_t size)
Convert network address from internal to numeric ASCII form.
Definition: socket.h:690
int zsock_inet_pton(sa_family_t family, const char *src, void *dst)
Convert network address from numeric ASCII form to internal representation.
static char * inet_ntop(sa_family_t family, const void *src, char *dst, size_t size)
POSIX wrapper for zsock_inet_ntop.
Definition: socket.h:1032
unsigned short int sa_family_t
Socket address family type.
Definition: net_ip.h:164
BSD Sockets compatible API definitions.