Infrastructure Interface

This module includes the platform abstraction for the adjacent infrastructure network interface.

Summary

Functions

otPlatInfraIfHasAddress(uint32_t aInfraIfIndex, const otIp6Address *aAddress)
bool
This method 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)
This method 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

otPlatInfraIfHasAddress

bool otPlatInfraIfHasAddress(
  uint32_t aInfraIfIndex,
  const otIp6Address *aAddress
)

This method tells whether an infra interface has the given IPv6 address assigned.

Details
Parameters
[in] aInfraIfIndex
The index of the infra interface.
[in] aAddress
The IPv6 address.
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
[in] aInstance
The OpenThread instance structure.
[in] aInfraIfIndex
The index of the infrastructure interface on which the ICMPv6 message is received.
[in] aSrcAddress
The source address this message is received from.
[in] aBuffer
The ICMPv6 message buffer.
[in] aBufferLength
The length of the ICMPv6 message buffer.

otPlatInfraIfSendIcmp6Nd

otError otPlatInfraIfSendIcmp6Nd(
  uint32_t aInfraIfIndex,
  const otIp6Address *aDestAddress,
  const uint8_t *aBuffer,
  uint16_t aBufferLength
)

This method sends an ICMPv6 Neighbor Discovery message on given infrastructure interface.

See RFC 4861: https://tools.ietf.org/html/rfc4861.

Details
Parameters
[in] aInfraIfIndex
The index of the infrastructure interface this message is sent to.
[in] aDestAddress
The destination address this message is sent to.
[in] aBuffer
The ICMPv6 message buffer. The ICMPv6 checksum is left zero and the platform should do the checksum calculate.
[in] aBufferLength
The length of the message buffer.
Return Values
OT_ERROR_NONE
Successfully sent the ICMPv6 message.
OT_ERROR_FAILED
Failed to send the ICMPv6 message.

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
[in] aInstance
The OpenThread instance structure.
[in] aInfraIfIndex
The index of the infrastructure interface.
[in] aIsRunning
A boolean that indicates whether the infrastructure interface is running.
Return Values
OT_ERROR_NONE
Successfully updated the infra interface status.
OT_ERROR_INVALID_STATE
The Routing Manager is not initialized.
OT_ERROR_INVALID_ARGS
The aInfraIfIndex doesn't match the infra interface the Routing Manager are initialized with.

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.