Commit Graph

206 Commits

Author SHA1 Message Date
DL6ER 427f8ad8e1 Further review comments. Always allocate vendor so we can always free this pointer. Add a callback for the update subroutine.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-01-07 18:46:57 +01:00
DL6ER 82b43c332b Parse ARP cache after storing queries into long-term database(usen the dedicated database thread)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 17:56:44 +01:00
DL6ER 050452e75b Merge branch 'fix/shm_lock_resolve' into new/hosts-table 2018-12-25 15:53:01 +01:00
DL6ER bd6c9aadd0 Move locking/unlocking to the place where the functions that need it are called. This fixes a bug where socket.c tried to release a lock that was already released in request.c. Furthermore, this prevents obtaining a lock for both, API calls that do not need a lock and also for unknown API calls.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 14:20:33 +01:00
DL6ER 40fd4d317e Add / update rows in table network depending on what we see in the ARP cache
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-24 13:19:18 +01:00
Mcat12 ff4d985f9d Merge branch 'new/shmem' into feature/shm-lock
# Conflicts:
#	database.c
#	request.c
2018-11-21 14:56:15 -05:00
DL6ER 513566328d Call to ">reresolve" also re-resolves host names of all known forward destinations
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-10-26 20:17:37 +02:00
DL6ER f2f3566980 Move resolution of client and upstream host names to a dedicated thread. Fixes #404
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-10-25 19:53:29 +02:00
Mcat12 d7b4ce8a5f Remove read lock and simplify lock names
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-10-11 15:59:52 -04:00
Mcat12 8c68aac456 Add shared memory lock
This replaces the previous mutex managed by threads.c. The lock is
stored in shared memory with the name "/FTL-lock", and any clients
connecting to the shared memory are expected to use the lock when
accessing memory.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-10-05 01:18:40 -04:00
Mcat12 d2d24acfdf Kill the >kill command
FTL now hosts the DNS server for the network, so allowing anyone to kill
it is a security issue.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-10-04 15:54:38 -04:00
DL6ER 25eb416f92 Remove memory sub-structure
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-06-23 15:02:36 +02:00
Mcat12 ffd282ab0b Add >recompile-regex API command
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-06-02 00:53:50 -04:00
DL6ER b4f86d53b4 Add new ">reresolve" API endpoint that triggeres PTR queries for all clients FTLDNS is aware of. This may come in handy if hostnames have been changed and you want FTL to acknowledge that already now instead of waiting until the next routinely re-resolving happens (at the end of GC, typically once an hour)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-31 11:40:36 +02:00
DL6ER c606ad75ab Remove undocumented, old, and unused debug commands
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-10 19:24:02 +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 df3b049ede Remove clientips[]
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-20 21:41:12 +01:00
DL6ER 0aee819dc2 Implement some of the review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-20 21:38:24 +01:00
Mcat12 d3d70983ad Merge remote-tracking branch 'origin/development' into new/API
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>

# Conflicts:
#	main.c
#	request.c
#	routines.h
#	socket.c
2018-01-14 17:48:37 -05:00
Mcat12 4aee3645d6 Fix limit on top-domains, top-ads, and top-clients
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-12 18:17:15 -05:00
DL6ER d53371082f Replace sprintf() + swrite() by the new ssend() routine. This enhancement removes the fixed buffer we used before and allows for responses having arbitraty lengths
Signed-off-by: DL6ER <dl6er@dl6er.de>

Conflicts:
	request.c
	routines.h
2018-01-12 22:40:53 +01:00
Mcat12 353e0cb212 Move command() up to the top of the file so it isn't as hidden
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-12 14:58:02 -05:00
Mcat12 7d877223f4 Remove getList
Most DNS endpoints will be implemented in the API to keep FTL focused
on providing stats.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-11 16:54:36 -05:00
Mcat12 b9780dc295 Reimplement output for getPiholeStatus
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-10 23:05:05 -05:00
Mcat12 f02c4e81a5 Reimplement output for getList
Adds `>getWhitelist`, `>getBlacklist`, and `getWildlist`

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-10 22:46:45 -05:00
DL6ER 71434f81d8 Another descending (absteigend) and ascending (aufsteigend) tweak
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-08 23:55:39 +01:00
DL6ER 19a851c60f Fix meaning of ascending and descending
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-08 23:41:31 +01:00
DL6ER 684f334ef1 Implement improved algorithm in getTopClients(). As a by-product this also adds the optional "desc" feature to the top clients requests where it wasn't available before
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-08 22:27:40 +01:00
DL6ER 15f5c2aa72 Implement improved algorithm in getTopDomains(). Instead of assuming how many lines of data we have sent, we can also explicitly count them.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-08 22:22:50 +01:00
Mcat12 64a1408e5d Add socket implementation of getDBstats and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 22:51:04 -05:00
Mcat12 2671a6fde0 Add socket implementation of getVersion and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 22:40:30 -05:00
Mcat12 779a82468e Add socket implementation to getQueryTypesOverTime and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 22:29:06 -05:00
Mcat12 08143393f0 Add socket implementation to getClientID and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 22:23:01 -05:00
Mcat12 7d0f680347 Add socket implementation to getForwardDestinationsOverTime and istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 22:19:20 -05:00
Mcat12 81200a270d Add socket implementation to getMemoryUsage and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 21:10:14 -05:00
Mcat12 555a0cbc6c Add socket implementation to getRecentBlocked and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 15:48:09 -05:00
Mcat12 3f1ffafc8f Add socket implementation to getQueryTypes and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 15:24:48 -05:00
Mcat12 33dd350370 Add socket implementation to getForwardDestinations and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 14:53:11 -05:00
Mcat12 00f8877232 Add socket implementation to getTopClients and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-06 23:10:35 -05:00
Mcat12 05f86041cf Add socket implementation to getTopDomains and use istelnet
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-06 22:28:41 -05:00
Mcat12 adfcaccb36 Use istelnet for getAllQueries
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-05 22:36:19 -05:00
Mcat12 c0022a95c9 Use istelnet for getOverTime
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-05 22:15:55 -05:00
DL6ER 3483ee8407 Remove intermediate variables where we don't need them
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-05 23:03:23 +01:00
DL6ER d0d0dfede5 Extract first 7 characters of the hash as this is what "git --no-pager describe --always" gives as output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-05 22:36:58 +01:00
DL6ER cf93110aee Final fix for Travis versioning and all the cosmetic issues we have seen
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-05 22:34:07 +01:00
DL6ER f0793be61b Use istelnet[] in getStats()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-04 19:33:20 +01:00
Mcat12 e527985371 Implement getStats using MessagePack
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-04 12:04:04 -05:00
Mcat12 595ab259ca Remove HTTP API specific code so it can be replaced with a new protocol
Adjusted tests to fit the current lack of output on the unix socket.
Added TELNET enum and used it in place of the old SOCKET to better fit
with the rest of the code base.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-03 20:16:50 -05:00
Mcat12 8adb3d335e Merge remote-tracking branch 'origin/development' into new/API
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-03 14:35:42 -05:00