Move function declaration into the hostmon.h and do the necessary
changes to make it compile.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/externs.h | 3 ---
src/hostmon.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
src/hostmon.h | 54 ++++--------------------------------------------------
src/iptraf.c | 1 +
4 files changed, 52 insertions(+), 56 deletions(-)
diff --git a/src/externs.h b/src/externs.h
index 4e5df02..12d2750 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -8,7 +8,4 @@ others
***/
-void hostmon(const struct OPTIONS *options, int facilitytime, char *ifptr,
- struct filterstate *ofilter);
-
#endif /* IPTRAF_NG_EXTERNS_H */
diff --git a/src/hostmon.c b/src/hostmon.c
index 47b0e44..87b0b46 100644
--- a/src/hostmon.c
+++ b/src/hostmon.c
@@ -34,9 +34,53 @@ Discovers LAN hosts and displays packet statistics for them
extern int exitloop;
extern int daemonized;
-/*
- * from log.c, applicable only to this module
- */
+struct ethtabent {
+ int type;
+ union {
+ struct {
+ unsigned long long inpcount;
+ unsigned long long inbcount;
+ unsigned long long inippcount;
+ unsigned long inspanbr;
+ unsigned int inpktact;
+ unsigned long long outpcount;
+ unsigned long long outbcount;
+ unsigned long long outippcount;
+ unsigned long outspanbr;
+ unsigned int outpktact;
+ float inrate;
+ float outrate;
+ short past5;
+ } figs;
+
+ struct {
+ char eth_addr[ETH_ALEN];
+ char ascaddr[18];
+ char desc[65];
+ char ifname[IFNAMSIZ];
+ int withdesc;
+ int printed;
+ unsigned int linktype;
+ } desc;
+ } un;
+
+ unsigned int index;
+ struct ethtabent *prev_entry;
+ struct ethtabent *next_entry;
+};
+
+struct ethtab {
+ struct ethtabent *head;
+ struct ethtabent *tail;
+ struct ethtabent *firstvisible;
+ struct ethtabent *lastvisible;
+ unsigned long count;
+ unsigned long entcount;
+ WINDOW *borderwin;
+ PANEL *borderpanel;
+ WINDOW *tabwin;
+ PANEL *tabpanel;
+};
/*
* SIGUSR1 logfile rotation handler
diff --git a/src/hostmon.h b/src/hostmon.h
index 983ff99..4f74d51 100644
--- a/src/hostmon.h
+++ b/src/hostmon.h
@@ -1,56 +1,10 @@
#ifndef IPTRAF_NG_HOSTMON_H
#define IPTRAF_NG_HOSTMON_H
-/*
- * hostmon.h - definitions used by the Ethernet station monitor
- */
+#include "options.h"
+#include "fltselect.h"
-struct ethtabent {
- int type;
- union {
- struct {
- unsigned long long inpcount;
- unsigned long long inbcount;
- unsigned long long inippcount;
- unsigned long inspanbr;
- unsigned int inpktact;
- unsigned long long outpcount;
- unsigned long long outbcount;
- unsigned long long outippcount;
- unsigned long outspanbr;
- unsigned int outpktact;
- float inrate;
- float outrate;
- short past5;
- } figs;
-
- struct {
- char eth_addr[ETH_ALEN];
- char ascaddr[18];
- char desc[65];
- char ifname[IFNAMSIZ];
- int withdesc;
- int printed;
- unsigned int linktype;
- } desc;
- } un;
-
- unsigned int index;
- struct ethtabent *prev_entry;
- struct ethtabent *next_entry;
-};
-
-struct ethtab {
- struct ethtabent *head;
- struct ethtabent *tail;
- struct ethtabent *firstvisible;
- struct ethtabent *lastvisible;
- unsigned long count;
- unsigned long entcount;
- WINDOW *borderwin;
- PANEL *borderpanel;
- WINDOW *tabwin;
- PANEL *tabpanel;
-};
+void hostmon(const struct OPTIONS *options, time_t facilitytime, char *ifptr,
+ struct filterstate *ofilter);
#endif /* IPTRAF_NG_HOSTMON_H */
diff --git a/src/iptraf.c b/src/iptraf.c
index 69d408f..9dd927b 100644
--- a/src/iptraf.c
+++ b/src/iptraf.c
@@ -26,6 +26,7 @@ An IP Network Statistics Utility
#include "ifstats.h"
#include "itrafmon.h"
#include "pktsize.h"
+#include "hostmon.h"
#include "parse-options.h"
--
1.7.8.4