summaryrefslogtreecommitdiff
path: root/tests/udp.h
diff options
context:
space:
mode:
authorSam Hartman <hartmans@debian.org>2014-08-24 13:23:12 -0400
committerSam Hartman <hartmans@debian.org>2014-08-24 13:23:12 -0400
commit25541859118c92a6497b52bba46c6bc4e582fcb2 (patch)
tree6eb7faaa084ef9251b7c9805fc391b46e1aa8bf1 /tests/udp.h
Import libradsec_0.0.5.orig.tar.gz
[dgit import orig libradsec_0.0.5.orig.tar.gz]
Diffstat (limited to 'tests/udp.h')
-rw-r--r--tests/udp.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/udp.h b/tests/udp.h
new file mode 100644
index 0000000..a8d5f23
--- /dev/null
+++ b/tests/udp.h
@@ -0,0 +1,20 @@
+/* Copyright 2011, NORDUnet A/S. All rights reserved. */
+/* See LICENSE for licensing information. */
+
+#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);
+void udp_free_polldata (struct polldata *data);
+
+ssize_t hd (const uint8_t *buf, ssize_t len);