riot_sys

Function gnrc_netif_ipv6_iid_from_addr

Source
pub unsafe extern "C" fn gnrc_netif_ipv6_iid_from_addr(
    netif: *const gnrc_netif_t,
    addr: *const u8,
    addr_len: size_t,
    iid: *mut eui64_t,
) -> c_int
Expand description

@brief Converts a given hardware address to an IPv6 IID.

@note The IPv6 IID is derived from the EUI-64 for most link-layers by flipping the U/L bit. @see RFC 2464, section 4 @attention When the link-layer of the interface has link-layer addresses, and NDEBUG is not defined, the node fails with an assertion instead returning -ENOTSUP.

@param[in] netif The network interface @p addr came from (either as gnrc_netif_t::l2addr or from a packet that came over it). @param[in] addr A hardware address. @param[in] addr_len Number of bytes in @p addr. @param[out] iid The IID based on gnrc_netif_t::device_type

@return sizeof(eui64_t) on success. @return -ENOTSUP, when gnrc_netif_t::device_type of @p netif does not support IID conversion. @return -EINVAL, when @p addr_len is invalid for the gnrc_netif_t::device_type of @p netif.