diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-04 12:07:20 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-06-04 12:07:20 +0200 |
commit | 01525e848cd682d51319383c9968979224255b53 (patch) | |
tree | d151c99a3d562f75b5a0bf835a10ea40bc7978b5 | |
parent | 7ea4576392b014490e6308ad82d695cc85a0b8bd (diff) |
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 <dborkman@redhat.com>
-rw-r--r-- | netsniff-ng.c | 3 | ||||
-rw-r--r-- | tstamping.c | 11 | ||||
-rw-r--r-- | tstamping.h | 6 |
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 */ |