Nut/OS  4.10.3
API Reference
udpsock.c File Reference
#include <sys/heap.h>
#include <sys/event.h>
#include <sys/types.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <memdebug.h>
Include dependency graph for udpsock.c:

Go to the source code of this file.


UDPSOCKETNutUdpCreateSocket (uint16_t port)
 Create a UDP socket.
int NutUdpSendTo (UDPSOCKET *sock, uint32_t addr, uint16_t port, void *data, int len)
 Send a UDP datagram.
int NutUdpReceiveFrom (UDPSOCKET *sock, uint32_t *addr, uint16_t *port, void *data, int size, uint32_t timeout)
 Receive a UDP datagram.
int NutUdpDestroySocket (UDPSOCKET *sock)
 Close UDP socket.
int NutUdpError (UDPSOCKET *sock, uint32_t *addr, uint16_t *port)
 Return specific code of the last error and the IP address / port of the host to which the communication failed.
UDPSOCKETNutUdpFindSocket (uint16_t port)
 Find a matching socket.
int NutUdpSetSockOpt (UDPSOCKET *sock, int optname, CONST void *optval, int optlen)
 Set value of a UDP socket option.
int NutUdpGetSockOpt (UDPSOCKET *sock, int optname, void *optval, int optlen)
 Get a UDP socket option value.
int NutUdpSetSocketError (UDPSOCKET *sock, uint32_t remote_addr, uint16_t remote_port, uint16_t error)
 Set a UDP socket error.