Main part of the eurephiadm command line administration utility for eurephia. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include <libgen.h>#include <libxml/tree.h>#include <eurephia_nullsafe.h>#include <eurephia_context.h>#include <eurephia_log.h>#include <eurephia_values.h>#include <eurephia_xml.h>#include <eurephiadb_driver.h>#include <eurephiadb_session_common.h>#include <eurephiadb.h>#include "argparser.h"#include "client_context.h"#include "client_config.h"#include "client_session.h"#include "get_console_input.h"#include "commands.h"
Include dependency graph for eurephiadm.c:Go to the source code of this file.
Defines | |
| #define | MODULE "eurephiadm" |
Functions | |
| char * | print_version (char *fprg) |
| void | help_Help () |
| int | cmd_Help (eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) |
| int | cmd_Logout (eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) |
| int | cmd_ShowCfg (eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) |
| int | eurephia_ConnectDB (eurephiaCTX *ctx, const char *argstr) |
| static eurephiaSESSION * | do_login (eurephiaCTX *ctx, eurephiaVALUES *cfg, const char *req_access) |
| static int | validate_session (eurephiaCTX *ctx, const char *sesskey, const char *accesslvl) |
| char * | args2string (int argc, char **argv) |
| int | main (int argc, char **argv) |
Main part of the eurephiadm command line administration utility for eurephia.
Definition in file eurephiadm.c.
| #define MODULE "eurephiadm" |
Need to define the active module before including argparser.h
Definition at line 49 of file eurephiadm.c.
| char* args2string | ( | int | argc, | |
| char ** | argv | |||
| ) |
Converts a argument table (char **) into a space separated string (char *)
| argc | argument counter | |
| argv | argument array |
Definition at line 415 of file eurephiadm.c.
Here is the caller graph for this function:| int cmd_Help | ( | eurephiaCTX * | ctx, | |
| eurephiaSESSION * | sess, | |||
| eurephiaVALUES * | cfg, | |||
| int | argc, | |||
| char ** | argv | |||
| ) |
Displays a generic help screen, if no arguments where given, or else the the help screen for the eurephiadm command if it was found.
| ctx | eurephiaCTX | |
| sess | eurephiaSESSION of the current logged in user | |
| cfg | eurephiaVALUES struct of the current configuration | |
| argc | argument count for the eurephiadm command | |
| argv | argument table for the eurephiadm command |
< Need to define the active module before including argparser.h
< Need to define the active module before including argparser.h
Definition at line 98 of file eurephiadm.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int cmd_Logout | ( | eurephiaCTX * | ctx, | |
| eurephiaSESSION * | sess, | |||
| eurephiaVALUES * | cfg, | |||
| int | argc, | |||
| char ** | argv | |||
| ) |
eurephiadm logout command. Logs out the current active session.
| ctx | eurephiaCTX | |
| sess | eurephiaSESSION of the current logged in user | |
| cfg | eurephiaVALUES struct of the current configuration | |
| argc | argument count for the logout command | |
| argv | argument table for the logout command |
< Alias for LOG_FATAL
< Operation failed and cannot continue. Log level always < 2
< Need to define the active module before including argparser.h
< Need to define the active module before including argparser.h
Definition at line 158 of file eurephiadm.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int cmd_ShowCfg | ( | eurephiaCTX * | ctx, | |
| eurephiaSESSION * | sess, | |||
| eurephiaVALUES * | cfg, | |||
| int | argc, | |||
| char ** | argv | |||
| ) |
eurephiadm show-config command. Dumps configuration to stdout. If the user is logged in, the configuration saved in the database is also dumped.
| ctx | eurephiaCTX | |
| sess | eurephiaSESSION of the current logged in user | |
| cfg | eurephiaVALUES struct of the current configuration | |
| argc | argument count for the show-config command | |
| argv | argument table for the show-config command |
Definition at line 202 of file eurephiadm.c.
Here is the caller graph for this function:| static eurephiaSESSION* do_login | ( | eurephiaCTX * | ctx, | |
| eurephiaVALUES * | cfg, | |||
| const char * | req_access | |||
| ) | [static] |
Log in a user. The function will ask for user name and password and authenticate the user against the eurephia database and make sure the user is granted access to the requested access level.
| ctx | eurephiaCTX | |
| cfg | eurephiaVALUES with configuration settings | |
| req_access | String (const char *) containing the requested access level. |
< Need to define the active module before including argparser.h
< Alias for LOG_FATAL
< Operation failed and cannot continue. Log level always < 2
< Alias for LOG_FATAL
< Operation failed and cannot continue. Log level always < 2
< Need to define the active module before including argparser.h
Definition at line 278 of file eurephiadm.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int eurephia_ConnectDB | ( | eurephiaCTX * | ctx, | |
| const char * | argstr | |||
| ) |
Establish a connection to the database and register the database connection in the eurephiaCTX
| ctx | eurephiaCTX | |
| argstr | argument string for the database connection |
< 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 236 of file eurephiadm.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void help_Help | ( | ) |
Wrapper function to be used by the command API in eurephiadm
< Need to define the active module before including argparser.h
Definition at line 79 of file eurephiadm.c.
Here is the call graph for this function:| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
eurephiadm main function
| argc | argument counter | |
| argv | argument table |
< Defines the maximum arguments the parsers handles
< Need to define the active module before including argparser.h
< Defines the maximum arguments the parsers handles
< Alias for LOG_ERROR, in case it is not defined
< API errors but not sever, program can continue to run
< Informational messages. Log level should be < 5
Definition at line 442 of file eurephiadm.c.
Here is the call graph for this function:| char* print_version | ( | char * | fprg | ) |
Prints version and copyright info to stdout
| fprg | Full path to binary |
Definition at line 65 of file eurephiadm.c.
Here is the caller graph for this function:| static int validate_session | ( | eurephiaCTX * | ctx, | |
| const char * | sesskey, | |||
| const char * | accesslvl | |||
| ) | [static] |
Validates an exisiting session key against a requested access level
| ctx | eurephiaCTX | |
| sesskey | String containing the session key | |
| accesslvl | String containing the requested access level |
< Need to define the active module before including argparser.h
Definition at line 373 of file eurephiadm.c.
Here is the call graph for this function:
Here is the caller graph for this function:
1.7.1