NetBurner 3.1
UDP - Socket API

The NetBurner UDP protocol Socket API. More...

Functions

 UDPPacket::UDPPacket (OS_FIFO *pFifo, uint32_t timeout)
 Constructor to create a UDP Packet object from a UDP FIFO entry. More...
 
 UDPPacket::UDPPacket (int sock)
 Constructor to create a UDP Packet object from an open UDP socket. More...
 
 UDPPacket::UDPPacket (PoolPtr p)
 Constructor to create a UDP packet from a system pool buffer. More...
 
 UDPPacket::UDPPacket (UDPPacket &pkt)
 Constructor to create a new UDP packet from an existing UDP packet. More...
 
 UDPPacket::~UDPPacket ()
 UDP packet object destructor. Frees any associated memory. More...
 
void UDPPacket::SetSourcePort (uint16_t port)
 Set the source port number of a UDP Packet object. More...
 
uint16_t UDPPacket::GetSourcePort (void) const
 Get the source port number of a UDP Packet object. More...
 
IPADDR4 UDPPacket::GetSourceAddress4 (void)
 Get the source IPv4 address a UDP Packet object. More...
 
IPADDR4 UDPPacket::GetDestinationAddress4 ()
 Get the destination IPv4 address a UDP Packet object. More...
 
MACADR UDPPacket::GetMacSource ()
 Get the source MAC address a UDP Packet object. More...
 
IPADDR6 UDPPacket::GetSourceAddress6 (void)
 Get the source IPv6 address a UDP Packet object. More...
 
IPADDR6 UDPPacket::GetDestinationAddress6 ()
 Get the destination IPv6 address a UDP Packet object. More...
 
void UDPPacket::SetDestinationPort (uint16_t)
 Set the destination port number of a UDP Packet object. More...
 
uint16_t UDPPacket::GetDestinationPort (void) const
 Get the destination port number of a UDP Packet object. More...
 
puint8_t UDPPacket::GetDataBuffer (bool bReAllocateIfNeeded=false)
 Get a pointer to the UDP Packet object's data buffer. More...
 
void UDPPacket::SetDataSize (uint16_t numBytes)
 Set the UDP Packet data size. More...
 
uint16_t UDPPacket::GetDataSize (void) const
 Get the UDP Packet object data size. More...
 
void UDPPacket::AddData (puint8_t pData, uint16_t len)
 Add data to a UDP Packet object. More...
 
void UDPPacket::AddData (PCSTR pData)
 Add data to a UDP Packet object as a NULL terminated ASCII string. More...
 
void UDPPacket::AddDataWord (uint16_t w)
 Add a 16-bit unsigned integer to a UDP Packet object. More...
 
void UDPPacket::AddDataByte (uint8_t b)
 Add an 8-bit unsigned integer to a UDP Packet object. More...
 
BOOL UDPPacket::Validate (void)
 Verify a received UDP packet. More...
 
void UDPPacket::ResetData (void)
 Set the data size of a UDP Packet object to 0.
 
void UDPPacket::SendAndKeep4 (IPADDR4 destIP, uint8_t ttl=0)
 Make a copy of a UDP Packet and send it. The original packet will remain intact. More...
 
void UDPPacket::Send4 (IPADDR4 destIP, uint8_t ttl=0)
 Send the UDP Packet and free the pool buffer. More...
 
void UDPPacket::SendViaInterfaceNum4 (IPADDR4 destIP, int interface, uint8_t ttl=0)
 Send the UDP Packet using the specified interface, and free the pool buffer. More...
 
void UDPPacket::SendAndKeep6 (const IPADDR6 &to, uint8_t ttl=0)
 Make a copy of a UDP Packet and send it. The original packet will remain intact. More...
 
void UDPPacket::Send6 (const IPADDR6 &to, uint8_t ttl=0)
 Send the UDP Packet and free the pool buffer. More...
 
void UDPPacket::SendViaInterfaceNum6 (const IPADDR6 &to, int interface, uint8_t ttl=0)
 Send the UDP Packet using the specified interface, and free the pool buffer. More...
 
int CreateRxUdpSocket (uint16_t listening_port)
 Open a UDP socket for receiving incoming UDP packets. More...
 
int CreateTxUdpSocket4 (IPADDR4 send_to_addr, uint16_t remote_port, uint16_t local_port)
 Open a UDP socket for transmitting UDP packets. More...
 
int CreateRxTxUdpSocket4 (IPADDR4 send_to_addr, uint16_t send_to_remote_port, uint16_t local_port)
 Open a UDP socket that can transmit and receive UDP packets. More...
 
int CreateTxUdpSocket6 (const IPADDR6 &send_to_addr, uint16_t remote_port, uint16_t local_port)
 Open a UDP socket for transmitting UDP packets. More...
 
int CreateTxUdpSocket (const IPADDR6 &send_to_addr, uint16_t remote_port, uint16_t local_port)
 Open a UDP socket for transmitting UDP packets. More...
 
int CreateRxTxUdpSocket6 (const IPADDR6 &send_to_addr, uint16_t send_to_remote_port, uint16_t local_port)
 Open a UDP socket that can transmit and receive UDP packets. More...
 
int sendto4 (int sock, puint8_t what_to_send, int len_to_send, IPADDR4 to_addr, uint16_t remote_port)
 Send a UDP packet. More...
 
int sendto6 (int sock, puint8_t what_to_send, int len_to_send, const IPADDR6 &to_addr, uint16_t remote_port)
 Send a UDP packet. More...
 
int sendto (int sock, puint8_t what_to_send, int len_to_send, const IPADDR6 &to_addr, uint16_t remote_port)
 Send a UDP packet. More...
 
int sendtovia4 (int sock, puint8_t what_to_send, int len_to_send, IPADDR4 to_addr, uint16_t remote_port, int intfnum)
 Send a UDP packet on the specified interface. More...
 
int sendtovia6 (int sock, puint8_t what_to_send, int len_to_send, const IPADDR6 &to_addr, uint16_t remote_port, int intfnum)
 Send a UDP packet on the specified interface. More...
 
int recvfrom4 (int sock, puint8_t buffer, int len, IPADDR4 *pAddr, uint16_t *pLocal_port, uint16_t *pRemote_port)
 Receive a UDP packet. More...
 
int recvfrom6 (int sock, puint8_t buffer, int len, IPADDR6 *pAddr, uint16_t *pLocal_port, uint16_t *pRemote_port)
 Receive a UDP packet. More...
 
int recvfrom (int sock, puint8_t buffer, int len, IPADDR6 *pAddr, uint16_t *pLocal_port, uint16_t *pRemote_port)
 Receive a UDP packet. More...
 

Detailed Description

The NetBurner UDP protocol Socket API.

The NetBurner UDP protocol API is implemented in two ways:

   1. As a C++ class, which makes memory management easier.
   2. Wrapper functions that implement a UDP sockets interface.

Function Documentation

◆ AddData() [1/2]

void UDPPacket::AddData ( puint8_t  pData,
uint16_t  len 
)

Add data to a UDP Packet object.

Parameters
pDataPointer to the data to add
lenNumber of bytes
See also
AddDataByte( uint8_t b ), AddDataWord( uint16_t w ), AddData( PCSTR pData )

◆ AddData() [2/2]

void UDPPacket::AddData ( PCSTR  pData)

Add data to a UDP Packet object as a NULL terminated ASCII string.

Parameters
pDataPointer to the null terminated string
See also
AddDataByte( uint8_t b ), AddDataWord( uint16_t w ), AddData( puint8_t pData, uint16_t len )

◆ AddDataByte()

void UDPPacket::AddDataByte ( uint8_t  b)

Add an 8-bit unsigned integer to a UDP Packet object.

Parameters
b8-bit unsigned integer
See also
AddDataWord( uint16_t w ), AddData( PCSTR pData ), AddData( puint8_t pData, uint16_t len )

◆ AddDataWord()

void UDPPacket::AddDataWord ( uint16_t  w)

Add a 16-bit unsigned integer to a UDP Packet object.

Parameters
w16 bit unsigned integer
See also
AddDataByte( uint8_t b ), AddData( PCSTR pData ), AddData( puint8_t pData, uint16_t len )

◆ CreateRxTxUdpSocket4()

int CreateRxTxUdpSocket4 ( IPADDR4  send_to_addr,
uint16_t  send_to_remote_port,
uint16_t  local_port 
)

Open a UDP socket that can transmit and receive UDP packets.

Calling CreateRxTxUdpSocket() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
send_to_addrDestination IP address
send_to_remote_portDestination port number
local_portLocal port number. A value of 0 will select a random port number (recommended)
Returns
The file descriptor for the UDP socket
See also
CreateRxUdpSocket(), CreateTxUdpSocket4()

◆ CreateRxTxUdpSocket6()

int CreateRxTxUdpSocket6 ( const IPADDR6 send_to_addr,
uint16_t  send_to_remote_port,
uint16_t  local_port 
)

Open a UDP socket that can transmit and receive UDP packets.

Calling CreateRxTxUdpSocket() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
send_to_addrDestination IP address
send_to_remote_portDestination port number
local_portLocal port number. A value of 0 will select a random port number (recommended)
Returns
The file descriptor for the UDP socket
See also
CreateRxUdpSocket(), CreateTxUdpSocket6(), CreateRxTxUdpSocket4()

◆ CreateRxUdpSocket()

int CreateRxUdpSocket ( uint16_t  listening_port)

Open a UDP socket for receiving incoming UDP packets.

Returns a file descriptor that can be used by read functions such as: read() and select() to process multiple file descriptors at one time.

Parameters
listening_portPort to listen on for incoming packets
Returns
The file descriptor for the UDP socket
See also
CreateTxUdpSocket4(), CreateRxTxUdpSocket4()

◆ CreateTxUdpSocket()

int CreateTxUdpSocket ( const IPADDR6 send_to_addr,
uint16_t  remote_port,
uint16_t  local_port 
)
inline

Open a UDP socket for transmitting UDP packets.

Calling CreateTxUdpSocket() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Returns a file descriptor that can be used by transmit functions such as sendto().

Parameters
send_to_addrDestination IP address
remote_portDestination port number
local_portLocal port number. A value of 0 will select a random port number (recommended)
Returns
The file descriptor for the UDP socket
See also
CreateRxUdpSocket(), CreateRxTxUdpSocket4()

◆ CreateTxUdpSocket4()

int CreateTxUdpSocket4 ( IPADDR4  send_to_addr,
uint16_t  remote_port,
uint16_t  local_port 
)

Open a UDP socket for transmitting UDP packets.

Calling CreateTxUdpSocket() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Returns a file descriptor that can be used by transmit functions such as write().

Parameters
send_to_addrDestination IP address
remote_portDestination port number
local_portLocal port number. A value of 0 will select a random port number (recommended)
Returns
The file descriptor for the UDP socket
See also
CreateRxUdpSocket(), CreateRxTxUdpSocket4()

◆ CreateTxUdpSocket6()

int CreateTxUdpSocket6 ( const IPADDR6 send_to_addr,
uint16_t  remote_port,
uint16_t  local_port 
)

Open a UDP socket for transmitting UDP packets.

Calling CreateTxUdpSocket() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Returns a file descriptor that can be used by transmit functions such as sendto().

Parameters
send_to_addrDestination IP address
remote_portDestination port number
local_portLocal port number. A value of 0 will select a random port number (recommended)
Returns
The file descriptor for the UDP socket
See also
CreateRxUdpSocket(), CreateRxTxUdpSocket6(), CreateRxTxUdpSocket4()

◆ GetDataBuffer()

puint8_t UDPPacket::GetDataBuffer ( bool  bReAllocateIfNeeded = false)

Get a pointer to the UDP Packet object's data buffer.

Returns
Pointer to the data buffer

◆ GetDataSize()

uint16_t UDPPacket::GetDataSize ( void  ) const

Get the UDP Packet object data size.

Returns
The data size as number of bytes
See also
SetDataSize()

◆ GetDestinationAddress4()

IPADDR4 UDPPacket::GetDestinationAddress4 ( void  )

Get the destination IPv4 address a UDP Packet object.

Calling GetDestinationAddress() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Returns
The destination IP address
See also
GetSourceAddress4(), GetDestinationAddress6()

◆ GetDestinationAddress6()

IPADDR6 UDPPacket::GetDestinationAddress6 ( )

Get the destination IPv6 address a UDP Packet object.

Calling GetDestinationAddress() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Returns
The destination IP address
See also
GetSourceAddress6(), GetDestinationAddress4()

◆ GetDestinationPort()

uint16_t UDPPacket::GetDestinationPort ( void  ) const

Get the destination port number of a UDP Packet object.

Returns
The destination port number
See also
GetDestinationPort()

◆ GetMacSource()

MACADR UDPPacket::GetMacSource ( )

Get the source MAC address a UDP Packet object.

Returns
The source MAC address

◆ GetSourceAddress4()

IPADDR4 UDPPacket::GetSourceAddress4 ( void  )

Get the source IPv4 address a UDP Packet object.

Calling GetSourceAddress() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Returns
The source IP address
See also
GetDestinationAddress4(), GetSourceAddress6()

◆ GetSourceAddress6()

IPADDR6 UDPPacket::GetSourceAddress6 ( void  )

Get the source IPv6 address a UDP Packet object.

Calling GetSourceAddress() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Returns
The source IP address
See also
GetDestinationAddress6(), GetSourceAddress4()

◆ GetSourcePort()

uint16_t UDPPacket::GetSourcePort ( void  ) const

Get the source port number of a UDP Packet object.

Returns
The source port number
See also
SetSourcePort()

◆ recvfrom()

int recvfrom ( int  sock,
puint8_t  buffer,
int  len,
IPADDR6 pAddr,
uint16_t *  pLocal_port,
uint16_t *  pRemote_port 
)
inline

Receive a UDP packet.

Calling recvfrom() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockFile descriptor from a previous call to CreateRxUdpSocket() or CreateRxTxSocket()
bufferPointer to BYTE array buffer to store received UDP packet data
lenMaximum number of bytes to receive
pAddrPointer to an IPADDR variable to store the sender’s IP address of the packet
pLocal_portPointer to WORD variable to store the local port number of the packet
pRemote_portPointer to WORD variable to store the sender’s port number of the packet
Returns
The number of bytes received, or a negative number if an error occurred
See also
recvfrom6(), sendto6(), sendto4()

◆ recvfrom4()

int recvfrom4 ( int  sock,
puint8_t  buffer,
int  len,
IPADDR4 *  pAddr,
uint16_t *  pLocal_port,
uint16_t *  pRemote_port 
)

Receive a UDP packet.

Calling recvfrom() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockFile descriptor from a previous call to CreateRxUdpSocket() or CreateRxTxSocket()
bufferPointer to BYTE array buffer to store received UDP packet data
lenMaximum number of bytes to receive
pAddrPointer to an IPADDR variable to store the sender’s IP address of the packet
pLocal_portPointer to WORD variable to store the local port number of the packet
pRemote_portPointer to WORD variable to store the sender’s port number of the packet
Returns
The number of bytes received, or a negative number if an error occurred
See also
recvfrom6(), sendto6(), sendto4()

◆ recvfrom6()

int recvfrom6 ( int  sock,
puint8_t  buffer,
int  len,
IPADDR6 pAddr,
uint16_t *  pLocal_port,
uint16_t *  pRemote_port 
)

Receive a UDP packet.

Calling recvfrom() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockFile descriptor from a previous call to CreateRxUdpSocket() or CreateRxTxSocket()
bufferPointer to BYTE array buffer to store received UDP packet data
lenMaximum number of bytes to receive
pAddrPointer to an IPADDR variable to store the sender’s IP address of the packet
pLocal_portPointer to WORD variable to store the local port number of the packet
pRemote_portPointer to WORD variable to store the sender’s port number of the packet
Returns
The number of bytes received, or a negative number if an error occurred
See also
recvfrom6(), sendto6(), sendto4()

◆ Send4()

void UDPPacket::Send4 ( IPADDR4  destIP,
uint8_t  ttl = 0 
)

Send the UDP Packet and free the pool buffer.

Calling Send() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
destIPDestination IP address
ttlOptional. If not specified the system default will be used
See also
SendAndKeep4(), SendViaInterfaceNum4(), Send6()

◆ Send6()

void UDPPacket::Send6 ( const IPADDR6 to,
uint8_t  ttl = 0 
)

Send the UDP Packet and free the pool buffer.

Calling Send() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
destIPDestination IP address
ttlOptional. If not specified the system default will be used
See also
SendAndKeep6(), SendViaInterfaceNum6(), Send4()

◆ SendAndKeep4()

void UDPPacket::SendAndKeep4 ( IPADDR4  destIP,
uint8_t  ttl = 0 
)

Make a copy of a UDP Packet and send it. The original packet will remain intact.

Calling SendAndKeep() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
destIPDestination IP address
ttlOptional. If not specified the system default will be used
See also
Send4(), SendViaInterfaceNum4(), SendAndKeep6()

◆ SendAndKeep6()

void UDPPacket::SendAndKeep6 ( const IPADDR6 to,
uint8_t  ttl = 0 
)

Make a copy of a UDP Packet and send it. The original packet will remain intact.

Calling SendAndKeep() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
destIPDestination IP address
ttlOptional. If not specified the system default will be used
See also
SendAndKeep4(), Send6(), SendViaInterfaceNum6()

◆ sendto()

int sendto ( int  sock,
puint8_t  what_to_send,
int  len_to_send,
const IPADDR6 to_addr,
uint16_t  remote_port 
)
inline

Send a UDP packet.

Calling sendto() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockSocket to send packet to
what_to_sendPointer to data to be sent
len_to_sendNumber of data bytes to send
to_addrDestination IP address
remote_portDestination port number
Returns
The number of bytes sent, or a negative number if an error occurred
See also
sendto6()

◆ sendto4()

int sendto4 ( int  sock,
puint8_t  what_to_send,
int  len_to_send,
IPADDR4  to_addr,
uint16_t  remote_port 
)

Send a UDP packet.

Calling sendto() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockSocket to send packet to
what_to_sendPointer to data to be sent
len_to_sendNumber of data bytes to send
to_addrDestination IP address
remote_portDestination port number
Returns
The number of bytes sent, or a negative number if an error occurred
See also
sendto6()

◆ sendto6()

int sendto6 ( int  sock,
puint8_t  what_to_send,
int  len_to_send,
const IPADDR6 to_addr,
uint16_t  remote_port 
)

Send a UDP packet.

Calling sendto() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockSocket to send packet to
what_to_sendPointer to data to be sent
len_to_sendNumber of data bytes to send
to_addrDestination IP address
remote_portDestination port number
Returns
The number of bytes sent, or a negative number if an error occurred
See also
sendto4()

◆ sendtovia4()

int sendtovia4 ( int  sock,
puint8_t  what_to_send,
int  len_to_send,
IPADDR4  to_addr,
uint16_t  remote_port,
int  intfnum 
)

Send a UDP packet on the specified interface.

Calling sendtovia() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockSocket to send packet to
what_to_sendPointer to data to be sent
len_to_sendNumber of data bytes to send
to_addrDestination IP address
remote_portDestination port number
intfnumInterface number
Returns
The number of bytes sent, or a negative number if an error occurred
See also
sendtovia6()

◆ sendtovia6()

int sendtovia6 ( int  sock,
puint8_t  what_to_send,
int  len_to_send,
const IPADDR6 to_addr,
uint16_t  remote_port,
int  intfnum 
)

Send a UDP packet on the specified interface.

Calling sendtovia() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
sockSocket to send packet to
what_to_sendPointer to data to be sent
len_to_sendNumber of data bytes to send
to_addrDestination IP address
remote_portDestination port number
intfnumInterface number
Returns
The number of bytes sent, or a negative number if an error occurred
See also
sendtovia4()

◆ SendViaInterfaceNum4()

void UDPPacket::SendViaInterfaceNum4 ( IPADDR4  destIP,
int  interface,
uint8_t  ttl = 0 
)

Send the UDP Packet using the specified interface, and free the pool buffer.

Calling SendViaInterfaceNum() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
destIPDestination IP address
interfaceInterface number
ttlOptional. If not specified the system default will be used
See also
Send4(), SendAndKeep4(), SendViaInterfaceNum6()

◆ SendViaInterfaceNum6()

void UDPPacket::SendViaInterfaceNum6 ( const IPADDR6 to,
int  interface,
uint8_t  ttl = 0 
)

Send the UDP Packet using the specified interface, and free the pool buffer.

Calling SendViaInterfaceNum() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters
destIPDestination IP address
interfaceInterface number
ttlOptional. If not specified the system default will be used
See also
Send6(), SendAndKeep6(), SendViaInterfaceNum4()

◆ SetDataSize()

void UDPPacket::SetDataSize ( uint16_t  numBytes)

Set the UDP Packet data size.

Parameters
numBytesData size as number of bytes
See also
GetDataSize()

◆ SetDestinationPort()

void UDPPacket::SetDestinationPort ( uint16_t  nv)

Set the destination port number of a UDP Packet object.

Parameters
portDestination port number
See also
GetDestinationPort()

◆ SetSourcePort()

void UDPPacket::SetSourcePort ( uint16_t  port)

Set the source port number of a UDP Packet object.

Parameters
portSource port number
See also
UDPPacket( OS_FIFO *pFifo, uint32_t timeout ), UDPPacket(int sock)

◆ UDPPacket() [1/4]

UDPPacket::UDPPacket ( OS_FIFO pFifo,
uint32_t  timeout 
)

Constructor to create a UDP Packet object from a UDP FIFO entry.

UDP packets are received in a OS_FIFO. This constructor create a UDP packet from the next entry in the FIFO, which also removes the entry from the FIFO. If there is not a packet in the FIFO, this constructor will block until one is available, or the specified timeout occurs. If a timeout occurs, an invalid UDP packet will be created. The UDP Validate() function must always be called after this constructor to verify a valid UDP packet has been created.

Parameters
pFifoPointer to an OS_FIFO object
timeoutTimeout in system Time Ticks
See also
UDPPacket(int sock), UDPPacket( PoolPtr p )

◆ UDPPacket() [2/4]

UDPPacket::UDPPacket ( int  sock)

Constructor to create a UDP Packet object from an open UDP socket.

This constructor will block until a UDP packet is received. It is useful for situations such as a select() call that will block on a UDP file descriptor until a packet is received. After the select() returns, this constructor can be used to create the packet.

Parameters
sockOpen UDP socket
See also
UDPPacket( OS_FIFO *pFifo, uint32_t timeout ), UDPPacket( PoolPtr p )

◆ UDPPacket() [3/4]

UDPPacket::UDPPacket ( PoolPtr  p)

Constructor to create a UDP packet from a system pool buffer.

This constructor can be used in unique situations in which an application is operating directly on the system pool buffers. This is a rare situation.

Parameters
pPointer to a pool buffer
See also
UDPPacket( OS_FIFO *pFifo, uint32_t timeout ), UDPPacket(int sock)

◆ UDPPacket() [4/4]

UDPPacket::UDPPacket ( UDPPacket pkt)

Constructor to create a new UDP packet from an existing UDP packet.

The UDP packet passed in the argument will be destroyed.

Parameters
pktUDP packet object
See also
UDPPacket( OS_FIFO *pFifo, uint32_t timeout ), UDPPacket(int sock)

◆ Validate()

BOOL UDPPacket::Validate ( void  )

Verify a received UDP packet.

Verifies a received UDP packet has data and validates the checksum. This function should be called when receiving a UDP packet.

Returns
true if packet is valid, otherwise false

◆ ~UDPPacket()

UDPPacket::~UDPPacket ( )

UDP packet object destructor. Frees any associated memory.

This function is the UDPPacket destructor, which will be called automatically when an instance of UDPPacket goes out of scope. Frees the pool buffer if it is defined.

See also
UDPPacket( OS_FIFO *pFifo, uint32_t timeout ), UDPPacket(int sock), UDPPacket( PoolPtr p )
Returns
Nothing.