Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
BSD Sockets compatible API definitions. More...
#include <sys/types.h>
#include <zephyr/types.h>
#include <net/net_ip.h>
#include <net/dns_resolve.h>
#include <net/socket_select.h>
#include <stdlib.h>
#include <syscalls/socket.h>
Go to the source code of this file.
Data Structures | |
struct | zsock_pollfd |
struct | zsock_addrinfo |
struct | ifreq |
Functions | |
void * | zsock_get_context_object (int sock) |
Obtain a file descriptor's associated net context. More... | |
int | zsock_socket (int family, int type, int proto) |
Create a network socket. More... | |
int | zsock_socketpair (int family, int type, int proto, int *sv) |
Create an unnamed pair of connected sockets. More... | |
int | zsock_close (int sock) |
Close a network socket. More... | |
int | zsock_shutdown (int sock, int how) |
Shutdown socket send/receive operations. More... | |
int | zsock_bind (int sock, const struct sockaddr *addr, socklen_t addrlen) |
Bind a socket to a local network address. More... | |
int | zsock_connect (int sock, const struct sockaddr *addr, socklen_t addrlen) |
Connect a socket to a peer network address. More... | |
int | zsock_listen (int sock, int backlog) |
Set up a STREAM socket to accept peer connections. More... | |
int | zsock_accept (int sock, struct sockaddr *addr, socklen_t *addrlen) |
Accept a connection on listening socket. More... | |
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. More... | |
static ssize_t | zsock_send (int sock, const void *buf, size_t len, int flags) |
Send data to a connected peer. More... | |
ssize_t | zsock_sendmsg (int sock, const struct msghdr *msg, int flags) |
Send data to an arbitrary network address. More... | |
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. More... | |
static ssize_t | zsock_recv (int sock, void *buf, size_t max_len, int flags) |
Receive data from a connected peer. More... | |
int | zsock_fcntl (int sock, int cmd, int flags) |
Control blocking/non-blocking mode of a socket. More... | |
int | zsock_poll (struct zsock_pollfd *fds, int nfds, int timeout) |
Efficiently poll multiple sockets for events. More... | |
int | zsock_getsockopt (int sock, int level, int optname, void *optval, socklen_t *optlen) |
Get various socket options. More... | |
int | zsock_setsockopt (int sock, int level, int optname, const void *optval, socklen_t optlen) |
Set various socket options. More... | |
int | zsock_getsockname (int sock, struct sockaddr *addr, socklen_t *addrlen) |
Get socket name. More... | |
int | zsock_gethostname (char *buf, size_t len) |
Get local host name. More... | |
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. More... | |
int | zsock_inet_pton (sa_family_t family, const char *src, void *dst) |
Convert network address from numeric ASCII form to internal representation. More... | |
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. More... | |
void | zsock_freeaddrinfo (struct zsock_addrinfo *ai) |
Free results returned by zsock_getaddrinfo() More... | |
const char * | zsock_gai_strerror (int errcode) |
Convert zsock_getaddrinfo() error code to textual message. More... | |
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. More... | |
BSD Sockets compatible API definitions.
An API for applications to use BSD Sockets like API.