1 |
#include "config.h" |
2 |
#include "eef.h" |
3 |
#include "aos.h" |
4 |
|
5 |
#define NUMBER_OF_ALLOWED_POLICIES 0 |
6 |
|
7 |
int main (int argc, char* argv[]){ |
8 |
char* config_file; |
9 |
char* names_of_allowed_policies[NUMBER_OF_ALLOWED_POLICIES] = {"world_domination", "trying_to_read_lcmaps_parser_code"}; |
10 |
aos_context_t* context; |
11 |
aos_attribute_t* attribute; |
12 |
|
13 |
if(argc > 1){ |
14 |
config_file = argv[1]; |
15 |
} else { |
16 |
config_file = "examples/example_1.pdl"; |
17 |
} |
18 |
|
19 |
printf("Parsing config file %s\n", config_file); |
20 |
|
21 |
if(EEF_Init(config_file, NULL, NUMBER_OF_ALLOWED_POLICIES, names_of_allowed_policies) == EES_FAILURE){ |
22 |
eef_log(LOG_ERR, "Failed to parse config file (%s), exiting...", config_file); |
23 |
} else { |
24 |
/*eef_log(LOG_INFO, "Modules path: %s\n", get_modules_path());*/ |
25 |
/*setObligation("test", "foobar");*/ |
26 |
context = createContext(OBLIGATION); |
27 |
addContext(context); |
28 |
attribute = createAttribute(); |
29 |
setAttributeId(attribute, "my_pemstring"); |
30 |
setAttributeValue(attribute, "test", strlen("test")); |
31 |
addAttribute(context, attribute); |
32 |
if(EEF_Run() == EES_FAILURE){ |
33 |
eef_log(LOG_ERR, "Failed to load and initialize all plugins in config file (%s), exiting...", config_file); |
34 |
} |
35 |
} |
36 |
EEF_Term(); |
37 |
return 0; |
38 |
} |