Infrastructure Interface
This module includes the platform abstraction for the adjacent infrastructure network interface.
Summary
Functions |
|
---|---|
otPlatGetInfraIfLinkLayerAddress(otInstance *aInstance, uint32_t aIfIndex, otPlatInfraIfLinkLayerAddress *aInfraIfLinkLayerAddress)
|
Get the link-layer address of the infrastructure interface.
|
otPlatInfraIfDhcp6PdClientHandleReceived(otInstance *aInstance, otMessage *aMessage, uint32_t aInfraIfIndex)
|
void
Callback from the platform to notify the OpenThread stack of a received DHCPv6 message.
|
otPlatInfraIfDhcp6PdClientSend(otInstance *aInstance, otMessage *aMessage, otIp6Address *aDestAddress, uint32_t aInfraIfIndex)
|
void
Sends a DHCPv6 message to a unicast or multicast destination address.
|
otPlatInfraIfDhcp6PdClientSetListeningEnabled(otInstance *aInstance, bool aEnable, uint32_t aInfraIfIndex)
|
void
Enables or disables listening for DHCPv6 Prefix Delegation (PD) messages on client.
|
otPlatInfraIfDiscoverNat64Prefix(uint32_t aInfraIfIndex)
|
Send a request to discover the NAT64 prefix on the infrastructure interface with
aInfraIfIndex . |
otPlatInfraIfDiscoverNat64PrefixDone(otInstance *aInstance, uint32_t aInfraIfIndex, const otIp6Prefix *aIp6Prefix)
|
void
The infra interface driver calls this method to notify OpenThread that the discovery of NAT64 prefix is done.
|
otPlatInfraIfHasAddress(uint32_t aInfraIfIndex, const otIp6Address *aAddress)
|
bool
Tells whether an infra interface has the given IPv6 address assigned.
|
otPlatInfraIfRecvIcmp6Nd(otInstance *aInstance, uint32_t aInfraIfIndex, const otIp6Address *aSrcAddress, const uint8_t *aBuffer, uint16_t aBufferLength)
|
void
The infra interface driver calls this method to notify OpenThread that an ICMPv6 Neighbor Discovery message is received.
|
otPlatInfraIfSendIcmp6Nd(uint32_t aInfraIfIndex, const otIp6Address *aDestAddress, const uint8_t *aBuffer, uint16_t aBufferLength)
|
Sends an ICMPv6 Neighbor Discovery message on given infrastructure interface.
|
otPlatInfraIfStateChanged(otInstance *aInstance, uint32_t aInfraIfIndex, bool aIsRunning)
|
The infra interface driver calls this method to notify OpenThread of the interface state changes.
|
Functions
otPlatGetInfraIfLinkLayerAddress
otError otPlatGetInfraIfLinkLayerAddress( otInstance *aInstance, uint32_t aIfIndex, otPlatInfraIfLinkLayerAddress *aInfraIfLinkLayerAddress )
Get the link-layer address of the infrastructure interface.
OpenThread invokes this method when the address is required, for example: when generating an ND6 message which includes a source link-layer address option.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otPlatInfraIfDhcp6PdClientHandleReceived
void otPlatInfraIfDhcp6PdClientHandleReceived( otInstance *aInstance, otMessage *aMessage, uint32_t aInfraIfIndex )
Callback from the platform to notify the OpenThread stack of a received DHCPv6 message.
This function is provided when OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_CLIENT_ENABLE
is enabled.
The platform calls this function whenever a DHCPv6 message is received on the client port (546) while listening on this port is enabled (refer to otPlatInfraIfDhcp6PdClientSetListeningEnabled()
).
The platform is responsible for allocating the otMessage
to pass the received UDP payload. Ownership of the aMessage
is passed to the OpenThread stack (which will free it once no longer needed).
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otPlatInfraIfDhcp6PdClientSend
void otPlatInfraIfDhcp6PdClientSend( otInstance *aInstance, otMessage *aMessage, otIp6Address *aDestAddress, uint32_t aInfraIfIndex )
Sends a DHCPv6 message to a unicast or multicast destination address.
This function is only used when OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_CLIENT_ENABLE
is enabled.
The platform is responsible for constructing a UDP datagram with the given DHCPv6 message as its payload. The datagram must be sent from the DHCPv6 client port (546) to the server port (547) on the specified infrastructure interface. The destination IPv6 address can be a unicast address or the multicast All_DHCP_Relay_Agents_and_Servers
address (ff02::1:2
).
This function passes the ownership of aMessage
to the platform layer. Platform MUST then free the message when no longer needed.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
otPlatInfraIfDhcp6PdClientSetListeningEnabled
void otPlatInfraIfDhcp6PdClientSetListeningEnabled( otInstance *aInstance, bool aEnable, uint32_t aInfraIfIndex )
Enables or disables listening for DHCPv6 Prefix Delegation (PD) messages on client.
This function is only used when OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_CLIENT_ENABLE
is enabled.
When enabled, the platform must open a UDP socket on the specified infrastructure interface, binding to the DHCPv6 client port 546 to receive messages from DHCPv6 servers.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otPlatInfraIfDiscoverNat64Prefix
otError otPlatInfraIfDiscoverNat64Prefix( uint32_t aInfraIfIndex )
Send a request to discover the NAT64 prefix on the infrastructure interface with aInfraIfIndex
.
OpenThread will call this method periodically to monitor the presence or change of NAT64 prefix.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otPlatInfraIfDiscoverNat64PrefixDone
void otPlatInfraIfDiscoverNat64PrefixDone( otInstance *aInstance, uint32_t aInfraIfIndex, const otIp6Prefix *aIp6Prefix )
The infra interface driver calls this method to notify OpenThread that the discovery of NAT64 prefix is done.
Is expected to be invoked after calling otPlatInfraIfDiscoverNat64Prefix. If no NAT64 prefix is discovered, aIp6Prefix
shall point to an empty prefix with zero length.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otPlatInfraIfHasAddress
bool otPlatInfraIfHasAddress( uint32_t aInfraIfIndex, const otIp6Address *aAddress )
Tells whether an infra interface has the given IPv6 address assigned.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
TRUE if the infra interface has given IPv6 address assigned, FALSE otherwise.
|
otPlatInfraIfRecvIcmp6Nd
void otPlatInfraIfRecvIcmp6Nd( otInstance *aInstance, uint32_t aInfraIfIndex, const otIp6Address *aSrcAddress, const uint8_t *aBuffer, uint16_t aBufferLength )
The infra interface driver calls this method to notify OpenThread that an ICMPv6 Neighbor Discovery message is received.
See RFC 4861: https://tools.ietf.org/html/rfc4861.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
otPlatInfraIfSendIcmp6Nd
otError otPlatInfraIfSendIcmp6Nd( uint32_t aInfraIfIndex, const otIp6Address *aDestAddress, const uint8_t *aBuffer, uint16_t aBufferLength )
Sends an ICMPv6 Neighbor Discovery message on given infrastructure interface.
See RFC 4861: https://tools.ietf.org/html/rfc4861.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otPlatInfraIfStateChanged
otError otPlatInfraIfStateChanged( otInstance *aInstance, uint32_t aInfraIfIndex, bool aIsRunning )
The infra interface driver calls this method to notify OpenThread of the interface state changes.
It is fine for the platform to call to method even when the running state of the interface hasn't changed. In this case, the Routing Manager state is not affected.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.