Move function declaration into the serv.h and do the necessary
changes to make it compile.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/externs.h | 2 --
src/serv.c | 40 ++++++++++++++++++++++++++++++++++++++++
src/serv.h | 46 ++++++----------------------------------------
3 files changed, 46 insertions(+), 42 deletions(-)
diff --git a/src/externs.h b/src/externs.h
index a67f18d..4e5df02 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -8,8 +8,6 @@ others
***/
-void servmon(char *iface, struct porttab *ports, const struct OPTIONS *options,
- int facilitytime, struct filterstate *ofilter);
void hostmon(const struct OPTIONS *options, int facilitytime, char *ifptr,
struct filterstate *ofilter);
diff --git a/src/serv.c b/src/serv.c
index ed574af..210d013 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -40,6 +40,46 @@ serv.c - TCP/UDP port statistics module
extern int exitloop;
extern int daemonized;
+struct serv_spans {
+ int spanbr_in;
+ int spanbr_out;
+ int spanbr;
+};
+
+struct portlistent {
+ unsigned int port;
+ unsigned int protocol;
+ char servname[11];
+ unsigned int idx;
+ unsigned long long count;
+ unsigned long long bcount;
+ unsigned long long icount;
+ unsigned long long ibcount;
+ unsigned long long ocount;
+ unsigned long long obcount;
+ time_t starttime;
+ time_t proto_starttime;
+ struct serv_spans spans;
+ struct portlistent *prev_entry;
+ struct portlistent *next_entry;
+};
+
+struct portlist {
+ struct portlistent *head;
+ struct portlistent *tail;
+ struct portlistent *firstvisible;
+ struct portlistent *lastvisible;
+ struct portlistent *barptr;
+ int imaxy;
+ unsigned int baridx;
+ unsigned int count;
+ unsigned long bcount;
+ WINDOW *win;
+ PANEL *panel;
+ WINDOW *borderwin;
+ PANEL *borderpanel;
+};
+
/*
* SIGUSR1 logfile rotation signal handler
*/
diff --git a/src/serv.h b/src/serv.h
index ecc5374..b4e3101 100644
--- a/src/serv.h
+++ b/src/serv.h
@@ -7,46 +7,6 @@ serv.h - TCP/UDP port statistics header file
***/
-struct serv_spans {
- int spanbr_in;
- int spanbr_out;
- int spanbr;
-};
-
-struct portlistent {
- unsigned int port;
- unsigned int protocol;
- char servname[11];
- unsigned int idx;
- unsigned long long count;
- unsigned long long bcount;
- unsigned long long icount;
- unsigned long long ibcount;
- unsigned long long ocount;
- unsigned long long obcount;
- time_t starttime;
- time_t proto_starttime;
- struct serv_spans spans;
- struct portlistent *prev_entry;
- struct portlistent *next_entry;
-};
-
-struct portlist {
- struct portlistent *head;
- struct portlistent *tail;
- struct portlistent *firstvisible;
- struct portlistent *lastvisible;
- struct portlistent *barptr;
- int imaxy;
- unsigned int baridx;
- unsigned int count;
- unsigned long bcount;
- WINDOW *win;
- PANEL *panel;
- WINDOW *borderwin;
- PANEL *borderpanel;
-};
-
struct porttab {
unsigned int port_min;
unsigned int port_max;
@@ -59,4 +19,10 @@ void loadaddports(struct porttab **table);
void destroyporttab(struct porttab *table);
void removeaport(struct porttab **table);
+#include "options.h"
+#include "fltselect.h"
+
+void servmon(char *iface, struct porttab *ports, const struct OPTIONS *options,
+ time_t facilitytime, struct filterstate *ofilter);
+
#endif /* IPTRAF_NG_SERV_H */
--
1.7.8.4