Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/deskman.h | 1 +
src/detstats.c | 3 ---
src/error.c | 2 --
src/hostmon.c | 3 ---
src/hostmon.h | 1 +
src/ifstats.c | 3 ---
src/instances.h | 4 ----
src/iptraf-ng-compat.h | 3 +++
src/iptraf.c | 4 ----
src/itrafmon.c | 4 ----
src/othptab.c | 3 +--
src/packet.c | 2 --
src/pktsize.c | 3 ---
src/serv.c | 3 ---
src/tcptable.c | 3 +--
src/tui/menurt.h | 16 ++++++++--------
16 files changed, 15 insertions(+), 43 deletions(-)
diff --git a/src/deskman.h b/src/deskman.h
index a5badee..a745f0c 100644
--- a/src/deskman.h
+++ b/src/deskman.h
@@ -6,6 +6,7 @@
*/
void draw_desktop(void);
+void about(void);
void printipcerr(void);
void printkeyhelp(char *keytext, char *desc, WINDOW * win, int highattr,
int textattr);
diff --git a/src/detstats.c b/src/detstats.c
index e60f238..b707969 100644
--- a/src/detstats.c
+++ b/src/detstats.c
@@ -45,9 +45,6 @@ struct ifcounts {
struct proto_counter other;
};
-extern int exitloop;
-extern int daemonized;
-
/* USR1 log-rotation signal handlers */
static void rotate_dstat_log(int s __unused)
{
diff --git a/src/error.c b/src/error.c
index 45d8e8c..91fbd17 100644
--- a/src/error.c
+++ b/src/error.c
@@ -12,8 +12,6 @@ error.c - Error-handling subroutines
#include "log.h"
#include "tui/msgboxes.h"
-extern int daemonized;
-
void write_error(char *msg, ...)
{
va_list vararg;
diff --git a/src/hostmon.c b/src/hostmon.c
index 72b91f8..d3c4028 100644
--- a/src/hostmon.c
+++ b/src/hostmon.c
@@ -34,9 +34,6 @@ Discovers LAN hosts and displays packet statistics for them
#define SCROLLUP 0
#define SCROLLDOWN 1
-extern int exitloop;
-extern int daemonized;
-
struct ethtabent {
int type;
union {
diff --git a/src/hostmon.h b/src/hostmon.h
index 4f74d51..a943b21 100644
--- a/src/hostmon.h
+++ b/src/hostmon.h
@@ -4,6 +4,7 @@
#include "options.h"
#include "fltselect.h"
+void convmacaddr(char *addr, char *result);
void hostmon(const struct OPTIONS *options, time_t facilitytime, char *ifptr,
struct filterstate *ofilter);
diff --git a/src/ifstats.c b/src/ifstats.c
index d656d95..02c4f3a 100644
--- a/src/ifstats.c
+++ b/src/ifstats.c
@@ -65,9 +65,6 @@ struct iftab {
PANEL *statpanel;
};
-extern int exitloop;
-extern int daemonized;
-
/*
* USR1 log-rotation signal handlers
*/
diff --git a/src/instances.h b/src/instances.h
index c2c87a4..47d1080 100644
--- a/src/instances.h
+++ b/src/instances.h
@@ -7,10 +7,6 @@ instances.h - header file for instances.c
***/
-#ifndef MAIN_MODULE
-extern int is_first_instance;
-#endif
-
void mark_facility(char *tagfile, char *facility, char *ifptr);
void unmark_facility(char *tagfile, char *ifptr);
int facility_active(char *tagfile, char *ifptr);
diff --git a/src/iptraf-ng-compat.h b/src/iptraf-ng-compat.h
index 2d9da96..d252247 100644
--- a/src/iptraf-ng-compat.h
+++ b/src/iptraf-ng-compat.h
@@ -83,6 +83,9 @@
} \
} while (0)
+extern int is_first_instance; /* in iptraf.c */
+extern int daemonized;
+extern int exitloop;
extern void *xmalloc(size_t size);
extern void *xcalloc(size_t nmemb, size_t size);
diff --git a/src/iptraf.c b/src/iptraf.c
index b3412f2..11fbc42 100644
--- a/src/iptraf.c
+++ b/src/iptraf.c
@@ -6,8 +6,6 @@ IPTraf
An IP Network Statistics Utility
*/
-#define MAIN_MODULE
-
#include "iptraf-ng-compat.h"
#include "tui/menurt.h"
@@ -47,8 +45,6 @@ int facility_running = 0;
int is_first_instance;
char graphing_filter[80];
-extern void about(void);
-
static void press_enter_to_continue(void)
{
fprintf(stderr, "Press Enter to continue.\n");
diff --git a/src/itrafmon.c b/src/itrafmon.c
index d8338d5..ce452ea 100644
--- a/src/itrafmon.c
+++ b/src/itrafmon.c
@@ -38,9 +38,6 @@ itrafmon.c - the IP traffic monitor module
#define SCROLLUP 0
#define SCROLLDOWN 1
-extern int exitloop;
-extern int daemonized;
-
static void rotate_ipmon_log(int s __unused)
{
rotate_flag = 1;
@@ -491,7 +488,6 @@ static int checkrvnamed(void)
{
pid_t cpid = 0;
int cstat;
- extern int errno;
indicate("Trying to communicate with reverse lookup server");
if (!rvnamedactive()) {
diff --git a/src/othptab.c b/src/othptab.c
index 1181eb1..62ce73f 100644
--- a/src/othptab.c
+++ b/src/othptab.c
@@ -23,6 +23,7 @@ othptab.c - non-TCP protocol display module
#include "servname.h"
#include "addproto.h"
#include "packet.h"
+#include "hostmon.h"
#define MSGSTRING_MAX 240
#define SHORTSTRING_MAX 40
@@ -33,8 +34,6 @@ othptab.c - non-TCP protocol display module
*/
#define uninitialized_var(x) x = x
-void convmacaddr(char *addr, char *result); /* external; from hostmon.c */
-
static void writeothplog(int logging, FILE *fd, char *protname,
char *description, char *additional, int is_ip,
int withmac, struct othptabent *entry)
diff --git a/src/packet.c b/src/packet.c
index f3e4304..c1baf3b 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -25,8 +25,6 @@ packet.c - routines to open the raw socket, read socket data and
* Removed PPP, LINK_ISDN
*/
-extern int daemonized;
-
/*
int isdnfd;
struct isdntab isdntable;
diff --git a/src/pktsize.c b/src/pktsize.c
index af77ff5..03d92df 100644
--- a/src/pktsize.c
+++ b/src/pktsize.c
@@ -28,9 +28,6 @@ pktsize.c - the packet size breakdown facility
#include "logvars.h"
#include "promisc.h"
-extern int exitloop;
-extern int daemonized;
-
struct ifstat_brackets {
unsigned int floor;
unsigned int ceil;
diff --git a/src/serv.c b/src/serv.c
index 9d29ff0..ea6435c 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -41,9 +41,6 @@ serv.c - TCP/UDP port statistics module
#define LEFT 0
#define RIGHT 1
-extern int exitloop;
-extern int daemonized;
-
struct serv_spans {
int spanbr_in;
int spanbr_out;
diff --git a/src/tcptable.c b/src/tcptable.c
index b0e5ccc..6012587 100644
--- a/src/tcptable.c
+++ b/src/tcptable.c
@@ -19,14 +19,13 @@ tcptable.c - table manipulation routines for the IP monitor
#include "revname.h"
#include "rvnamed.h"
#include "servname.h"
+#include "hostmon.h"
#define MSGSTRING_MAX 320
unsigned int bmaxy = 0;
unsigned int imaxy = 0;
-void convmacaddr(char *addr, char *result);
-
static void setlabels(WINDOW *win, int mode)
{
wmove(win, 0, 42 * COLS / 80);
diff --git a/src/tui/menurt.h b/src/tui/menurt.h
index 0316cac..03c8b5a 100644
--- a/src/tui/menurt.h
+++ b/src/tui/menurt.h
@@ -45,13 +45,13 @@ struct MENU {
char shortcuts[SHORTCUTSTRLEN_MAX];
};
-extern void tx_initmenu(struct MENU *menu, int y1, int x1, int y2, int x2,
- int borderattr, int normalattr, int highattr,
- int barnormalattr, int barhighattr, int descattr);
-extern void tx_additem(struct MENU *menu, char *item, char *desc);
-extern void tx_showitem(struct MENU *menu, struct ITEM *itemptr, int selected);
-extern void tx_showmenu(struct MENU *menu);
-extern void tx_operatemenu(struct MENU *menu, int *row, int *aborted);
-extern void tx_destroymenu(struct MENU *menu);
+void tx_initmenu(struct MENU *menu, int y1, int x1, int y2, int x2,
+ int borderattr, int normalattr, int highattr,
+ int barnormalattr, int barhighattr, int descattr);
+void tx_additem(struct MENU *menu, char *item, char *desc);
+void tx_showitem(struct MENU *menu, struct ITEM *itemptr, int selected);
+void tx_showmenu(struct MENU *menu);
+void tx_operatemenu(struct MENU *menu, int *row, int *aborted);
+void tx_destroymenu(struct MENU *menu);
#endif /* IPTRAF_NG_TUI_MENURT_H */
--
1.7.8.4