summaryrefslogtreecommitdiff
path: root/lib/tests/udp.h
blob: 02e1b5047fcda44d0b49e2246b2ae7a37c0ea99d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdint.h>
#include <unistd.h>
#include <sys/time.h>

typedef ssize_t (*data_cb) (const uint8_t *buf, ssize_t len);
struct polldata {
  int s;
  data_cb cb;
  struct timeval *timeout;
};

struct polldata *udp_server (const char *bindto, struct timeval *timeout, data_cb cb);
ssize_t udp_poll (struct polldata *data);