#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "_lcmaps_pluginmanager.h"
#include "lcmaps_log.h"
#include "pdl.h"
#include "pdl_variable.h"
#include "pdl_policy.h"
#include "pdl_rule.h"
Go to the source code of this file.
Functions | |
void | _set_path (const record_t *_path) |
record_t * | _concat_strings (const record_t *s1, const record_t *s2, const char *extra) |
void | reduce_policies (void) |
BOOL | plugin_exists (const char *string) |
int | find_first_space (const char *string) |
policy_t * | get_current_policy (void) |
int | pdl_init (const char *name) |
int | yyparse_errors (void) |
const plugin_t * | get_plugins (void) |
const char * | pdl_path (void) |
int | yyerror (const char *s) |
void | set_path (record_t *path) |
void | free_path (void) |
record_t * | concat_strings (record_t *s1, record_t *s2) |
record_t * | concat_strings_with_space (record_t *s1, record_t *s2) |
const char * | pdl_next_plugin (plugin_status_t status) |
void | free_resources (void) |
void | warning (pdl_error_t error, const char *s,...) |
Variables | |
const char * | script_name = NULL |
If non NULL, the name of the configuration script. | |
const char * | d_path = "/usr/lib" |
Default path where plugins can be found. | |
const char * | path = 0 |
Path where plugins can be found. | |
int | path_lineno = 0 |
??? | |
plugin_t * | top_plugin = NULL |
First node of the list. | |
BOOL | default_path = TRUE |
Has the default vallue of the path been changed. | |
BOOL | parse_error = FALSE |
Tell if there have been any error during parsing. | |
char * | level_str [PDL_SAME] |
When a message is printed, how do we spell warning in a given language. | |
unsigned int | lineno = 1 |
The first line of a configuration sctipt is labeled 1. |
In here one can find the more general functions. Most of them are accessible to outside sources. For a complete list of usable function to out side sources,
Definition in file pdl_main.c.
|
Concatenate two string.
Definition at line 426 of file pdl_main.c. References PDL_ERROR, record_s::string, and warning. Referenced by concat_strings, and concat_strings_with_space. |
|
Overwrite the default path with the new value. If this function is called more than once, a warning message is displayed for each occurent.
Definition at line 365 of file pdl_main.c. References default_path, record_s::lineno, path, path_lineno, PDL_ERROR, record_s::string, and warning. Referenced by set_path. |
|
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 405 of file pdl_main.c. References _concat_strings, 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 460 of file pdl_main.c. References _concat_strings, and record_s::string. |
|
Find the first occurrence of a space in a string.
Definition at line 301 of file pdl_main.c. Referenced by plugin_exists. |
|
Free the string allocated to hold the path Definition at line 384 of file pdl_main.c. References default_path, path, and TRUE. Referenced by free_resources. |
|
Free the resources. Definition at line 622 of file pdl_main.c. References free_path, free_policies, free_variables, and script_name. |
|
Return the current policy. Definition at line 72 of file pdl_main.c. Referenced by runEvaluationManager. |
|
Get a list of plugins as known by the configuration file.
Definition at line 146 of file pdl_main.c. References FALSE_BRANCH, rule_s::false_branch, get_policies, policy_s::name, policy_s::next, rule_s::next, policies_have_been_reduced, policy_s::rule, STATE, rule_s::state, TRUE_BRANCH, and rule_s::true_branch. |
|
Init the pdl engine. The function takes one arguments, the name of a configuration file to use.
Definition at line 86 of file pdl_main.c. References plugin_s::args, d_path, default_path, level_str, plugin_s::name, plugin_s::next, parse_error, path, PDL_ERROR, PDL_INFO, PDL_UNKNOWN, PDL_WARNING, script_name, 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 510 of file pdl_main.c. References EVALUATION_FAILURE, EVALUATION_START, EVALUATION_SUCCESS, rule_s::false_branch, get_policies, policy_s::name, policy_s::next, PDL_ERROR, pdl_path, plugin_status_t, resetCredentialData, policy_s::rule, rule_s::state, rule_s::true_branch, and warning. Referenced by runEvaluationManager. |
|
Get the path.
Definition at line 318 of file pdl_main.c. References path. |
|
Check if a plugin as specified by the string argument exists.
Definition at line 199 of file pdl_main.c. References find_first_space. |
|
Reduce_policies to its elemantry form, i.e. each policy has a list of rules which need to be reduced. Definition at line 206 of file pdl_policy.c. References plugin_s::args, plugin_s::name, plugin_s::next, and TRUE. Referenced by startEvaluationManager. |
|
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 348 of file pdl_main.c. References _set_path, path, and record_s::string. |
|
Display a warning message.
Definition at line 658 of file pdl_main.c. References level_str, lineno, parse_error, PDL_ERROR, pdl_error_t, 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 331 of file pdl_main.c. |
|
Tell if there were errors/warning during parsing.
Definition at line 134 of file pdl_main.c. References parse_error. |