riot_sys

Function sock_ip_get_remote

Source
pub unsafe extern "C" fn sock_ip_get_remote(
    sock: *mut sock_ip_t,
    ep: *mut sock_ip_ep_t,
) -> c_int
Expand description

@brief Gets the remote end point of a raw IPv4/IPv6 sock object

@pre (sock != NULL) && (ep != NULL)

This gets the remote end point of a raw IPv4/IPv6 sock object. Note that this might not be the same end point you added in @ref sock_ip_create(), but an end point more suitable for the implementation. Examples for this might be that if sock_ip_ep_t::netif is given in @ref sock_ip_create(), the implementation might choose to return the address on this interface the @p sock is bound to in @p ep’s sock_ip_ep_t::addr.

@param[in] sock A raw IPv4/IPv6 sock object. @param[out] ep The remote end point.

@return 0 on success. @return -ENOTCONN, when @p sock has no remote end point bound to it.