riot_sys

Function sock_ip_get_local

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

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

This gets the local 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.

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

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

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