otPlatBorderRoutingProcessIcmp6Ra

Function otPlatBorderRoutingProcessIcmp6Ra 

Source
pub unsafe extern "C" fn otPlatBorderRoutingProcessIcmp6Ra(
    aInstance: *mut otInstance,
    aMessage: *const u8,
    aLength: u16,
)
Expand description

Callback from the platform to report DHCPv6 Prefix Delegation (PD) prefixes.

Requires OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE and OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE to be enabled, while OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_CLIENT_ENABLE should be disabled.

When OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_CLIENT_ENABLE is enabled, the OpenThread stack’s native DHCPv6 PD client will be used. Otherwise, the platform layer is expected to interact with DHCPv6 servers to acquire and provide the delegated prefix(es) using this callback or otPlatBorderRoutingProcessDhcp6PdPrefix().

In this function, an ICMPv6 Router Advertisement (received on the platform’s Thread interface) is passed to the OpenThread stack. This RA message is intended as a mechanism to distribute DHCPv6 PD prefixes to a Thread Border Router. Each Prefix Information Option (PIO) in the RA is evaluated as a candidate DHCPv6 PD prefix.

This function can be called again to renew/refresh the lifetimes of PD prefixes or to signal their deprecation (by setting a zero “preferred lifetime”) or removal (by setting a zero “valid lifetime”).

Important note: it is not expected that the RA message will contain all currently valid PD prefixes. The OT stack will parse the RA and process all included PIOs as PD prefix candidates. Any previously reported PD prefix (from an earlier call to this function or otPlatBorderRoutingProcessDhcp6PdPrefix()) that does not appear in the new RA remains unchanged (i.e., it will be assumed valid until its previously indicated lifetime expires).

The aMessage should point to a buffer containing the ICMPv6 message payload (excluding the IP headers but including the ICMPv6 header) with “Router Advertisement” (code 134) as the value of the Type field in the ICMPv6 header.

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aMessage A pointer to an ICMPv6 Router Advertisement message. @param[in] aLength The length of the ICMPv6 Router Advertisement message.