NetBurner 3.3.4
PDF Version
udp.h File Reference

NetBurner User Datagram Protocol Header File. More...

#include <predef.h>
#include <ip.h>

Go to the source code of this file.

Classes

class  UDPPacket
 UDP Packet Class. More...
 

Macros

#define UDP_ERR_NOSUCH_SOCKET   (-1)
 Socket does not exist.
 
#define UDP_ERR_NOTOPEN_TO_WRITE   (-2)
 Socket not open for write.
 
#define UDP_ERR_NOTOPEN_TO_READ   (-3)
 Socket not open for read.
 

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...
 
int CreateRxUdpSocket (uint16_t listening_port)
 Open a UDP socket for receiving incoming UDP packets. More...
 
int CreateTxUdpSocket (const IPADDR &send_to_addr, uint16_t remote_port, uint16_t local_port)
 Open a UDP socket for transmitting UDP packets. More...
 
int CreateRxTxUdpSocket (const IPADDR &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 sendto (int sock, puint8_t what_to_send, int len_to_send, const IPADDR &to_addr, uint16_t remote_port)
 Send a UDP packet. More...
 
int sendtovia (int sock, puint8_t what_to_send, int len_to_send, const IPADDR &to_addr, uint16_t remote_port, int intfnum)
 Send a UDP packet on the specified interface. More...
 
int recvfrom (int sock, puint8_t buffer, int len, IPADDR *pAddr, uint16_t *pLocal_port, uint16_t *pRemote_port)
 Receive a UDP packet. More...
 
int SendFragmentedUdpPacket (const IPADDR &to, uint16_t source_port, uint16_t dest_port, puint8_t data, int length)
 Send a large fragmented UDP packet. More...
 
int CreateRxUdpSocketVia (uint16_t listening_port, int interfacenum)
 Open a UDP socket for receiving incoming UDP packets on the specified network interface, by interface number. More...
 
int CreateRxUdpSocketVia (uint16_t listening_port, const IPADDR interfaceIp)
 Open a UDP socket for receiving incoming UDP packets on the network interface with the specified IP address. If more than one interface has the same IP address, the lower interface number is used. More...
 
int CreateRxTxUdpSocketVia (const IPADDR send_to_addr, uint16_t send_to_remote_port, uint16_t local_port, int interfacenum)
 Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an interface number. More...
 
int CreateRxTxUdpSocketVia (const IPADDR send_to_addr, uint16_t send_to_remote_port, uint16_t local_port, IPADDR interfaceIp)
 Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an IP address. More...
 
int CreateTxUdpSocketVia (const IPADDR send_to_addr, uint16_t remote_port, uint16_t local_port, int interfacenum)
 Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface number. More...
 
int CreateTxUdpSocketVia (const IPADDR send_to_addr, uint16_t remote_port, uint16_t local_port, IPADDR interfaceIp)
 Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface IP address. More...
 

Detailed Description

NetBurner User Datagram Protocol Header File.