diff -bruN suricata-1.1beta1/src/suricata-common.h suricata-1.1beta1-openbsd48/src/suricata-common.h
--- suricata-1.1beta1/src/suricata-common.h	Tue Dec 21 16:19:50 2010
+++ suricata-1.1beta1-openbsd48/src/suricata-common.h	Sun Feb  6 02:25:50 2011
@@ -97,12 +97,12 @@
 
 #include <sys/stat.h>
 
-#if HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
 #endif
 
 #if HAVE_NETDB_H
diff -bruN suricata-1.1beta1/src/threads.h suricata-1.1beta1-openbsd48/src/threads.h
--- suricata-1.1beta1/src/threads.h	Tue Dec 21 16:19:50 2010
+++ suricata-1.1beta1-openbsd48/src/threads.h	Sun Feb  6 03:20:07 2011
@@ -27,9 +27,11 @@
 #ifndef __THREADS_H__
 #define __THREADS_H__
 
-#ifdef OS_FREEBSD
+#if defined OS_FREEBSD || defined __OpenBSD__
 
+#if ! defined __OpenBSD__
 #include <sys/thr.h>
+#endif
 #define PRIO_LOW 2
 #define PRIO_MEDIUM 0
 #define PRIO_HIGH -2
@@ -84,7 +86,7 @@
 #define SCRWLockDestroy pthread_rwlock_destroy
 
 /** Get the Current Thread Id */
-#ifdef OS_FREEBSD
+#if defined OS_FREEBSD
 #define SCGetThreadIdLong(...) ({ \
     long tmpthid; \
     thr_self(&tmpthid); \
@@ -103,6 +105,13 @@
     u_long tid = (u_long)tpid; \
     tid; \
 })
+#elif __OpenBSD__
+#define SCGetThreadIdLong(...) ({ \
+    pid_t tpid; \
+    tpid = getpid(); \
+    u_long tid = (u_long)tpid; \
+    tid; \
+})
 #else
 #define SCGetThreadIdLong(...) ({ \
    pid_t tmpthid; \
@@ -353,7 +362,7 @@
  */
 #ifndef PR_SET_NAME /*PR_SET_NAME */
 #define SCSetThreadName(n)
-#elif OS_FREEBSD /* FreeBSD */
+#elif defined OS_FREEBSD || defined __OpenBSD__ /* FreeBSD */
 /** \todo Add implementation for FreeBSD */
 #define SCSetThreadName(n)
 #elif OS_WIN32 /* Windows */
diff -bruN suricata-1.1beta1/src/tm-threads.c suricata-1.1beta1-openbsd48/src/tm-threads.c
--- suricata-1.1beta1/src/tm-threads.c	Tue Dec 21 16:19:50 2010
+++ suricata-1.1beta1-openbsd48/src/tm-threads.c	Sun Feb  6 02:51:29 2011
@@ -39,14 +39,14 @@
 #include <unistd.h>
 #include "util-privs.h"
 
-#ifdef OS_FREEBSD
+#if defined OS_FREEBSD
 #include <sched.h>
 #include <sys/param.h>
 #include <sys/resource.h>
 #include <sys/cpuset.h>
 #include <sys/thr.h>
 #define cpu_set_t cpuset_t
-#elif OS_DARWIN
+#elif defined OS_DARWIN
 #include <mach/mach.h>
 #include <mach/mach_init.h>
 #include <mach/thread_policy.h>
@@ -669,6 +669,9 @@
 
     int cpu = (int)cpuid;
 
+#ifdef __OpenBSD__
+	return 0;
+#else
 #ifdef OS_WIN32
 	DWORD cs = 1 << cpu;
 #else
@@ -678,7 +681,7 @@
     CPU_SET(cpu,&cs);
 #endif /* OS_WIN32 */
 
-#ifdef OS_FREEBSD
+#if defined OS_FREEBSD || defined __OpenBSD__
     int r = cpuset_setaffinity(CPU_LEVEL_WHICH,CPU_WHICH_TID,SCGetThreadIdLong(),sizeof(cpu_set_t),&cs);
 #elif OS_DARWIN
     int r = thread_policy_set(mach_thread_self(), THREAD_AFFINITY_POLICY, (void*)&cs, THREAD_AFFINITY_POLICY_COUNT);
@@ -696,6 +699,7 @@
     SCLogDebug("CPU Affinity for thread %lu set to CPU %" PRId32, SCGetThreadIdLong(), cpu);
 
     return 0;
+#endif /* __OpenBSD__ */
 }
 
 
diff -bruN suricata-1.1beta1/src/util-byte.h suricata-1.1beta1-openbsd48/src/util-byte.h
--- suricata-1.1beta1/src/util-byte.h	Tue Dec 21 16:19:50 2010
+++ suricata-1.1beta1-openbsd48/src/util-byte.h	Sun Feb  6 03:08:12 2011
@@ -30,7 +30,12 @@
 #define BYTE_LITTLE_ENDIAN   1
 
 /** Wrappers for OS dependent byte swapping functions */
-#ifdef OS_FREEBSD
+#if defined __OpenBSD__
+#include <sys/types.h>
+#define SCByteSwap16(x) swap16(x)
+#define SCByteSwap32(x) swap32(x)
+#define SCByteSwap64(x) swap64(x)
+#elif defined OS_FREEBSD
 #include <sys/endian.h>
 #define SCByteSwap16(x) bswap16(x)
 #define SCByteSwap32(x) bswap32(x)
diff -bruN suricata-1.1beta1/src/util-fmemopen.c suricata-1.1beta1-openbsd48/src/util-fmemopen.c
--- suricata-1.1beta1/src/util-fmemopen.c	Tue Dec 21 16:19:50 2010
+++ suricata-1.1beta1-openbsd48/src/util-fmemopen.c	Sun Feb  6 00:07:03 2011
@@ -29,7 +29,7 @@
 #define USE_FMEM_WRAPPER 1
 #endif
 
-#ifdef OS_FREEBSD
+#if defined OS_FREEBSD || defined __OpenBSD__
 #define USE_FMEM_WRAPPER 1
 #endif
 
diff -bruN suricata-1.1beta1/src/util-fmemopen.h suricata-1.1beta1-openbsd48/src/util-fmemopen.h
--- suricata-1.1beta1/src/util-fmemopen.h	Tue Dec 21 16:19:50 2010
+++ suricata-1.1beta1-openbsd48/src/util-fmemopen.h	Sun Feb  6 00:07:20 2011
@@ -33,7 +33,7 @@
 #define USE_FMEM_WRAPPER 1
 #endif
 
-#ifdef OS_FREEBSD
+#if defined OS_FREEBSD || defined __OpenBSD__
 #define USE_FMEM_WRAPPER 1
 #endif
 
diff -bruN suricata-1.1beta1/src/util-radix-tree.c suricata-1.1beta1-openbsd48/src/util-radix-tree.c
--- suricata-1.1beta1/src/util-radix-tree.c	Tue Dec 21 16:19:50 2010
+++ suricata-1.1beta1-openbsd48/src/util-radix-tree.c	Sun Feb  6 00:08:08 2011
@@ -30,7 +30,7 @@
 #include "suricata-common.h"
 
 #include "suricata-common.h"
-#ifdef OS_FREEBSD
+#if defined OS_FREEBSD || defined __OpenBSD__
 #include <netinet/in.h>
 #endif /* OS_FREEBSD */
 #ifdef OS_DARWIN
