aboutsummaryrefslogtreecommitdiffstats
path: root/src/support.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-03-17 09:46:08 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-03-17 10:13:22 -0600
commit8e0470dabb7f373ef41ab5aeb77068f84729f5da (patch)
tree7ea051b8eea1569bd0ebcea6334a9c6aa486fca4 /src/support.h
parentInitial import (diff)
downloadwireguard-freebsd-8e0470dabb7f373ef41ab5aeb77068f84729f5da.tar.xz
wireguard-freebsd-8e0470dabb7f373ef41ab5aeb77068f84729f5da.zip
support: prepare for out of tree builds
This involves weird backporting things. Hopefully support.c here is not as bad as compat.h on Linux. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/support.h')
-rw-r--r--src/support.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/support.h b/src/support.h
index f613f40..c4038cf 100644
--- a/src/support.h
+++ b/src/support.h
@@ -10,6 +10,7 @@
#include <sys/types.h>
#include <sys/limits.h>
#include <sys/endian.h>
+#include <sys/socket.h>
#include <sys/libkern.h>
#include <sys/malloc.h>
#include <sys/proc.h>
@@ -51,6 +52,20 @@ siphash24(const SIPHASH_KEY *key, const void *src, size_t len)
return (SipHashX(&ctx, 2, 4, (const uint8_t *)key, src, len));
}
+
+#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+
+#ifndef PRIV_NET_WG
+#define PRIV_NET_WG PRIV_NET_HWIOCTL
+#endif
+
+#ifndef IFT_WIREGUARD
+#define IFT_WIREGUARD IFT_PPP
+#endif
+
+int
+sogetsockaddr(struct socket *so, struct sockaddr **nam);
#endif