/[pdpsoft]/trunk/grid-mw-security/ees/src/eval_man/pdl.c
ViewVC logotype

Diff of /trunk/grid-mw-security/ees/src/eval_man/pdl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1258 by aramv, Wed Dec 9 11:12:54 2009 UTC revision 1259 by aramv, Wed Dec 9 14:13:11 2009 UTC
# Line 33  policy_t*                   policies_lis Line 33  policy_t*                   policies_lis
33  policy_t*                   policies_list_last;  policy_t*                   policies_list_last;
34  policy_t*                   current_policy;  policy_t*                   current_policy;
35    
 static policy_t*            parsed_policy_list;  
   
36  /* This function does everything parser related. After running yacc through wrap_yacc(), the created list is reduced to those in the array of named policies, of number_of_policies is greater than 0. The policies are checked for unreachable rules. After the parser has created a list of policies containing lists of rules, these rules are transformed to a tree by the link_dead_end_rules_in_policies() function. Finally, when a list of policies containing rules trees was created, the plug-ins are linked to each rule in the node. */  /* This function does everything parser related. After running yacc through wrap_yacc(), the created list is reduced to those in the array of named policies, of number_of_policies is greater than 0. The policies are checked for unreachable rules. After the parser has created a list of policies containing lists of rules, these rules are transformed to a tree by the link_dead_end_rules_in_policies() function. Finally, when a list of policies containing rules trees was created, the plug-ins are linked to each rule in the node. */
37  EES_RC start_pdl_parser(char *config_file, int number_of_policies, char* names_of_policies[]){  EES_RC start_pdl_parser(char *config_file, int number_of_policies, char* names_of_policies[]){
38    recursion_was_created = 0;    recursion_was_created = 0;
# Line 49  EES_RC start_pdl_parser(char *config_fil Line 47  EES_RC start_pdl_parser(char *config_fil
47      /* set the EEF modules path to the path found by the evaluation manager */      /* set the EEF modules path to the path found by the evaluation manager */
48      set_modules_path(get_pdl_path());      set_modules_path(get_pdl_path());
49    
     /* retrieve policy list from the evaluation mananger */  
     parsed_policy_list = get_policies();  
   
50      /* strip policies that are not explicitly passed in the names_of_policies array */      /* strip policies that are not explicitly passed in the names_of_policies array */
51      if(number_of_policies){      if(number_of_policies){
52        parsed_policy_list = reduce_policies(parsed_policy_list, number_of_policies, names_of_policies);        policies_list = reduce_policies(policies_list, number_of_policies, names_of_policies);
53      }      }
54    
55      if(remove_unreachable_rules_in_policies(parsed_policy_list) == EES_SUCCESS){      if(remove_unreachable_rules_in_policies(policies_list) == EES_SUCCESS){
56        if(parsed_policy_list){        if(policies_list){
57          link_dead_end_rules_in_policies(parsed_policy_list);          link_dead_end_rules_in_policies(policies_list);
58          link_rules_to_plugins(parsed_policy_list);          link_rules_to_plugins(policies_list);
59        }        }
60        eef_log(LOG_INFO, "Your configuration file seems sane.\n");        eef_log(LOG_INFO, "Your configuration file seems sane.\n");
61        print_policies(parsed_policy_list);        print_policies(policies_list);
62    
63        /* this is a callout to the plugin manager, which dlopen()'s the plugin, dlsym()'s the plugin's functions and calls the plugin's initialize function */        /* this is a callout to the plugin manager, which dlopen()'s the plugin, dlsym()'s the plugin's functions and calls the plugin's initialize function */
64        if(initialize_plugins() == EES_SUCCESS){        if(initialize_plugins() == EES_SUCCESS){
# Line 245  rule_t* add_rule(record_t* state, record Line 240  rule_t* add_rule(record_t* state, record
240            eef_log(LOG_WARNING, "Rule %s at line %i leads to recursion into state %s", new_rule->state, new_rule->lineno, recursive_rule->state);            eef_log(LOG_WARNING, "Rule %s at line %i leads to recursion into state %s", new_rule->state, new_rule->lineno, recursive_rule->state);
241            new_rule = clean_rules_tree(new_rule);            new_rule = clean_rules_tree(new_rule);
242            recursion_was_created = 1;            recursion_was_created = 1;
243              goto cleanup;
244          } else {          } else {
245            /* add new rule at the end of the rules list */            /* add new rule at the end of the rules list */
246            if(rules_list){            if(rules_list){
# Line 814  EES_RC clean_policies_list(policy_t* pol Line 810  EES_RC clean_policies_list(policy_t* pol
810  /*! Terminates the parser and tries to free all used memory */  /*! Terminates the parser and tries to free all used memory */
811  EES_RC pdl_term(){  EES_RC pdl_term(){
812    clean_variables_list();    clean_variables_list();
813    clean_policies_list(parsed_policy_list);    clean_policies_list(policies_list);
814    free(_pdl_path);    free(_pdl_path);
815    _pdl_path = NULL;    _pdl_path = NULL;
816    

Legend:
Removed from v.1258  
changed lines
  Added in v.1259

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28