summaryrefslogtreecommitdiff
path: root/src/libunixonacid/skaclient_server_init.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
commit3534b428629be185e096be99e3bd5fdfe32d5544 (patch)
tree210ef3198ed66bc7f7b7bf6a85e4579f455e5a36 /src/libunixonacid/skaclient_server_init.c
downloadskalibs-3534b428629be185e096be99e3bd5fdfe32d5544.tar.xz
initial commit with rc for skalibs-2.0.0.0
Diffstat (limited to 'src/libunixonacid/skaclient_server_init.c')
-rw-r--r--src/libunixonacid/skaclient_server_init.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libunixonacid/skaclient_server_init.c b/src/libunixonacid/skaclient_server_init.c
new file mode 100644
index 0000000..bd7c143
--- /dev/null
+++ b/src/libunixonacid/skaclient_server_init.c
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#include <skalibs/skaclient.h>
+#include <skalibs/tai.h>
+#include <skalibs/unixmessage.h>
+
+int skaclient_server_init (unixmessage_receiver_t *in, char *mainbuf, unsigned int mainlen, char *auxbuf, unsigned int auxlen, unixmessage_sender_t *out, unixmessage_sender_t *asyncout, char const *before, unsigned int beforelen, char const *after, unsigned int afterlen, tain_t const *deadline, tain_t *stamp)
+{
+ unixmessage_t m ;
+ if (!unixmessage_receiver_init(in, 0, mainbuf, mainlen, auxbuf, auxlen)) return 0 ;
+ unixmessage_sender_init(out, 1) ;
+ if (unixmessage_timed_receive(in, &m, deadline, stamp) < 0) return 0 ;
+ if (!skaclient_server_ack(&m, out, asyncout, before, beforelen, after, afterlen)) return 0 ;
+ return unixmessage_sender_timed_flush(out, deadline, stamp) ;
+}