A little console based wizard helping configuring new eurephia databases. More...
#include <stdio.h>#include <string.h>#include <libgen.h>#include <assert.h>#include <libxml/tree.h>#include <libxml/xpath.h>#include <libxml/xmlstring.h>#include <eurephia_nullsafe.h>#include <eurephia_context.h>#include <eurephiadb.h>#include <eurephiadb_driver.h>#include <eurephia_values.h>#include <eurephia_xml.h>#include <client_context.h>#include <argparser.h>#include <get_console_input.h>
Include dependency graph for eurephia_init.c:Go to the source code of this file.
Defines | |
| #define | MODULE "eurephia_init" |
Functions | |
| int | benchmark (int *min, int *max, int thr_min, int thr_max) |
| char * | print_version (char *fprg) |
| void | print_help (char *fprg) |
| int | eurephia_ConnectDB (eurephiaCTX *ctx, eurephiaVALUES *cfg) |
| static int | config_set (eurephiaCTX *ctx, const char *key, const char *val) |
| int | setup_admin_account (eurephiaCTX *ctx) |
| int | setup_password_params (eurephiaCTX *ctx, const int hash_thr_min, const int hash_thr_max) |
| int | setup_attempt_limits (eurephiaCTX *ctx) |
| int | setup_session_params (eurephiaCTX *ctx) |
| int | setup_iptables (eurephiaCTX *ctx) |
| int | main (int argc, char **argv) |
A little console based wizard helping configuring new eurephia databases.
Definition in file eurephia_init.c.
| #define MODULE "eurephia_init" |
Set the module name to eurephia_init
Definition at line 52 of file eurephia_init.c.
| int benchmark | ( | int * | min, | |
| int * | max, | |||
| int | thr_min, | |||
| int | thr_max | |||
| ) |
This function will try to find the best minium and maximum rounds for the SHA512 hashing. The values are returned in the min and max variables and the thr_min and thr_max defines the minimum and maximum thresholds in milliseconds the hashing algorithm should use.
| min | Return pointer for the minimum hashing rounds value | |
| max | Return pointer for the maximum hashing rounds value | |
| thr_min | Allow the calculation of hashes to last for thr_min ms. | |
| thr_max | Do not allow the hash calculation to exceed thr_max ms. |
Definition at line 159 of file benchmark.c.
Here is the call graph for this function:
Here is the caller graph for this function:| static int config_set | ( | eurephiaCTX * | ctx, | |
| const char * | key, | |||
| const char * | val | |||
| ) | [static] |
Internal eurephia_init function. Sets a configuration parameter in the database.
| ctx | eurephiaCTX | |
| key | String containing the key name | |
| val | String containing the value of the key |
Definition at line 166 of file eurephia_init.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int eurephia_ConnectDB | ( | eurephiaCTX * | ctx, | |
| eurephiaVALUES * | cfg | |||
| ) |
Establishes a connection to the defined database. The eurephiaCTX will contain the database connection.
| ctx | eurephiaCTX | |
| cfg | eurephiaVALUES stack containing the database parameters |
< Defines the maximum arguments the parsers handles
< Alias for LOG_FATAL
< Operation failed and cannot continue. Log level always < 2
< Defines the maximum arguments the parsers handles
< Alias for LOG_PANIC
< Action failed an program could not continue to run. Log level always 0
Definition at line 123 of file eurephia_init.c.
Here is the call graph for this function:| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Main function of eurephia_init
| argc | ||
| argv |
Definition at line 613 of file eurephia_init.c.
Here is the call graph for this function:| void print_help | ( | char * | fprg | ) |
Prints a help screen for all arguments eurephia_init can process
| fprg | String containing full path to this binary (argv[0]) |
Definition at line 84 of file eurephia_init.c.
Here is the call graph for this function:
Here is the caller graph for this function:| char* print_version | ( | char * | fprg | ) |
Prints program version information to stdout
| fprg | String containing full path to this binary (argv[0]) |
Definition at line 69 of file eurephia_init.c.
| int setup_admin_account | ( | eurephiaCTX * | ctx | ) |
Guides the user through setting up the first eurephia administrator account.
| ctx | eurephiaCTX |
Definition at line 210 of file eurephia_init.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int setup_attempt_limits | ( | eurephiaCTX * | ctx | ) |
Guides the user through setting up attempts limits
| ctx | eurephiaCTX |
Definition at line 457 of file eurephia_init.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int setup_iptables | ( | eurephiaCTX * | ctx | ) |
Guides the user through setting up iptables firewall support, if enabled at compile time.
| ctx | eurephiaCTX |
Definition at line 535 of file eurephia_init.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int setup_password_params | ( | eurephiaCTX * | ctx, | |
| const int | hash_thr_min, | |||
| const int | hash_thr_max | |||
| ) |
Guides the user through setting up hashing algorithm parameters. This function will try to find the ideal boundaries for hashing rounds, based on how quick the computer can calculate hashes.
| ctx | eurephiaCTX | |
| hash_thr_min | Minimum time it should take to calculate a SHA512 hash (in ms) | |
| hash_thr_max | Maximum time it should take to calculate a SHA512 hash (in ms) |
Definition at line 400 of file eurephia_init.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int setup_session_params | ( | eurephiaCTX * | ctx | ) |
Guides the user through setting up session specific parameters, mainly for the admin utilities
| ctx | eurephiaCTX |
Definition at line 505 of file eurephia_init.c.
Here is the call graph for this function:
Here is the caller graph for this function:
1.7.1