summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-15 08:48:53 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-15 08:48:53 -0700
commitd0e0f5dd126d37a27a43cc00ed351ed1289c203c (patch)
treec2bc2804f7ff436060026a2e9f5aa7c2465caee6
parente94518590de48e2718539f98b87e2f617fa02f75 (diff)
downloadinfinitytier-d0e0f5dd126d37a27a43cc00ed351ed1289c203c.tar.gz
infinitytier-d0e0f5dd126d37a27a43cc00ed351ed1289c203c.zip
Basic OpenBSD compile fixes -- still need to update BSDEthernetTap, will do that later. Should be able to re-use FreeBSD port for OpenBSD, but we will see.
-rw-r--r--Makefile4
-rw-r--r--include/ZeroTierOne.h2
-rw-r--r--node/Constants.hpp2
-rw-r--r--node/Utils.hpp4
-rw-r--r--service/OneService.cpp4
5 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index bc094260..5a5f6605 100644
--- a/Makefile
+++ b/Makefile
@@ -13,4 +13,6 @@ endif
ifeq ($(OSTYPE),FreeBSD)
include make-freebsd.mk
endif
-
+ifeq ($(OSTYPE),OpenBSD)
+ include make-freebsd.mk
+endif
diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h
index ecc2edef..dd7ccfa1 100644
--- a/include/ZeroTierOne.h
+++ b/include/ZeroTierOne.h
@@ -43,6 +43,8 @@
#else /* not Windows */
#include <arpa/inet.h>
#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
#endif /* Windows or not */
#ifdef __cplusplus
diff --git a/node/Constants.hpp b/node/Constants.hpp
index 10c48c20..3bda685d 100644
--- a/node/Constants.hpp
+++ b/node/Constants.hpp
@@ -60,7 +60,7 @@
#include <endian.h>
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef __UNIX_LIKE__
#define __UNIX_LIKE__
#endif
diff --git a/node/Utils.hpp b/node/Utils.hpp
index 585c7f5b..bdd673a9 100644
--- a/node/Utils.hpp
+++ b/node/Utils.hpp
@@ -331,7 +331,7 @@ public:
throw()
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
-#ifdef __GNUC__
+#if defined(__GNUC__) && (!defined(__OpenBSD__))
return __builtin_bswap64(n);
#else
return (
@@ -361,7 +361,7 @@ public:
throw()
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__OpenBSD__)
return __builtin_bswap64(n);
#else
return (
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 56b1d979..dd919474 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -70,6 +70,10 @@ namespace ZeroTier { typedef LinuxEthernetTap EthernetTap; }
#include "../osdep/WindowsEthernetTap.hpp"
namespace ZeroTier { typedef WindowsEthernetTap EthernetTap; }
#endif
+#ifdef __BSD__
+#include "../osdep/BSDEthernetTap.hpp"
+namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
+#endif
// Sanity limits for HTTP
#define ZT_MAX_HTTP_MESSAGE_SIZE (1024 * 1024 * 8)