Skip to content

Commit

Permalink
fixup! sock: Introduction of new application layer API
Browse files Browse the repository at this point in the history
Add more error classes
  • Loading branch information
miri64 committed Sep 2, 2016
1 parent d17ef91 commit 09703e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions sys/include/net/sock/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ typedef struct sock_ip sock_ip_t;
* other (i.e. `(local->netif != remote->netif) &&
* ((local->netif != SOCK_ADDR_ANY_NETIF) ||
* (remote->netif != SOCK_ADDR_ANY_NETIF))` if neither is `NULL`).
* @return -ENOMEM, if the stack can't provide enough resources for `sock` to
* be created.
* @return -EPROTONOSUPPORT, if `local != NULL` or `remote != NULL` and
* proto is not supported by sock_ip_ep_t::family of @p local or @p
* remote.
Expand Down Expand Up @@ -150,6 +152,7 @@ int sock_ip_get_remote(sock_ip_t *sock, sock_ip_ep_t *ep);
* @return -EADDRNOTAVAIL, if local of @p sock is not given.
* @return -ENOBUFS, if buffer space is not large enough to store received
* data.
* @return -ENOMEM, if no memory was available to receive @p data.
* @return -EPROTO, if source address of received packet did not equal
* the remote of @p sock.
* @return -ETIMEDOUT, if @p timeout expired.
Expand Down Expand Up @@ -181,6 +184,8 @@ ssize_t sock_ip_recv(sock_ip_t *sock, void *data, size_t max_len,
* @return The number of bytes send on success.
* @return -EAFNOSUPPORT, if `remote != NULL` and sock_ip_ep_t::family of
* @p remote is != AF_UNSPEC and not supported.
* @return -EHOSTUNREACH, if @p remote or remote end point of @p sock is not
* reachable.
* @return -ENOMEM, if no memory was available to send @p data.
* @return -ENOTCONN, if `remote == NULL`, but @p sock has no remote end point.
* @return -EPROTOTYPE, if `sock == NULL` and @p proto is not by
Expand Down
6 changes: 5 additions & 1 deletion sys/include/net/sock/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ typedef struct sock_udp sock_udp_t;
* `(local->netif != remote->netif) &&
* ((local->netif != SOCK_ADDR_ANY_NETIF) ||
* (remote->netif != SOCK_ADDR_ANY_NETIF))` if neither is `NULL`).
* `
* @return -ENOMEM, if the stack can't provide enough resources for `sock` to
* be created.
*/
int sock_udp_create(sock_udp_t *sock, const sock_udp_ep_t *local,
const sock_udp_ep_t *remote, uint16_t flags);
Expand Down Expand Up @@ -151,6 +152,7 @@ int sock_udp_get_remote(sock_udp_t *sock, sock_udp_ep_t *ep);
* @return -EADDRNOTAVAIL, if local of @p sock is not given.
* @return -ENOBUFS, if buffer space is not large enough to store received
* data.
* @return -ENOMEM, if no memory was available to receive @p data.
* @return -EPROTO, if source address of received packet did not equal
* the remote of @p sock.
* @return -ETIMEDOUT, if @p timeout expired.
Expand Down Expand Up @@ -180,6 +182,8 @@ ssize_t sock_udp_recv(sock_udp_t *sock, void *data, size_t max_len,
* @return The number of bytes sent on success.
* @return -EAFNOSUPPORT, if `remote != NULL` and sock_udp_ep_t::family of
* @p remote is != AF_UNSPEC and not supported.
* @return -EHOSTUNREACH, if @p remote or remote end point of @p sock is not
* reachable.
* @return -EINVAL, if sock_udp_ep_t::netif of @p remote is not a valid
* interface or contradicts the given local interface (i.e.
* neither the local end point of `sock` nor remote are assigned to
Expand Down

0 comments on commit 09703e1

Please sign in to comment.