6#ifndef ZEPHYR_INCLUDE_POSIX_SYS_SOCKET_H_
7#define ZEPHYR_INCLUDE_POSIX_SYS_SOCKET_H_
16static inline int socket(
int family,
int type,
int proto)
21static inline int socketpair(
int family,
int type,
int proto,
int sv[2])
26#define SHUT_RD ZSOCK_SHUT_RD
27#define SHUT_WR ZSOCK_SHUT_WR
28#define SHUT_RDWR ZSOCK_SHUT_RDWR
30#define MSG_PEEK ZSOCK_MSG_PEEK
31#define MSG_TRUNC ZSOCK_MSG_TRUNC
32#define MSG_DONTWAIT ZSOCK_MSG_DONTWAIT
33#define MSG_WAITALL ZSOCK_MSG_WAITALL
51static inline int listen(
int sock,
int backlog)
90static inline int getsockopt(
int sock,
int level,
int optname,
96static inline int setsockopt(
int sock,
int level,
int optname,
ssize_t zsock_sendto(int sock, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
Send data to an arbitrary network address.
int zsock_connect(int sock, const struct sockaddr *addr, socklen_t addrlen)
Connect a socket to a peer network address.
int zsock_socketpair(int family, int type, int proto, int *sv)
Create an unnamed pair of connected sockets.
int zsock_accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
Accept a connection on listening socket.
static ssize_t zsock_send(int sock, const void *buf, size_t len, int flags)
Send data to a connected peer.
Definition: socket.h:352
int zsock_bind(int sock, const struct sockaddr *addr, socklen_t addrlen)
Bind a socket to a local network address.
int zsock_socket(int family, int type, int proto)
Create a network socket.
int zsock_getsockopt(int sock, int level, int optname, void *optval, socklen_t *optlen)
Get various socket options.
static ssize_t zsock_recv(int sock, void *buf, size_t max_len, int flags)
Receive data from a connected peer.
Definition: socket.h:401
int zsock_getsockname(int sock, struct sockaddr *addr, socklen_t *addrlen)
Get socket name.
int zsock_shutdown(int sock, int how)
Shutdown socket send/receive operations.
ssize_t zsock_recvfrom(int sock, void *buf, size_t max_len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
Receive data from an arbitrary network address.
int zsock_setsockopt(int sock, int level, int optname, const void *optval, socklen_t optlen)
Set various socket options.
ssize_t zsock_sendmsg(int sock, const struct msghdr *msg, int flags)
Send data to an arbitrary network address.
int zsock_listen(int sock, int backlog)
Set up a STREAM socket to accept peer connections.
size_t socklen_t
Definition: net_ip.h:161
flags
Definition: http_parser.h:131
__SIZE_TYPE__ ssize_t
Definition: types.h:28
BSD Sockets compatible API definitions.
static int socket(int family, int type, int proto)
Definition: socket.h:16
static int bind(int sock, const struct sockaddr *addr, socklen_t addrlen)
Definition: socket.h:40
static ssize_t sendmsg(int sock, const struct msghdr *message, int flags)
Definition: socket.h:78
static ssize_t recvfrom(int sock, void *buf, size_t max_len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
Definition: socket.h:84
static int getsockopt(int sock, int level, int optname, void *optval, socklen_t *optlen)
Definition: socket.h:90
static int accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
Definition: socket.h:56
static int listen(int sock, int backlog)
Definition: socket.h:51
static int setsockopt(int sock, int level, int optname, const void *optval, socklen_t optlen)
Definition: socket.h:96
static int getsockname(int sock, struct sockaddr *addr, socklen_t *addrlen)
Definition: socket.h:102
static ssize_t sendto(int sock, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
Definition: socket.h:71
static ssize_t send(int sock, const void *buf, size_t len, int flags)
Definition: socket.h:61
static int socketpair(int family, int type, int proto, int sv[2])
Definition: socket.h:21
static int connect(int sock, const struct sockaddr *addr, socklen_t addrlen)
Definition: socket.h:45
static ssize_t recv(int sock, void *buf, size_t max_len, int flags)
Definition: socket.h:66
static int shutdown(int sock, int how)
Definition: socket.h:35