This class implements core UDP message handling.
More...
#include <src/core/net/udp6.hpp>
This class implements core UDP message handling.
§ Udp()
| ot::Ip6::Udp::Udp |
( |
Instance & |
aInstance | ) |
|
|
explicit |
This constructor initializes the object.
- Parameters
-
| [in] | aIp6 | A reference to OpenThread instance. |
§ AddReceiver()
This method adds a UDP receiver.
- Parameters
-
| [in] | aReceiver | A reference to the UDP receiver. |
- Return values
-
| OT_ERROR_NONE | Successfully added the UDP receiver. |
§ AddSocket()
This method adds a UDP socket.
- Parameters
-
| [in] | aSocket | A reference to the UDP socket. |
- Return values
-
| OT_ERROR_NONE | Successfully added the UDP socket. |
§ GetEphemeralPort()
| uint16_t ot::Ip6::Udp::GetEphemeralPort |
( |
void |
| ) |
|
This method returns a new ephemeral port.
- Returns
- A new ephemeral port.
§ HandleMessage()
This method handles a received UDP message.
- Parameters
-
| [in] | aMessage | A reference to the UDP message to process. |
| [in] | aMessageInfo | A reference to the message info associated with aMessage. |
- Return values
-
| OT_ERROR_NONE | Successfully processed the UDP message. |
| OT_ERROR_DROP | Could not fully process the UDP message. |
§ HandlePayload()
This method handles a received UDP message with offset set to the payload.
- Parameters
-
| [in] | aMessage | A reference to the UDP message to process. |
| [in] | aMessageInfo | A reference to the message info associated with aMessage. |
§ NewMessage()
| Message * ot::Ip6::Udp::NewMessage |
( |
uint16_t |
aReserved, |
|
|
uint8_t |
aPriority = kDefaultUdpMessagePriority |
|
) |
| |
This method returns a new UDP message with sufficient header space reserved.
- Parameters
-
| [in] | aReserved | The number of header bytes to reserve after the UDP header. |
| [in] | aPriority | The priority of the message. |
- Returns
- A pointer to the message or NULL if no buffers are available.
§ RemoveReceiver()
This method removes a UDP receiver.
- Parameters
-
| [in] | aReceiver | A reference to the UDP receiver. |
- Return values
-
| OT_ERROR_NONE | Successfully removed the UDP receiver. |
§ RemoveSocket()
This method removes a UDP socket.
- Parameters
-
| [in] | aSocket | A reference to the UDP socket. |
- Return values
-
| OT_ERROR_NONE | Successfully removed the UDP socket. |
§ SendDatagram()
This method sends an IPv6 datagram.
- Parameters
-
| [in] | aMessage | A reference to the message. |
| [in] | aMessageInfo | A reference to the message info associated with aMessage. |
| [in] | aIpProto | The Internet Protocol value. |
- Return values
-
| OT_ERROR_NONE | Successfully enqueued the message into an output interface. |
| OT_ERROR_NO_BUFS | Insufficient available buffer to add the IPv6 headers. |
§ UpdateChecksum()
| otError ot::Ip6::Udp::UpdateChecksum |
( |
Message & |
aMessage, |
|
|
uint16_t |
aPseudoHeaderChecksum |
|
) |
| |
This method updates the UDP checksum.
- Parameters
-
| [in] | aMessage | A reference to the UDP message. |
| [in] | aPseudoHeaderChecksum | The pseudo-header checksum value. |
- Return values
-
| OT_ERROR_NONE | Successfully updated the UDP checksum. |
| OT_ERROR_INVALID_ARGS | The message was invalid. |
The documentation for this class was generated from the following files: