0.01.00
ot::Ip6::Udp Class Reference

This class implements core UDP message handling. More...

#include <src/core/net/udp6.hpp>

Inheritance diagram for ot::Ip6::Udp:
ot::InstanceLocator

Public Member Functions

 Udp (Instance &aInstance)
 This constructor initializes the object. More...
 
otError AddReceiver (UdpReceiver &aReceiver)
 This method adds a UDP receiver. More...
 
otError RemoveReceiver (UdpReceiver &aReceiver)
 This method removes a UDP receiver. More...
 
otError AddSocket (UdpSocket &aSocket)
 This method adds a UDP socket. More...
 
otError RemoveSocket (UdpSocket &aSocket)
 This method removes a UDP socket. More...
 
uint16_t GetEphemeralPort (void)
 This method returns a new ephemeral port. More...
 
MessageNewMessage (uint16_t aReserved, uint8_t aPriority=kDefaultUdpMessagePriority)
 This method returns a new UDP message with sufficient header space reserved. More...
 
otError SendDatagram (Message &aMessage, MessageInfo &aMessageInfo, IpProto aIpProto)
 This method sends an IPv6 datagram. More...
 
otError HandleMessage (Message &aMessage, MessageInfo &aMessageInfo)
 This method handles a received UDP message. More...
 
void HandlePayload (Message &aMessage, MessageInfo &aMessageInfo)
 This method handles a received UDP message with offset set to the payload. More...
 
otError UpdateChecksum (Message &aMessage, uint16_t aPseudoHeaderChecksum)
 This method updates the UDP checksum. More...
 
- Public Member Functions inherited from ot::InstanceLocator
InstanceGetInstance (void) const
 This method returns a reference to the parent OpenThread Instance. More...
 
Ip6::Ip6GetIp6 (void) const
 This method returns a reference to the Ip6. More...
 
ThreadNetifGetNetif (void) const
 This method returns a reference to the thread network interface. More...
 
NotifierGetNotifier (void) const
 This method returns a reference to the Notifier. More...
 

Friends

class UdpSocket
 

Additional Inherited Members

- Protected Member Functions inherited from ot::InstanceLocator
 InstanceLocator (Instance &aInstance)
 This constructor initializes the object. More...
 

Detailed Description

This class implements core UDP message handling.

Constructor & Destructor Documentation

§ Udp()

ot::Ip6::Udp::Udp ( Instance aInstance)
explicit

This constructor initializes the object.

Parameters
[in]aIp6A reference to OpenThread instance.

Member Function Documentation

§ AddReceiver()

otError ot::Ip6::Udp::AddReceiver ( UdpReceiver aReceiver)

This method adds a UDP receiver.

Parameters
[in]aReceiverA reference to the UDP receiver.
Return values
OT_ERROR_NONESuccessfully added the UDP receiver.

§ AddSocket()

otError ot::Ip6::Udp::AddSocket ( UdpSocket aSocket)

This method adds a UDP socket.

Parameters
[in]aSocketA reference to the UDP socket.
Return values
OT_ERROR_NONESuccessfully 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()

otError ot::Ip6::Udp::HandleMessage ( Message aMessage,
MessageInfo aMessageInfo 
)

This method handles a received UDP message.

Parameters
[in]aMessageA reference to the UDP message to process.
[in]aMessageInfoA reference to the message info associated with aMessage.
Return values
OT_ERROR_NONESuccessfully processed the UDP message.
OT_ERROR_DROPCould not fully process the UDP message.

§ HandlePayload()

void ot::Ip6::Udp::HandlePayload ( Message aMessage,
MessageInfo aMessageInfo 
)

This method handles a received UDP message with offset set to the payload.

Parameters
[in]aMessageA reference to the UDP message to process.
[in]aMessageInfoA 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]aReservedThe number of header bytes to reserve after the UDP header.
[in]aPriorityThe priority of the message.
Returns
A pointer to the message or NULL if no buffers are available.

§ RemoveReceiver()

otError ot::Ip6::Udp::RemoveReceiver ( UdpReceiver aReceiver)

This method removes a UDP receiver.

Parameters
[in]aReceiverA reference to the UDP receiver.
Return values
OT_ERROR_NONESuccessfully removed the UDP receiver.

§ RemoveSocket()

otError ot::Ip6::Udp::RemoveSocket ( UdpSocket aSocket)

This method removes a UDP socket.

Parameters
[in]aSocketA reference to the UDP socket.
Return values
OT_ERROR_NONESuccessfully removed the UDP socket.

§ SendDatagram()

otError ot::Ip6::Udp::SendDatagram ( Message aMessage,
MessageInfo aMessageInfo,
IpProto  aIpProto 
)

This method sends an IPv6 datagram.

Parameters
[in]aMessageA reference to the message.
[in]aMessageInfoA reference to the message info associated with aMessage.
[in]aIpProtoThe Internet Protocol value.
Return values
OT_ERROR_NONESuccessfully enqueued the message into an output interface.
OT_ERROR_NO_BUFSInsufficient 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]aMessageA reference to the UDP message.
[in]aPseudoHeaderChecksumThe pseudo-header checksum value.
Return values
OT_ERROR_NONESuccessfully updated the UDP checksum.
OT_ERROR_INVALID_ARGSThe message was invalid.

The documentation for this class was generated from the following files: