Move lib to the root.
[libradsec.git] / tests / udp.h
1 /* Copyright 2011, NORDUnet A/S. All rights reserved. */
2 /* See LICENSE for licensing information. */
3
4 #include <stdint.h>
5 #include <unistd.h>
6 #include <sys/time.h>
7
8 typedef ssize_t (*data_cb) (const uint8_t *buf, ssize_t len);
9
10 struct polldata {
11   int s;
12   data_cb cb;
13   struct timeval *timeout;
14 };
15
16 struct polldata *udp_server (const char *bindto, struct timeval *timeout, data_cb cb);
17 ssize_t udp_poll (struct polldata *data);
18 void udp_free_polldata (struct polldata *data);
19
20 ssize_t hd (const uint8_t *buf, ssize_t len);