UDP Forward
This module includes functions for UDP forward feature.
Summary
The functions in this module are available when udp-forward feature (OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE) is enabled.
Typedefs |
|
|---|---|
otUdpForwarder)(otMessage *aMessage, uint16_t aPeerPort, otIp6Address *aPeerAddr, uint16_t aSockPort, void *aContext)
|
typedefvoid(*
Pointer delivers the UDP packet to host and host should send the packet through its own network stack. |
Functions |
|
|---|---|
otUdpForwardReceive(otInstance *aInstance, otMessage *aMessage, uint16_t aPeerPort, const otIp6Address *aPeerAddr, uint16_t aSockPort)
|
void
Handle a UDP packet received from host.
|
otUdpForwardSetForwarder(otInstance *aInstance, otUdpForwarder aForwarder, void *aContext)
|
void
Set UDP forward callback to deliver UDP packets to host.
|
otUdpIsPortInUse(otInstance *aInstance, uint16_t port)
|
bool
Determines if the given UDP port is exclusively opened by OpenThread API.
|
Typedefs
otUdpForwarder
void(* otUdpForwarder)(otMessage *aMessage, uint16_t aPeerPort, otIp6Address *aPeerAddr, uint16_t aSockPort, void *aContext)
Pointer delivers the UDP packet to host and host should send the packet through its own network stack.
| Details | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
Functions
otUdpForwardReceive
void otUdpForwardReceive( otInstance *aInstance, otMessage *aMessage, uint16_t aPeerPort, const otIp6Address *aPeerAddr, uint16_t aSockPort )
Handle a UDP packet received from host.
No matter the call success or fail, the message is freed.
| Details | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
otUdpForwardSetForwarder
void otUdpForwardSetForwarder( otInstance *aInstance, otUdpForwarder aForwarder, void *aContext )
Set UDP forward callback to deliver UDP packets to host.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
otUdpIsPortInUse
bool otUdpIsPortInUse( otInstance *aInstance, uint16_t port )
Determines if the given UDP port is exclusively opened by OpenThread API.
| 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.