Commit Graph

52 Commits

Author SHA1 Message Date
DL6ER 2abc2caace Make client and domain finding algorithms faster by skipping candidates that fail for a comparison of the very first character 2017-04-04 15:28:52 +02:00
DL6ER baca4cbb26 Factor out client finding algorithm 2017-04-04 15:24:30 +02:00
DL6ER 7039b3db99 Factor out domain finding algorithm 2017-04-04 15:22:43 +02:00
DL6ER ba058c1372 Increase verbosity of log file 2017-04-03 10:33:08 +02:00
DL6ER d779673fa1 Re-parse all logs when receiving signal SIGUSR1 2017-04-02 23:59:49 +02:00
DL6ER b5a28edccb Debug mode: Print at which time query had to be enlarged (kind of log parsing process display for humongous logs 2017-04-02 22:57:23 +02:00
DL6ER fa37f92e33 ftell returns long int (not unsigned) 2017-04-01 16:00:00 +02:00
DL6ER e3b549e377 Improve code output 2017-03-31 14:17:21 +02:00
DL6ER c49b406fcc Calling backtrace inside a signal handler is (unfortunately) meaningless 2017-03-31 13:48:34 +02:00
DL6ER 3bcffa46f5 Improve log parser for pihole.log with file size > 4 GB 2017-03-30 00:53:58 +02:00
DL6ER 78f615201a Some non-POSIX systems use different conventions for exit status values.
For greater portability, we now use the macros EXIT_SUCCESS and EXIT_FAILURE for the conventional status value for success and failure, respectively.
They are declared in stdlib.h
2017-03-29 14:00:51 +02:00
DL6ER 3dd09df9bf Also print username if pihole.log cannot be read 2017-03-29 13:52:44 +02:00
DL6ER f506c28724 Refine checkLogForChanges() 2017-03-29 11:18:48 +02:00
DL6ER b43d077017 Check log reliably for filesize reduction (flushing event) 2017-03-29 10:37:16 +02:00
DL6ER cabc6800d6 Add Query Types over Time data structure 2017-03-28 14:45:16 +02:00
DL6ER ac9947ba89 Return early from log parsing if log flushing is detected half-way through 2017-03-27 10:42:29 +02:00
DL6ER 106498df9f Handle DST according to ISO/IEC 9899:TC3 2017-03-26 13:10:43 +02:00
DL6ER de41afeef4 Fix GC collector bug 2017-03-23 17:25:14 +01:00
DL6ER 2829970d74 Fix memory leak 2017-03-17 18:59:30 +01:00
DL6ER 779b18755c Extend summary output 2017-03-16 10:18:12 +01:00
DL6ER 8fd8e10212 Upgrade file pointer buffers from int to unsigned long int 2017-03-16 07:35:30 +01:00
DL6ER cc7ccc5921 Improve documentation of thread locks. Allow concurrently active clients accessing the data struction in read-only mode 2017-03-16 01:18:09 +01:00
DL6ER 722b062f2c Initialize FTL with default parameters if log file cannot be read 2017-03-15 14:10:02 +01:00
DL6ER a8a55a3857 Implement rolling 24h as standard behavior of FTL. Can be set to static views of up to 24h (analyzing pihole.log) and up to 48h (analyzing pihole.log.1 in addition) 2017-03-14 18:46:17 +01:00
DL6ER 7c9b1b4195 Add config file parser. First config arguments are
SOCKET_LISTENING=all|local
INCLUDE_YESTERDAY=true|false

If FTL we cannot find or interpret a config variable value, it will skip it and use the default value
2017-03-14 12:20:07 +01:00
DL6ER e70be89073 Remove moving time frame altogether 2017-03-14 10:38:16 +01:00
DL6ER 40375ab18e Garbage collect query types (speed enhancements, PTR, SRV) 2017-03-13 11:01:09 +01:00
DL6ER a859abcf60 Generate over time structure for forwarded data and discard old forwarded data on initial log parsing 2017-03-13 10:37:01 +01:00
DL6ER c7119444d8 Compare domains in parser with whitespace-padded domains to eliminate possible wildcard false-positives 2017-03-13 10:00:22 +01:00
DL6ER 093f13d432 Refine detection if forwarded to upstream DNS server (remove any false positives) 2017-03-12 23:49:46 +01:00
DL6ER f73ed48dbf Implement FTL garbage collector 2017-03-12 21:03:05 +01:00
DL6ER 7eef68e68a Re-read log line if dnsmasq hasn't finished writing it 2017-03-12 17:38:10 +01:00
DL6ER a299f9559b Don't start log re-parsing if threadlock is set (this could lead to an inifinite loop if ther are > 300.000 queries in todays log on slow devices) 2017-03-12 16:26:43 +01:00
DL6ER 89d6567259 Add thread names 2017-03-12 16:16:36 +01:00
DL6ER 3bb6f423dc FTL is now aware of how much memory it uses. Added ">memory" command. 2017-03-12 12:16:09 +01:00
DL6ER 3a9f02b468 Make reparsing_delay a compiletime variable 2017-03-12 10:42:51 +01:00
DL6ER 7486ebfac2 Prevent resource leaks 2017-03-10 14:02:31 +01:00
DL6ER 4cb9b58d33 Also analyze pihole.log.1 and keep only data of the most recent 24 hours (reparse logs every hour) 2017-03-10 13:49:09 +01:00
DL6ER 6ccfeea2da Guarantee FTL's thread safety 2017-03-08 11:47:58 +01:00
DL6ER 2203a722d2 Add wildcard blocked flag to domains struct (to be used later in the Audit log) 2017-03-08 10:04:06 +01:00
DL6ER 2b4188a092 Add multi-threading: Pi-hole log processing now happening independently of the rest of the daemon 2017-03-08 10:02:31 +01:00
DL6ER f3cab87318 Minor memory optimization in unix timestamp generation code 2017-02-27 17:26:25 +01:00
DL6ER 85a7818e79 Remove any 24h limitation from the overTime graph 2017-02-27 15:42:17 +01:00
DL6ER a435a440ac Move flush handling routine into own file 2017-02-27 13:26:26 +01:00
DL6ER d9c7820927 Compare "config" lines to known wildcard entries to identify if wildcard blocking was used for such domains. Note that reading the gravity files has now to occur before the initial reading of the pihole.log file so that the wildcard blocked domains are known 2017-02-23 17:44:36 +01:00
DL6ER 67c48d77ee Take care to free everything that I allocated before when pihole log is flushed 2017-02-23 17:17:44 +01:00
DL6ER dd44b4302b Added wildcard blocking domains list parser 2017-02-23 17:08:42 +01:00
DL6ER 2442bc5a50 Simplify host name resolving routines 2017-02-10 17:07:28 +01:00
DL6ER dad9d37b43 Understand DHCP answers for hostname requests 2017-02-06 22:46:20 +01:00
DL6ER 3f4faad540 Ensure buffer is never accessed out of bounds 2017-02-06 11:16:55 +01:00