New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modularize FTL modules/headers #605
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: DL6ER <dl6er@dl6er.de>
…utines.h Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…ar as this is applicable (we do not do it for the thread pointers as this complicates linking dependencies). Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…ble.o Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…-the-fly. Signed-off-by: DL6ER <dl6er@dl6er.de>
…fix clean target. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…ts into new subdirectory "build". Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…rectory src/api. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
AzureMarker
reviewed
Jul 4, 2019
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…nfig{.c/.h} Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
5 tasks
Signed-off-by: DL6ER <dl6er@dl6er.de>
… prefer to handle the logging through the SQLite3 error callback as this ensures it cannot be missed. Previously: [2019-07-06 17:00:55.526 32339] SQLite3 message: statement aborts at 36: [CREATE UNIQUE INDEX network_hwaddr_idx ON network(hwaddr)] attempt to write a readonly database (8) [2019-07-06 17:00:55.526 32339] dbquery(CREATE UNIQUE INDEX network_hwaddr_idx ON network(hwaddr)) - SQL error (8): attempt to write a readonly database [2019-07-06 17:00:55.526 32339] check_database(8): Disabling database connection due to error [2019-07-06 17:00:55.526 32339] unify_hwaddr(): "CREATE UNIQUE INDEX network_hwaddr_idx ON network(hwaddr)" failed! Now: [2019-07-06 17:00:55.526 32339] SQLite3 message: statement aborts at 36: [CREATE UNIQUE INDEX network_hwaddr_idx ON network(hwaddr)] attempt to write a readonly database (8) [2019-07-06 17:00:55.526 32339] check_database(8): Disabling database connection due to error [2019-07-06 17:00:55.526 32339] ERROR: unify_hwaddr() failed! Signed-off-by: DL6ER <dl6er@dl6er.de>
… error. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
AzureMarker
reviewed
Jul 6, 2019
…e we set database to false. Signed-off-by: DL6ER <dl6er@dl6er.de>
…ld_queries_in_DB(). The function can in any way not be called when database == false as this is an exit criterion for the database thread. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…commented. Signed-off-by: DL6ER <dl6er@dl6er.de>
AzureMarker
reviewed
Jul 7, 2019
Database error checking
… that are not needed. Signed-off-by: DL6ER <dl6er@dl6er.de>
AzureMarker
approved these changes
Jul 9, 2019
Note that the codefactor issues are ignored, but the GitHub check is not updated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:
Please submit all pull requests against the
development
branch. Failure to do so will delay or deny your requestHow familiar are you with the codebase?:
10
Since the advent of our Faster Than Light (pihole-FTL) engine, it somewhat organically grew and quickly became a complex daemon. However, instead of properly fractionating the code into clearly separated modules, we instead got two very large files
FTL.h
androutines.h
which contained prototypes for everything.This PR restructures our FTL engine by separating the declarations and functions into separated modules, each consisting of a .c and the corresponding .h files. These two files build modules, each corresponding to a clear piece of functionality. They can be largely maintained and developed separately from the other modules, and partially even reused in entirely different projects.
Summary of the changes in this pull request:
FTL.h
into the corresponding module headers where this is practical.routines.h
altogether.database/
database.c
file into two smaller files (database/common.c
anddatabase/query-table.c
).stat()
to obtain the physical size of the database fromdatabase.c
intofiles.c
where similar functions already exist.