/[pdpsoft]/trunk/grid-mw-security/ees/src/app/main.c
ViewVC logotype

Annotation of /trunk/grid-mw-security/ees/src/app/main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1345 - (hide annotations) (download) (as text)
Thu Jan 7 16:38:30 2010 UTC (12 years, 4 months ago) by aramv
File MIME type: text/x-chdr
File size: 1222 byte(s)
Implemented redesigned AOS API - Removed references to older version
1 aramv 886 #include "config.h"
2 aramv 781 #include "eef.h"
3 aramv 502 #include "aos.h"
4 aramv 425
5 aramv 1224 #define NUMBER_OF_ALLOWED_POLICIES 0
6 aramv 1158
7 aramv 572 int main (int argc, char* argv[]){
8 aramv 1158 char* config_file;
9     char* names_of_allowed_policies[NUMBER_OF_ALLOWED_POLICIES] = {"world_domination", "trying_to_read_lcmaps_parser_code"};
10 aramv 1345 aos_context_t* context;
11     aos_attribute_t* attribute;
12 aramv 1158
13 aramv 1096 if(argc > 1){
14     config_file = argv[1];
15     } else {
16     config_file = "examples/example_1.pdl";
17     }
18 aramv 480
19 aramv 1211 printf("Parsing config file %s\n", config_file);
20 aramv 1158
21     if(EEF_Init(config_file, NULL, NUMBER_OF_ALLOWED_POLICIES, names_of_allowed_policies) == EES_FAILURE){
22 aramv 886 eef_log(LOG_ERR, "Failed to parse config file (%s), exiting...", config_file);
23 aramv 586 } else {
24 aramv 1070 /*eef_log(LOG_INFO, "Modules path: %s\n", get_modules_path());*/
25 aramv 1345 /*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 aramv 886 if(EEF_Run() == EES_FAILURE){
33 aramv 1131 eef_log(LOG_ERR, "Failed to load and initialize all plugins in config file (%s), exiting...", config_file);
34 aramv 886 }
35 aramv 586 }
36 aramv 844 EEF_Term();
37     return 0;
38 aramv 425 }

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