summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--netsniff-ng.c3
-rw-r--r--tstamping.c11
-rw-r--r--tstamping.h6
3 files changed, 9 insertions, 11 deletions
diff --git a/netsniff-ng.c b/netsniff-ng.c
index 23c1d5b..ec4faeb 100644
--- a/netsniff-ng.c
+++ b/netsniff-ng.c
@@ -42,11 +42,10 @@
#include "lockme.h"
#include "tprintf.h"
#include "timer.h"
+#include "tstamping.h"
#include "dissector.h"
#include "xmalloc.h"
-extern int set_sockopt_hwtimestamp(int sock, const char *dev);
-
enum dump_mode {
DUMP_INTERVAL_TIME,
DUMP_INTERVAL_SIZE,
diff --git a/tstamping.c b/tstamping.c
index 29dec35..7c97850 100644
--- a/tstamping.c
+++ b/tstamping.c
@@ -1,12 +1,3 @@
-/*
- * netsniff-ng - the packet sniffing beast
- * Copyright 2009, 2010 Daniel Borkmann.
- * Subject to the GPL, version 2.
- */
-
-extern int set_sockopt_hwtimestamp(int sock, const char *dev);
-
-#ifdef __WITH_HARDWARE_TIMESTAMPING
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -18,7 +9,9 @@ extern int set_sockopt_hwtimestamp(int sock, const char *dev);
#include <linux/if.h>
#include "str.h"
+#include "tstamping.h"
+#ifdef __WITH_HARDWARE_TIMESTAMPING
int set_sockopt_hwtimestamp(int sock, const char *dev)
{
int timesource, ret;
diff --git a/tstamping.h b/tstamping.h
new file mode 100644
index 0000000..41df9aa
--- /dev/null
+++ b/tstamping.h
@@ -0,0 +1,6 @@
+#ifndef TSTAMPING_H
+#define TSTAMPING_H
+
+extern int set_sockopt_hwtimestamp(int sock, const char *dev);
+
+#endif /* TSTAMPING_H */