From f14b1646fde2d4ea1e68cf80627a55bcdad5acfd Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 8 Mar 2019 10:55:13 +0100 Subject: [PATCH] Remove further extern variable statements that are leftovers from pre FTLDNS times. Added comments where global variables are being used for the remaining ones. Signed-off-by: DL6ER --- FTL.h | 26 +++++++++----------------- Makefile | 2 +- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/FTL.h b/FTL.h index fa9357a8..dc1ba8ab 100644 --- a/FTL.h +++ b/FTL.h @@ -267,31 +267,23 @@ extern clientsDataStruct *clients; extern domainsDataStruct *domains; extern overTimeDataStruct *overTime; -/// Indexed by client ID, then time index (like `overTime`). -/// This gets automatically updated whenever a new client or overTime slot is added. -extern int **overTimeClientData; - -extern FILE *logfile; +// Used in gc.c, memory.c, resolve.c, signals.c, and socket.c extern volatile sig_atomic_t killed; - -extern char ** setupVarsArray; -extern int setupVarsElements; - -extern bool initialscan; -extern bool threadwritelock; -extern bool threadreadlock; +// Used in api.c, grep.c, and dnsmasq_interface.c extern unsigned char blockingstatus; - +// Used in main.c, log.c, and others extern char * username; -extern bool flush; -extern bool needGC; +// Used in main.c, args.c, log.c, and others extern bool daemonmode; +// Used in main.c, database.c, and others extern bool database; +// Used in database.c and gc.c extern long int lastdbindex; -extern bool travis; +// Used in database.c and gc.c extern bool DBdeleteoldqueries; -extern bool rereadgravity; +// Used in main.c, socket.c, and dnsmasq_interface.c extern bool ipv4telnet, ipv6telnet; +// Used in api.c, and socket.c extern bool istelnet[MAXCONNS]; // Use out own memory handling functions that will detect possible errors diff --git a/Makefile b/Makefile index a8023d27..1472642a 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ CCFLAGS=-std=gnu11 -I$(IDIR) $(WARNFLAGS) -D_FILE_OFFSET_BITS=64 $(HARDENING_FLA # for dnsmasq we need the nettle crypto library and the gmp maths library # We link the two libraries statically. Although this increases the binary file size by about 1 MB, it saves about 5 MB of shared libraries and makes deployment easier #LIBS=-pthread -lnettle -lgmp -lhogweed -LIBS=-pthread -Wl,-Bstatic -L/usr/local/lib -lhogweed -lgmp -lnettle -Wl,-Bdynamic -lrt -lcap +LIBS=-pthread -lrt -lcap -Wl,-Bstatic -L/usr/local/lib -lhogweed -lgmp -lnettle -Wl,-Bdynamic # Flags for compiling with libidn : -lidn # Flags for compiling with libidn2: -lidn2