From 01525e848cd682d51319383c9968979224255b53 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Tue, 4 Jun 2013 12:07:20 +0200 Subject: tstamping: add header file for packet timestamping Better add a header file for this, so that we do not need to have it in multiple places declared. Signed-off-by: Daniel Borkmann --- netsniff-ng.c | 3 +-- tstamping.c | 11 ++--------- tstamping.h | 6 ++++++ 3 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 tstamping.h 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 #include #include @@ -18,7 +9,9 @@ extern int set_sockopt_hwtimestamp(int sock, const char *dev); #include #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 */ -- cgit v1.2.3-54-g00ecf