ubus: add support for adding auth_connect hosts at runtime
[project/unetd.git] / utils.c
diff --git a/utils.c b/utils.c
index 95ab08bb570b3d9360d96876eeb1a640242f4c48..abaa73d2367edecaab68f36003e6407efadfdcb5 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -8,6 +8,9 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <stdio.h>
+
+#include <libubox/utils.h>
+
 #include "unetd.h"
 
 int network_get_endpoint(union network_endpoint *dest, const char *str,
@@ -179,3 +182,12 @@ error:
        *len = 0;
        return NULL;
 }
+
+uint64_t unet_gettime(void)
+{
+       struct timespec ts;
+
+       clock_gettime(CLOCK_MONOTONIC, &ts);
+
+       return ts.tv_sec;
+}