Skip to content

Commit

Permalink
Add support for OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperla committed Apr 5, 2016
1 parent f07b94e commit 23b7ce9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pcap/pcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 23b7ce9

Please sign in to comment.