| 
    Zephyr Project API
    3.4.0
    
   A Scalable Open Source RTOS 
   | 
 
BSD Sockets compatible API definitions. More...
#include <sys/types.h>#include <zephyr/types.h>#include <zephyr/net/net_ip.h>#include <zephyr/net/dns_resolve.h>#include <zephyr/net/socket_select.h>#include <zephyr/sys/iterable_sections.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_getpeername (int sock, struct sockaddr *addr, socklen_t *addrlen) | 
| Get peer name.  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... | |
| static int | socket (int family, int type, int proto) | 
| static int | socketpair (int family, int type, int proto, int sv[2]) | 
| static int | close (int sock) | 
| static int | shutdown (int sock, int how) | 
| static int | bind (int sock, const struct sockaddr *addr, socklen_t addrlen) | 
| static int | connect (int sock, const struct sockaddr *addr, socklen_t addrlen) | 
| static int | listen (int sock, int backlog) | 
| static int | accept (int sock, struct sockaddr *addr, socklen_t *addrlen) | 
| static ssize_t | send (int sock, const void *buf, size_t len, int flags) | 
| static ssize_t | recv (int sock, void *buf, size_t max_len, int flags) | 
| static int | zsock_fcntl_wrapper (int sock, int cmd,...) | 
| static ssize_t | sendto (int sock, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) | 
| static ssize_t | sendmsg (int sock, const struct msghdr *message, int flags) | 
| static ssize_t | recvfrom (int sock, void *buf, size_t max_len, int flags, struct sockaddr *src_addr, socklen_t *addrlen) | 
| static int | poll (struct zsock_pollfd *fds, int nfds, int timeout) | 
| static int | getsockopt (int sock, int level, int optname, void *optval, socklen_t *optlen) | 
| static int | setsockopt (int sock, int level, int optname, const void *optval, socklen_t optlen) | 
| static int | getpeername (int sock, struct sockaddr *addr, socklen_t *addrlen) | 
| static int | getsockname (int sock, struct sockaddr *addr, socklen_t *addrlen) | 
| static int | getaddrinfo (const char *host, const char *service, const struct zsock_addrinfo *hints, struct zsock_addrinfo **res) | 
| static void | freeaddrinfo (struct zsock_addrinfo *ai) | 
| static const char * | gai_strerror (int errcode) | 
| static int | getnameinfo (const struct sockaddr *addr, socklen_t addrlen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags) | 
| static int | gethostname (char *buf, size_t len) | 
| static int | inet_pton (sa_family_t family, const char *src, void *dst) | 
| static char * | inet_ntop (sa_family_t family, const void *src, char *dst, size_t size) | 
BSD Sockets compatible API definitions.
An API for applications to use BSD Sockets like API.