Commit Graph

24 Commits

Author SHA1 Message Date
DL6ER d2b6b96df6 Explicitly use clientID for newOVerTimeClient() instead of using the private variable overTimeClientCount to avoid (possibly) error-prone double-entry bookkeeping.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-01-25 11:09:41 +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 8de30790f8 Review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-10 08:16:36 +01:00
DL6ER eeae592c58 Ensure regex validation is working as expected if privacylevel > 0. This required a certain rearrangement of how we handle domains and clients internally.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-11-09 19:02:06 +01:00
DL6ER 515f14f35f Ensure findOverTimeID() cannot return negative indices. Fixes #397
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-10-13 11:01:57 +02: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 96928c73ef Use strbuffer also for domains
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-01 19:04:02 +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 df9d119810 Merge pull request #277 from pi-hole/fix/wildcard_warning
Suppress wrong warning
2018-05-12 15:58:12 +02:00
DL6ER c71cb022f7 Return early if no wildcard domains are defined to avoid warning to be printed although for-loop will anyhow be skipped
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-11 16:48:27 +02:00
DL6ER f6e4ec4230 Add blocked domains counter for individual clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-10 14:22:58 +02:00
DL6ER a464798d95 Don't call validate_access() when the for-loop afterwards will be skipped
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-30 22:42:34 +02:00
DL6ER 76924b9425 Merge pull request #260 from pi-hole/new/regex
Add regex blocking support to FTLDNS
2018-04-29 17:57:09 +02:00
DL6ER 49c79add6c Optimize several datastructure sunroutines
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-29 11:32:23 +02:00
DL6ER c7453d5343 Call memory_check() only when needed (before creating a new domain/client record)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-29 11:05:20 +02:00
DL6ER 2f6e24045f Add regex blocking support
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-24 17:22:17 +02:00
DL6ER e2d0529993 Implement name resolving power back for FTLDNS. This re-implements lots of already extensively tested code that was present in pre-FTLDNS for over a year. This implementation is only slightly different by ensuring that name resolution is done in a specific non-blocking way.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-11 18:20:06 +02:00
DL6ER dfc32a6204 Move reply type and dnssec status to per-query (not per-domain) for more accurate data at negligible additional costs
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-06 23:32:32 +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