From 23b7ce90d4f105ae8cfbf3bd5d3615937e34d160 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Fri, 1 Apr 2016 17:04:58 +0200 Subject: [PATCH] Add support for OpenBSD --- pcap/pcap.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcap/pcap.go b/pcap/pcap.go index 3b015c1..f5612e6 100644 --- a/pcap/pcap.go +++ b/pcap/pcap.go @@ -10,6 +10,7 @@ package pcap /* #cgo linux LDFLAGS: -lpcap #cgo freebsd LDFLAGS: -lpcap +#cgo openbsd LDFLAGS: -lpcap #cgo darwin LDFLAGS: -lpcap #cgo solaris LDFLAGS: -lpcap #cgo windows CFLAGS: -I C:/WpdPack/Include @@ -83,6 +84,10 @@ int pcap_set_rfmon(pcap_t *p, int rfmon) { #elif __GLIBC__ #define gopacket_time_secs_t __time_t #define gopacket_time_usecs_t __suseconds_t +#elif __OpenBSD__ +// time_t is 64-bit, however bpf_timeval uses 32 bit fields +#define gopacket_time_secs_t u_int32_t +#define gopacket_time_usecs_t u_int32_t #else #define gopacket_time_secs_t time_t #define gopacket_time_usecs_t suseconds_t