40 #define UDP_SUPPORT ENABLED
41#elif (UDP_SUPPORT != ENABLED && UDP_SUPPORT != DISABLED)
42 #error UDP_SUPPORT parameter is not valid
47#ifndef UDP_CALLBACK_TABLE_SIZE
48 #define UDP_CALLBACK_TABLE_SIZE 10
49#elif (UDP_CALLBACK_TABLE_SIZE < 1)
50 #error UDP_CALLBACK_TABLE_SIZE parameter is not valid
54#ifndef UDP_RX_QUEUE_SIZE
55 #define UDP_RX_QUEUE_SIZE 4
56#elif (UDP_RX_QUEUE_SIZE < 1)
57 #error UDP_RX_QUEUE_SIZE parameter is not valid
67#if defined(__CWCC__) || defined(_WIN32)
87#if defined(__CWCC__) || defined(_WIN32)
98 const NetBuffer *buffer,
size_t offset,
const NetRxAncillary *ancillary,
108 NetInterface *interface;
120uint16_t udpGetDynamicPort(
void);
122error_t udpProcessDatagram(NetInterface *interface,
124 const NetRxAncillary *ancillary);
126error_t udpSendDatagram(Socket *socket,
const SocketMsg *message, uint_t flags);
128error_t udpSendBuffer(NetInterface *interface,
const IpAddr *srcIpAddr,
129 uint16_t srcPort,
const IpAddr *destIpAddr, uint16_t destPort,
130 NetBuffer *buffer,
size_t offset, NetTxAncillary *ancillary);
132error_t udpReceiveDatagram(Socket *socket,
SocketMsg *message, uint_t flags);
134NetBuffer *udpAllocBuffer(
size_t length,
size_t *offset);
136void udpUpdateEvents(Socket *socket);
138error_t udpAttachRxCallback(NetInterface *interface, uint16_t port,
141error_t udpDetachRxCallback(NetInterface *interface, uint16_t port);
143error_t udpInvokeRxCallback(NetInterface *interface,
145 const NetBuffer *buffer,
size_t offset,
const NetRxAncillary *ancillary);
147void udpDumpHeader(
const UdpHeader *datagram);
error_t
Error codes.
Definition error.h:43
IP network address.
Definition ip.h:72
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
Message and ancillary data.
Definition socket.h:228
UDP receive callback entry.
Definition udp.h:107
TCP (Transmission Control Protocol)
void(* UdpRxCallback)(NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *header, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary, void *param)
UDP receive callback.
Definition udp.h:96
typedef __packed_struct
UDP header.
Definition udp.h:77