Commit Graph

34 Commits

Author SHA1 Message Date
Dominik 589649d6ce Merge branch 'development' into tweak/track_sqlite_memory
Signed-off-by: Dominik <dl6er@dl6er.de>
2026-01-04 19:04:37 +01:00
Dominik 43c17efb7a Fix gcc-15 caveat: {0} initializer in C or C++ for unions no longer guarantees clearing of the whole union (except for static storage duration initialization), it just initializes the first union member to zero.
Signed-off-by: Dominik <dl6er@dl6er.de>
2025-12-14 19:08:55 +01:00
Dominik bb048cc4c5 Print even more memory debugging information
Signed-off-by: Dominik <dl6er@dl6er.de>
2025-11-28 06:46:32 +01:00
Dominik c2c74c8b10 Implement lightweight SQLite3 memory tracking
Signed-off-by: Dominik <dl6er@dl6er.de>
2025-11-27 20:40:40 +01:00
Dominik 9879a06983 Apply Pi-hole SQLite3 patches. The percentile and carray extensions are now native parts of the amalgation build.
Signed-off-by: Dominik <dl6er@dl6er.de>
2025-11-09 08:59:42 +01:00
DL6ER cd438d0452 Limit CIDR values to avoid possible out-of-bounds when building the netmask
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-10-22 21:17:24 +02:00
DL6ER f21830b0c4 Fix Pi-hole-provided SQL function isIPv6(string)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-10-22 21:16:26 +02:00
DL6ER 6f5a250c33 Add the official SQLite3 percentile extension (https://sqlite.org/src/file/ext/misc/percentile.c)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-10-11 13:30:24 +02:00
DL6ER 833fba0458 Ensure the shell will always initialize the extra functions provided by Pi-hole
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-10-11 13:26:11 +02:00
DL6ER dc204a41b0 Use v2.6 CI containers and nightly for the devcontainer
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-05-25 09:54:37 +02:00
DL6ER 32de390b00 Add Clang compiler support, tested with Clang 14.0.0 (Ubuntu 22.04.3 LTS), Clang 16.0.2 (Alpine 3.18), and Clang 17.0.6 (Alping Edge)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-05-15 20:41:52 +02:00
DL6ER 1cde68bce7 Add ability to get most recent client hostname from network table if specified by MAC address
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-21 14:11:40 +01:00
DL6ER 7281da34b4 Add /api/clients/_suggestions
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-06 07:31:21 +02:00
DL6ER e145d20d28 Rewrite the entire config-related code to allow for changing data without having to restart. Hereby, we greatly reduce code duplication in the TOML routines so we won't have to touch tme in the future when adding additional options.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-01-07 18:06:41 +01:00
DL6ER 55bf825a81 Implement TOML config file reader/writer and a converter of the pre-v6.0 config file format.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-06-10 12:11:25 +02:00
DL6ER d30fd44ff8 Use specific log routines in database/sqlite3-ext.c
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-05-27 12:22:40 +02:00
DL6ER 3bb0fe98be Fix subdirectory include paths. This is only to be explicit, the relative search finds them otherwise as well
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-09-03 20:46:01 +02:00
DL6ER 101f14a6a7 Increase robustness of custom SQL subnet_match() function against invalid input.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-19 10:30:34 +02:00
DL6ER e1c56f754d Add support for specifying clients by their host names.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-18 10:54:57 +02:00
DL6ER c08b7358e0 Remove IP addresses not seen for more than 24 hours to clean the network table from dead addresses
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-13 19:58:54 +02:00
DL6ER 8d24d20782 Implement MAC address support.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-13 19:10:02 +02:00
DL6ER f6be58b285 Return early in subnet_match() if first argument is a MAC address
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-13 19:10:02 +02:00
DL6ER 7317fe5bfd Implement isMAC() SQL subroutine.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-13 19:09:59 +02:00
DL6ER 8133752224 Always chose most suitable (= maximum) subnet for clients. This allows to configure specific settings for a whole range of devices but still exclude others. Complain softly (no error) if multiple configured subnets match with the same number of relevant bits.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-11 20:03:28 +02:00
DL6ER b2bea818f0 Fix bit-order in subnet mask generation.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-08 11:26:25 +02:00
DL6ER fdb8664f4a Check arguments are of type SQLITE3_TEXT
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-04-02 15:17:00 +00:00
DL6ER 6d612678e6 Also return NO MATCH when invoking subnet_match() with non-TEXT arguments.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-04-02 15:16:58 +00:00
DL6ER 1636a81041 Explicitly log failures in creating the new sqlite3 function.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-04-02 15:15:55 +00:00
DL6ER e596c55b66 Simplify SQLite 3 database extension
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-25 11:30:37 +01:00
DL6ER 8f349e1c56 Add more comments, only print debugging output when DEBUG_DATABASE is enabled.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-25 10:47:19 +01:00
DL6ER 0b8915a321 Improve debugging output, reduce code duplication.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-04 17:37:43 +00:00
DL6ER 351f5f67dd Invalid IP addresses in the database should just cause a NO MATCH condition.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-03 23:53:42 +00:00
DL6ER 6baaf4b0f7 Use defined macro to access 8 bit values.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-03 23:43:00 +00:00
DL6ER 0ac6b5cb69 Implement new SQLite3 subroutine which can interpret IP addresses that may use Classless Inter-Domain Routing (CIDR) notation. This is also known as variable-length subnet masking (VLSM) technique.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-03 23:35:27 +00:00