Commit Graph

38 Commits

Author SHA1 Message Date
DL6ER 92d819899e Add MAC->Vendor database support. We will provide the database as an optional auxiliary file.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-30 23:35:15 +01:00
DL6ER 85290bb73e Merge branch 'development' into new/shmem
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-21 20:44:37 +01:00
DL6ER 109861f5d0 Make AUDITLISTFILE customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 17:15:45 +01:00
DL6ER f7a5ef022b Make SETUPVARSFILE customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 17:14:12 +01:00
DL6ER 5e1743988e Make REGEXLISTFILE customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 17:12:55 +01:00
DL6ER ee6cf89607 Make GRAVITYFILE customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 17:11:32 +01:00
DL6ER 2f8a67f495 Make WHITELISTFILE customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 17:09:30 +01:00
DL6ER ce95d08d6a Remove hard-coded location of preEventHorizon and 01-pihole.conf. They are not used anywhere anymore.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 16:59:23 +01:00
DL6ER 32498b5d5d Remove files.log. It is not used anymore and a relict from pre-v4.0 times.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 16:57:09 +01:00
DL6ER f5d8adfb1d Make SOCKETFILE customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 16:54:17 +01:00
DL6ER 42403734b0 Make PORTFILE customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 16:52:48 +01:00
DL6ER c747023424 Make PID file path customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 16:44:40 +01:00
DL6ER d104d6b271 Make log file path customizable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 16:37:49 +01:00
DL6ER 7fc77c67a2 Search for readable config file in alternative location in case the default path is not available.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-07 16:21:00 +01:00
Mcat12 cd41aaeab4 Put overTime data into shared memory
The array of overTime structs is separate from the client data, because
the client data is dynamically sized. Each client has a separate shared
memory block named `/FTL-client-ID` where `ID` is the numerical ID of
the client. The client data is an array of ints, which is indexed using
the overTime time indexes.

Before, the code referenced the client data via
`overTime[timeIndex].clientdata[clientID]`
Now, the code references the data via
`overTimeClientData[clientID][timeIndex]`

The client data is updated whenever a new client or overTime slot is
added, so referencing the client data should always be valid.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-09-19 13:00:50 -04:00
Mcat12 ae1bb5b71a Move counters to shared memory
This requires that it be accessed through a pointer, so most of the
changes are just changing `counters.` to `counters->`

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-09-03 14:25:16 -04:00
DL6ER eb1d851ed2 Allocate more struct memory earlier
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-04 09:26:37 +02:00
DL6ER 77f932be47 Move query type determination further up
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-03 15:42:15 +02:00
DL6ER edf74617ae Fix wrong pointer reference
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-03 09:15:04 +02:00
DL6ER 5d22aa774e Also store queries struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 20:09:39 +02:00
DL6ER 584c23dc26 Also store forwarded struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 20:04:47 +02:00
DL6ER 249d236673 Also store clients struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 20:00:05 +02:00
DL6ER 0ced77c93b Also store domains struct in shared memory object
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 19:51:36 +02:00
DL6ER 2e12558f04 Allocate shared memory in units of pages
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 17:40:26 +02:00
DL6ER 1b7e08419c Add shared memory components to store strings in shared memory
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 13:23:12 +02:00
DL6ER d7d851860a Store size in string buffer + use long long for string position indices
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 12:19:11 +02:00
DL6ER 1a508fc40b Rename last_pos to next_pos and use struct for string buffer
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-02 12:08:21 +02:00
DL6ER b7da12b600 Use strbuffer also for client IPs and host names
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-01 18:37:48 +02:00
DL6ER 3e8849049e Store forward destination IP address and host name in contiguous string buffer
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-01 18:04:43 +02:00
DL6ER 25eb416f92 Remove memory sub-structure
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-06-23 15:02:36 +02:00
DL6ER decef2e5fd Remove special support for old type of wildcard lists as dnsmasq config file
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-19 14:46:21 +02:00
DL6ER d50494b8f4 Get rid of numBlocked file, FTLDNS can now determine number of domains thanks to the new lists format
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-21 23:57:25 +02:00
DL6ER 821e64e514 Accept gravity.list and black.list in simple domain list format. Speeds up list importing by about 2x
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-21 23:26:44 +02:00
DL6ER c5f34a4dea Use number of effectively blocked domains from /etc/pihole/numBlocked if available. Fall back to counting number of entries in preEventHorizon if this file is not found (e.g. updated gravity didn't run yet)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-30 21:02:25 +02:00
DL6ER 2ae4b52bb3 A number of improvements:
- use "extern" for the glibal variable specifications in the header files (and clarif where the variables are actually defined)
- record number of failed requests to forward destinations
- Add dnsmasq_interface.h to DTLDEPS
- Add new request type ">cacheinfo" to get information about cache usage in the resolver

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-26 17:24:09 +01:00
DL6ER ea3309e7b1 Initial commit for FTLDNS
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-22 20:21:06 +01:00
DL6ER 971a162866 Don't rely on the system's strdup() function but provide our own
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-12 12:46:33 +01:00
DL6ER ecde321632 Add custom macros for the memory-functions
- calloc,
- realloc,
- free, and
- strdup

These functions will not directly improve memory handling but they will log if something will go wrong *before* it actually goes wrong. This will ease debugging when user provide log snippets especially in ENOMEM (no memory available) situations.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-07 12:24:12 +01:00