/[pdpsoft]/trunk/grid-mw-security/ees/include/common/pdl.h
ViewVC logotype

Annotation of /trunk/grid-mw-security/ees/include/common/pdl.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1202 - (hide annotations) (download) (as text)
Mon Nov 30 17:14:03 2009 UTC (12 years, 5 months ago) by aramv
File MIME type: text/x-csrc
File size: 3019 byte(s)
Trying to fix open ended rules
1 aramv 886 /*!
2    
3     \file pdl.h
4     \brief Callback functions for parser of the evaluation manager
5     \author Aram Verstegen
6    
7     This header contains some callback functions used for the PDL parser:
8     It contains the following functions:
9 aramv 890
10     -# pdl_init(const char*): Inilizes the parser
11     -# pdl_term(void): terminates the parser
12 aramv 1070 -# set_modules_path(record_t*): sets the path to use for plug-ins (used by the parser)
13 aramv 890 -# get_pdl_path(void): returns the path read from the config file or empty string if none was parsed
14     -# add_policy(record_t*, rule_t*): adds a new policy
15     -# add_rule(record_t*, record_t*, record_t*): adds a new rule
16     -# remove_policy(record_t* policy): removes a policy
17     -# add_variable(record_t* name, record_t* value): adds a variable (plug-in) to the list
18     -# allow_rules(int):
19     -# allowed_policy_rule(const char* label):
20    
21     -# concat_strings(record_t*, record_t*): concatenates two strings
22     -# concat_strings_with_space(record_t*, record_t*): concatenates two strings separated by a space
23     */
24    
25 aramv 530 #ifndef PDL_H
26     #define PDL_H
27 aramv 1142
28 aramv 874 #if HAVE_CONFIG_H
29     #include "config.h"
30     #endif
31 aramv 594 #if HAVE_STDIO_H
32     #include <stdio.h>
33     #endif
34     #if HAVE_STDLIB_H
35     #include <stdlib.h>
36     #endif
37 aramv 878 #include "plugin_manager.h"
38 aramv 1154 #include "eef_polytypes.h"
39 aramv 810 #include "eef_log.h"
40 aramv 530
41     #define TRUE 1
42 aramv 1074 #define FALSE 0
43 aramv 530
44 aramv 874 /* lifecycle functions */
45 aramv 1156 EES_RC pdl_init(const char* config_file_name);
46 aramv 1123 EES_RC pdl_term(void);
47 aramv 1156 EES_RC add_prepared_plugins(void);
48 aramv 1142
49 aramv 1158 policy_t* get_policies(void);
50     policy_t* reduce_policy_tree(policy_t* policies, int number_of_policies, char* names_of_policies[]);
51 aramv 1156 EES_RC link_rules_to_plugins(policy_t* policies);
52    
53 aramv 1123 EES_RC clean_variables_list(void);
54 aramv 1127 EES_RC clean_policies_list(void);
55     EES_RC clean_rules_list(rule_t*);
56 aramv 530
57 aramv 874 /* callback functions */
58 aramv 1142 void set_pdl_path(record_t*);
59 aramv 1123 void add_policy(record_t*, rule_t*);
60     rule_t * add_rule(record_t*, record_t*, record_t*);
61     const char * get_pdl_path(void);
62     void remove_policy(record_t* policy);
63 aramv 1158 void remove_policy_by_name(char* policy);
64 aramv 1123 void add_variable(record_t* name, record_t* value);
65     EES_RC allow_rules(int);
66     EES_RC allowed_policy_rule(const char* label);
67 aramv 874
68     /* convenience methods used by the lexer */
69 aramv 1123 record_t * concat_strings(record_t*, record_t*);
70     record_t * concat_strings_with_space(record_t*, record_t*);
71     char ** _var_to_argv(char*, int*);
72     var_t* get_variable_by_name(char*);
73 aramv 1154 rule_t* get_rule(rule_t* rule, const char* state);
74 aramv 1202 rule_t* get_left_hand_rule(rule_t* temp_rule, const char* name);
75 aramv 1123 rule_t* check_for_recursion(rule_t*, rule_t*);
76 aramv 1147 void free_args(int argc, char** argv);
77 aramv 874
78    
79     /* Lex/Yacc stuff */
80 aramv 1123 int yyerror(char*);
81     void set_yylval(record_t* r);
82 aramv 874
83 aramv 1123 /* debug functions */
84 aramv 1156 void print_policies(policy_t* policies);
85 aramv 1123
86 aramv 530 #endif

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