aboutsummaryrefslogtreecommitdiffstats
path: root/glougloud/glougloud.c
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-07-22 00:04:12 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2012-07-22 00:04:12 +0200
commit021d31b61e0803758610e2bd83302d5955547ee0 (patch)
tree26318204fca91505e5354efdee614ede0537db71 /glougloud/glougloud.c
parentlibglouglou in README (diff)
downloadglouglou-021d31b61e0803758610e2bd83302d5955547ee0.tar.xz
glouglou-021d31b61e0803758610e2bd83302d5955547ee0.zip
make it at least compile on linux.
tested on archlinux
Diffstat (limited to 'glougloud/glougloud.c')
-rw-r--r--glougloud/glougloud.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/glougloud/glougloud.c b/glougloud/glougloud.c
index 7b86aa4..6c1960d 100644
--- a/glougloud/glougloud.c
+++ b/glougloud/glougloud.c
@@ -8,7 +8,6 @@
#include <netdb.h>
#include <pcap.h>
-#include <pcap-int.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -19,7 +18,10 @@
#include <string.h>
#include "glougloud.h"
-#include "imsgev.h"
+#include "external/imsgev.h"
+#if defined(__OpenBSD__)
+#include "pcap-int.h"
+#endif
struct server_proc {
pid_t pid;
@@ -42,7 +44,7 @@ struct user {
};
// XXX CONF
-#define PCAP_INTERFACE "lo0"
+#define PCAP_INTERFACE "lo"
#define PCAP_SNAPLEN 100
#define PCAP_FILTER "not port 4430"
@@ -54,7 +56,11 @@ struct user_proc *usr_proc;
LIST_HEAD(, user) usr_list;
int net_socket;
+#if defined(__OPENBSD__)
void __dead
+#else
+void
+#endif
usage(void)
{
extern char *__progname;
@@ -83,6 +89,7 @@ static pcap_t *
my_pcap_open_live(const char *dev, int slen, int promisc, int to_ms,
char *ebuf, u_int dlt, u_int dirfilt)
{
+#if defined(__OpenBSD__)
struct bpf_version bv;
u_int v;
pcap_t *p;
@@ -191,6 +198,9 @@ my_pcap_open_live(const char *dev, int slen, int promisc, int to_ms,
return NULL;
}
return p;
+#else /* defined(__OpenBSD__) */
+ return pcap_open_live(dev, slen, promisc, to_ms, ebuf);
+#endif
}
int