NetBurner 3.3.4
PDF Version
UDP Packet Object

The NetBurner UDP protocol API is implemented in two ways: More...

Modules

 UDP Error Codes
 

Classes

class  UDPPacket
 UDP Packet Class. More...
 

Functions

void RegisterUDPFifo (uint16_t listenPort, OS_FIFO *pFifo)
 Register a FIFO to receive incoming UDP packets. More...
 
void RegisterUDPFifoVia (uint16_t listenPort, OS_FIFO *pFifo, int interface)
 Register a FIFO to receive incoming UDP packets on the specified network interface. More...
 
uint16_t RegisterEphemeralFifo (OS_FIFO *pfifo, int ifn=-1)
 Register a UDP FIFO with a random port number to receive incoming UDP packets. More...
 
void RegisterUDPFifoWithNotify (uint16_t listenPort, OS_FIFO *pFifo, udp_data_notify *pNotifyFunction)
 Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is received. More...
 
void RegisterUDPFifoWithNotifyVia (uint16_t listenPort, OS_FIFO *pFifo, udp_data_notify *pNotifyFunction, int interface)
 Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is received. Same as RegisterUDPFifoWithNotify() with the additional parameter to specify the local network interface. More...
 
void UnregisterUDPFifo (uint16_t listenPort, bool drain=false)
 Unregister a UDP FIFO. More...
 

Detailed Description

The NetBurner UDP protocol API is implemented in two ways:

  1. As a C++ class, which makes memory management easier UDPPacket.
  2. Wrapper functions that implement a standard UDP sockets interface. For example, sendto() and recvfrom().

Function Documentation

◆ RegisterEphemeralFifo()

uint16_t RegisterEphemeralFifo ( OS_FIFO pfifo,
int  ifn = -1 
)

Register a UDP FIFO with a random port number to receive incoming UDP packets.

A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen on a random unused UDP port number, which can be useful when sending a UDP packet to a remote host that will respond to the received packet source port number.

Parameters
pfifoPointer to the OS_FIFO to register
ifnOptional local interface number to listen on
Returns
The registered port number of success, 0 on failure.
See also
RegisterUDPFifoWithNotify(), UnregisterUDPFifo()

◆ RegisterUDPFifo()

void RegisterUDPFifo ( uint16_t  listenPort,
OS_FIFO pFifo 
)

Register a FIFO to receive incoming UDP packets.

A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific UDP port number.

Parameters
listenPortPort to listen on for incoming packets
pFifoPointer to the OS_FIFO to register
See also
RegisterUDPFifoWithNotify(), UnregisterUDPFifo(), RegisterEphemeralFifo()

◆ RegisterUDPFifoVia()

void RegisterUDPFifoVia ( uint16_t  listenPort,
OS_FIFO pFifo,
int  interface 
)

Register a FIFO to receive incoming UDP packets on the specified network interface.

A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific UDP port number and local network interface.

Parameters
listenPortPort to listen on for incoming packets
pFifoPointer to the OS_FIFO to register
interfaceLocal network interface number
See also
RegisterUDPFifo(), RegisterUDPFifoWithNotify(), UnregisterUDPFifo(), RegisterEphemeralFifo()

◆ RegisterUDPFifoWithNotify()

void RegisterUDPFifoWithNotify ( uint16_t  listenPort,
OS_FIFO pFifo,
udp_data_notify *  pNotifyFunction 
)

Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is received.

A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific UDP port number and a notification callback function.

Parameters
listenPortPort to listen on for incoming packets
pFifoPointer to the OS_FIFO to register
pNotifyFunctionPointer to callback function to receive notification
See also
RegisterUDPFifo(), UnregisterUDPFifo()

◆ RegisterUDPFifoWithNotifyVia()

void RegisterUDPFifoWithNotifyVia ( uint16_t  listenPort,
OS_FIFO pFifo,
udp_data_notify *  pNotifyFunction,
int  interface 
)

Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is received. Same as RegisterUDPFifoWithNotify() with the additional parameter to specify the local network interface.

A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific UDP port number and a notification callback function.

Parameters
listenPortPort to listen on for incoming packets
pFifoPointer to the OS_FIFO to register
pNotifyFunctionPointer to callback function to receive notification
interfaceLocal network interface number
See also
RegisterUDPFifo(), UnregisterUDPFifo()

◆ UnregisterUDPFifo()

void UnregisterUDPFifo ( uint16_t  listenPort,
bool  drain = false 
)

Unregister a UDP FIFO.

Parameters
listenPortPort to listen on for incoming packets.
drainOptional, default if false. If set to true, will free all queued pool pointers.
See also
RegisterUDPFifo(), RegisterUDPFifoWithNotify()