summaryrefslogtreecommitdiff
path: root/lib/tests/udp.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tests/udp.h')
-rw-r--r--lib/tests/udp.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/tests/udp.h b/lib/tests/udp.h
new file mode 100644
index 0000000..402295f
--- /dev/null
+++ b/lib/tests/udp.h
@@ -0,0 +1,14 @@
+#include <stdint.h>
+#include <unistd.h>
+#include <sys/time.h>
+//#include <sys/types.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 *server (const char *bindto, struct timeval *timeout, data_cb cb);
+ssize_t poll (struct polldata *data);