28#include <sys/socket.h>
37#define TRACE(type,fmt,args...)
55#ifndef LINUX_LINK_STATIC
68 if (
hp->h_addrtype ==
AF_INET &&
hp->h_length == 4) {
105#ifndef LINUX_LINK_STATIC
int udp_socket_recv(struct UdpSocket *sock, uint8_t *buffer, uint32_t len)
Receive one UDP packet, blocking.
#define TRACE(type, fmt, args...)
int udp_socket_subscribe_multicast(struct UdpSocket *sock, const char *multicast_addr)
int udp_socket_send_dontwait(struct UdpSocket *sock, uint8_t *buffer, uint32_t len)
Send a packet from buffer, non-blocking.
int udp_socket_set_recvbuf(struct UdpSocket *sock, int buf_size)
int udp_socket_create(struct UdpSocket *sock, char *host, int port_out, int port_in, bool broadcast)
Create UDP socket and bind it.
int udp_socket_set_sendbuf(struct UdpSocket *sock, int buf_size)
int udp_socket_send(struct UdpSocket *sock, uint8_t *buffer, uint32_t len)
Send a packet from buffer, blocking.
int udp_socket_recv_dontwait(struct UdpSocket *sock, uint8_t *buffer, uint32_t len)
Receive a UDP packet, dont wait.
Easily create and use UDP sockets.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.