Skip to content
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 45 commits into from
Jul 9, 2019
Merged

Commits on Jun 29, 2019

  1. Modularize header files

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jun 29, 2019
    Configuration menu
    Copy the full SHA
    7a100ae View commit details
    Browse the repository at this point in the history
  2. Only include smaller header files in the source code files. Remove ro…

    …utines.h
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jun 29, 2019
    Configuration menu
    Copy the full SHA
    602bd07 View commit details
    Browse the repository at this point in the history
  3. Mover timer functions in separate C file

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jun 29, 2019
    Configuration menu
    Copy the full SHA
    c212c26 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2019

  1. Combine shmem.h and shmem_r.h

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    b02c69f View commit details
    Browse the repository at this point in the history
  2. Add overTime.h header

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    ff12c1b View commit details
    Browse the repository at this point in the history
  3. Move global variable declarations into the suitable header files as f…

    …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>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    55ed61f View commit details
    Browse the repository at this point in the history
  4. Ignore any database files that might be present in the repository.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    1d0dc1d View commit details
    Browse the repository at this point in the history
  5. Move database modules into common subdirectory

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    2115cdc View commit details
    Browse the repository at this point in the history
  6. Rename database/database.c => database/common.c

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    57116ae View commit details
    Browse the repository at this point in the history
  7. Move query table related routines into a new module database/query-ta…

    …ble.o
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    4db159d View commit details
    Browse the repository at this point in the history
  8. Rename query reading/saving routines for consistency.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    67e684b View commit details
    Browse the repository at this point in the history
  9. Simplify get_number_of_queries_in_DB().

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    b6d4e5e View commit details
    Browse the repository at this point in the history
  10. Rename database/{gravity.* => gravity-db.*}

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    49a009c View commit details
    Browse the repository at this point in the history
  11. gravity.c has been renamed to gravity-db.c

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    5eaf184 View commit details
    Browse the repository at this point in the history
  12. Use local sqlite3.h

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    54547b9 View commit details
    Browse the repository at this point in the history
  13. Readd version.h as explicit dependency in order to have it created on…

    …-the-fly.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    4556b97 View commit details
    Browse the repository at this point in the history
  14. Remove dependency of api.c on the huge header database/sqlite3.h and …

    …fix clean target.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    5a41241 View commit details
    Browse the repository at this point in the history
  15. Rename object dir for dnsmasq files in Makefile.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    6b08566 View commit details
    Browse the repository at this point in the history
  16. Fix wrong standard filename for FTL\'s database.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    0003124 View commit details
    Browse the repository at this point in the history
  17. Move all source files into new subdirectory "src". Put compiled objec…

    …ts into new subdirectory "build".
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    e365364 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2019

  1. Merge branch 'development' into new/modularize_headers

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 4, 2019
    Configuration menu
    Copy the full SHA
    a2961d1 View commit details
    Browse the repository at this point in the history
  2. Move API modules (api, request, socket, msgpack) into their own subdi…

    …rectory src/api.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 4, 2019
    Configuration menu
    Copy the full SHA
    6b2f22f View commit details
    Browse the repository at this point in the history
  3. Move database thread into dedicated module.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 4, 2019
    Configuration menu
    Copy the full SHA
    104ea1b View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2019

  1. Configuration menu
    Copy the full SHA
    ad27f6f View commit details
    Browse the repository at this point in the history
  2. Make variables in Makefile more readable by inserting underscores.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    5699252 View commit details
    Browse the repository at this point in the history
  3. Change type of get_FTL_db_filesize() from double to long int.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    8280f45 View commit details
    Browse the repository at this point in the history
  4. Also enforce recompilation on change of headers in the subdirectories.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    ee671a1 View commit details
    Browse the repository at this point in the history
  5. Move definition of config struct into src/config.h.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    29dd190 View commit details
    Browse the repository at this point in the history
  6. Remove extra space.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    40a75c2 View commit details
    Browse the repository at this point in the history
  7. Move blocking status detection from files.c to setupVars.c

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    25161c1 View commit details
    Browse the repository at this point in the history
  8. Define timers in timers.h.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    3ce04f0 View commit details
    Browse the repository at this point in the history
  9. The macvendor script has moved into subdirectory tools.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    a4e50c3 View commit details
    Browse the repository at this point in the history
  10. Union FTLFileNamesStruct and logFileNamesStruct and define them in co…

    …nfig{.c/.h}
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    e13e39a View commit details
    Browse the repository at this point in the history
  11. Fix incorrect INSERT statement in gravity.db test data.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    9f127e9 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2019

  1. Improve error handling and logging in database/common.c

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 6, 2019
    Configuration menu
    Copy the full SHA
    8baf8e6 View commit details
    Browse the repository at this point in the history
  2. Reduce three-fold logging of SQL errors to logging them only once. We…

    … 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>
    DL6ER committed Jul 6, 2019
    Configuration menu
    Copy the full SHA
    799e3b4 View commit details
    Browse the repository at this point in the history
  3. Do not assume the database is not available before we actually hit an…

    … error.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 6, 2019
    Configuration menu
    Copy the full SHA
    444255b View commit details
    Browse the repository at this point in the history
  4. No need to use heap space for a constant expression.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 6, 2019
    Configuration menu
    Copy the full SHA
    71d9caa View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2019

  1. Move checking of database parameter MAXDBDAYS into db_init() to ensur…

    …e we set database to false.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    4a9503c View commit details
    Browse the repository at this point in the history
  2. The boolean database should not be set to true at the end of delete_o…

    …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>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    812743c View commit details
    Browse the repository at this point in the history
  3. Move even more definitions from FTL.h into the respective headers.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    5c75fc3 View commit details
    Browse the repository at this point in the history
  4. Remove obsolete comment.

    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    e30df58 View commit details
    Browse the repository at this point in the history
  5. Added more comments to dnsmasq-interface.c. Now almost every line is …

    …commented.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 7, 2019
    Configuration menu
    Copy the full SHA
    867e466 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #610 from pi-hole/tweak/database_error_checking

    Database error checking
    AzureMarker authored Jul 7, 2019
    Configuration menu
    Copy the full SHA
    ac1018a View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2019

  1. Simplify logic in detect_blocked_IP(), remove extra return statements…

    … that are not needed.
    
    Signed-off-by: DL6ER <dl6er@dl6er.de>
    DL6ER committed Jul 8, 2019
    Configuration menu
    Copy the full SHA
    b3ad13f View commit details
    Browse the repository at this point in the history