004b7ca9403d950962aa6822d1d1338986f57d84
[radsecproxy.git] / lib / tests / udp.h
1 #include <stdint.h>
2 #include <unistd.h>
3 #include <sys/time.h>
4
5 typedef ssize_t (*data_cb) (const uint8_t *buf, ssize_t len);
6
7 struct polldata {
8   int s;
9   data_cb cb;
10   struct timeval *timeout;
11 };
12
13 struct polldata *udp_server (const char *bindto, struct timeval *timeout, data_cb cb);
14 ssize_t udp_poll (struct polldata *data);
15 void udp_free_polldata (struct polldata *data);
16
17 ssize_t hd (const uint8_t *buf, ssize_t len);