riot_sys

Function l2util_ndp_addr_len_from_l2ao

Source
pub unsafe extern "C" fn l2util_ndp_addr_len_from_l2ao(
    dev_type: c_int,
    opt: *const ndp_opt_t,
) -> c_int
Expand description

@brief Derives the length of the link-layer address in an NDP link-layer address option from that option’s length field and the given device type.

@note If an RFC exists that specifies how IPv6 operates over a link-layer, this function usually implements the section “Unicast Address Mapping”.

@see RFC 4861, section 4.6.1

@attention When NDEBUG is not defined, the node fails with an assertion instead of returning -ENOTSUP

@param[in] dev_type The network device type of the device the @p opt came over in an NDP message. @param[in] opt An NDP source/target link-layer address option.

@return Length of the link-layer address in @p opt on success @return -ENOTSUP, when implementation does not know how to derive the length of the link-layer address from @p opt’s length field based on @p dev_type. @return -EINVAL if opt->len was an invalid value for the given @p dev_type.