Defines | Functions

eurephia_init.c File Reference

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)

Detailed Description

A little console based wizard helping configuring new eurephia databases.

Author:
David Sommerseth <dazo@users.sourceforge.net>
Date:
2009-03-22

Definition in file eurephia_init.c.


Define Documentation

#define MODULE   "eurephia_init"

Set the module name to eurephia_init

Definition at line 52 of file eurephia_init.c.


Function Documentation

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.

Parameters:
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.
Returns:
Returns 1 if a good suggestion for min and max hashing rounds was found. Otherwise 0 is returned.

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.

Parameters:
ctx eurephiaCTX
key String containing the key name
val String containing the value of the key
Returns:
Returns 1 on success, otherwise 0.

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.

Parameters:
ctx eurephiaCTX
cfg eurephiaVALUES stack containing the database parameters
Returns:
Returns 1 on success, otherwise 0.

< 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

Parameters:
argc 
argv 
Returns:
Returns 0 on success, otherwise a positive integer on failure.

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

Parameters:
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

Parameters:
fprg String containing full path to this binary (argv[0])
Returns:
Returns the basename value of the binary

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.

Parameters:
ctx eurephiaCTX
Returns:
Returns 1 on success, otherwise 0.

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

Parameters:
ctx eurephiaCTX
Returns:
Returns 1 on success, otherwise 0.

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.

Parameters:
ctx eurephiaCTX
Returns:
Returns 1 on success, otherwise 0.

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.

Parameters:
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)
Returns:
Returns 1 on success, otherwise 0.

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

Parameters:
ctx eurephiaCTX
Returns:
Returns 1 on success, otherwise 0.

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:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines