#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | plugin_s |
Structure holds a plugin name and its arguments, as well as the line number the plugin is first mentioned. More... | |
struct | record_s |
Structure is used to keep track of strings and the line they appear on. More... | |
Defines | |
#define | TRUE 1 |
Typedefs | |
typedef record_s | record_t |
Structure is used to keep track of strings and the line they appear on. | |
typedef plugin_s | plugin_t |
Structure holds a plugin name and its arguments, as well as the line number the plugin is first mentioned. | |
Enumerations | |
enum | pdl_error_t { PDL_UNKNOWN, PDL_INFO, PDL_WARNING, PDL_ERROR, PDL_SAME } |
enum | plugin_status_t { EVALUATION_START, EVALUATION_SUCCESS, EVALUATION_FAILURE } |
Functions | |
int | pdl_init (const char *name) |
const char * | pdl_path (void) |
int | yyparse_errors (void) |
int | yyerror (const char *) |
void | set_path (record_t *_path) |
record_t * | concat_strings (record_t *s1, record_t *s2) |
record_t * | concat_strings_with_space (record_t *s1, record_t *s2) |
const plugin_t * | get_plugins (void) |
void | warning (pdl_error_t error, const char *s,...) |
void | free_resources (void) |
const char * | pdl_next_plugin (plugin_status_t status) |
Variables | |
unsigned int | lineno |
The first line of a configuration sctipt is labeled 1. |
In this include file all general "things" can be found.
Definition in file pdl.h.
|
The evaluation manager defines its own boolean type. It first undefines any existing type defenitions before it defines it itself. Definition at line 51 of file pdl.h. Referenced by _add_policy(), _add_variable(), allowed_policy_rule(), check_policies_for_recursion(), check_rule_for_recursion(), free_path(), getPluginNameAndArgs(), make_list(), pdl_init(), plugin_exists(), reduce_policies(), reduce_to_var(), and warning(). |
|
Structure is used to keep track of strings and the line they appear on. When lex finds a match, this structure is used to keep track of the relevant information. The matchig string as well as the line number are saved. The line number can be used for later references when an error related to the symbol has occured. This allows for easier debugging of the configuration file. Referenced by _add_policy(), _add_rule(), _add_variable(), _concat_strings(), _set_path(), add_policy(), add_rule(), add_variable(), concat_strings(), concat_strings_with_space(), remove_policy(), and set_path(). |
|
Different levels of error logging. |
|
Guide the selection of the next plugin.
Definition at line 72 of file pdl.h. Referenced by runEvaluationManager(). |
|
Concatenate two strings. The orginal two strings are freed. When the concatenation fails, the origial strings are still freed. The actual concatenation is done by _concat_strings().
Definition at line 451 of file pdl_main.c. References _concat_strings(), record_t, and record_s::string. |
|
Concatenate two strings. The orginal two strings are freed. When the concatenation fails, the origial strings are still freed. The actual concatenation is done by _concat_strings().
Definition at line 507 of file pdl_main.c. References _concat_strings(), record_t, and record_s::string. |
|
Free the resources. Definition at line 671 of file pdl_main.c. References free_path(), free_plugins(), free_policies(), free_variables(), script_name, and top_plugin. Referenced by stopEvaluationManager(). |
|
Get a list of plugins as known by the configuration file.
Definition at line 154 of file pdl_main.c. References rule_s::false_branch, FALSE_BRANCH, get_policies(), lcmaps_log(), lcmaps_log_debug(), policy_s::name, rule_s::next, policy_s::next, plugin_t, policies_have_been_reduced(), policy_t, policy_s::rule, rule_t, rule_s::state, STATE, top_plugin, rule_s::true_branch, and TRUE_BRANCH. Referenced by getPluginNameAndArgs(). |
|
Init the pdl engine. The function takes one argument, the name of a configuration file to use.
Definition at line 93 of file pdl_main.c. References d_path, default_path, free_plugins(), level_str, parse_error, path, PDL_ERROR, PDL_INFO, PDL_UNKNOWN, PDL_WARNING, script_name, top_plugin, TRUE, and warning(). Referenced by startEvaluationManager(). |
|
Find the next plugin to evaluate based on the return status of the previous plugin evaluation. There are three statuses, two of which are rather obvious: either the previous evaluation has succeeded (EVALUATION_SUCCESS), or it has failed (EVALUATION_FAILURE). Based on these results, the next plugin should be the true_branch or false_branch respectively. There is one situation where there is no previous evaluation and that is at the very beginning. The very first call to this function should have (EVALUATION_START) as arguments. In this case the current state of the rule is returned as the next plugin to evaluate.
Definition at line 557 of file pdl_main.c. References EVALUATION_FAILURE, EVALUATION_START, EVALUATION_SUCCESS, rule_s::false_branch, find_state(), get_policies(), lcmaps_log_debug(), policy_s::name, policy_s::next, PDL_ERROR, pdl_path(), resetCredentialData(), policy_s::rule, rule_s::state, rule_s::true_branch, and warning(). Referenced by runEvaluationManager(). |
|
Get the path.
Definition at line 364 of file pdl_main.c. References path. Referenced by getPluginNameAndArgs(), and pdl_next_plugin(). |
|
Function is called when the parser has found the value of the reserved path word. This function acts as a wrapper for the _set_path() function.
Definition at line 394 of file pdl_main.c. References _set_path(), path, and record_t. |
|
Display a warning message.
Definition at line 710 of file pdl_main.c. References lcmaps_log(), level_str, lineno, parse_error, PDL_ERROR, PDL_SAME, PDL_UNKNOWN, script_name, and TRUE. Referenced by _add_policy(), _add_rule(), _add_variable(), _concat_strings(), _set_path(), check_rule_for_recursion(), has_recursion(), pdl_init(), pdl_next_plugin(), reduce_to_var(), and yyerror(). |
|
When yacc encounters an error during the parsing process of the configuration file, it calls yyerror(). The actual message formatting is done in waring();
Definition at line 377 of file pdl_main.c. |
|
Tell if there were errors/warning during parsing.
Definition at line 142 of file pdl_main.c. References parse_error. Referenced by startEvaluationManager(). |