/[pdpsoft]/trunk/grid-mw-security/ees/include/library/eef_polytypes.h
ViewVC logotype

Contents of /trunk/grid-mw-security/ees/include/library/eef_polytypes.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1345 - (show annotations) (download) (as text)
Thu Jan 7 16:38:30 2010 UTC (12 years ago) by aramv
File MIME type: text/x-csrc
File size: 6755 byte(s)
Implemented redesigned AOS API - Removed references to older version
1 /*!
2
3 \file eef_polytypes.h
4 \brief API of the EEF internal types
5 \author Aram Verstegen
6
7 */
8 #ifndef POLYTYPES_H
9 #define POLYTYPES_H
10 #if HAVE_CONFIG_H
11 #include "config.h"
12 #endif
13 #if HAVE_STDDEF_H
14 #include <stddef.h>
15 #endif
16 #if HAVE_WCHAR_H
17 #include <wchar.h>
18 #endif
19 #if HAVE_STDIO_H
20 #include <stdio.h>
21 #endif
22 #if HAVE_LINUX_LIMITS_H
23 #include <linux/limits.h>
24 #else
25 #if HAVE_SYS_PARAM_H
26 /* most bsd's */
27 #include <sys/param.h>
28 #endif
29 #endif
30
31 #define MAXPROCS 5
32 #define LCMAPS_MAXARGSTRING 2000
33
34 /* Function pointer type */
35 typedef void *eef_proc_t;
36
37 /*! Identifiers for linked process symbols */
38 typedef enum eef_proctype_e {
39 INITPROC, /*!< this value corresponds to the plugin initialization function */
40 RUNPROC, /*!< this value corresponds to the plugin run function (get credentials) */
41 TERMPROC, /*!< this value corresponds to the plugin termination function */
42 INTROPROC, /*!< this value corresponds to the plugin introspect function */
43 VERIFYPROC, /*!< this value corresponds to the plugin verification function */
44 ENDOFPROCS /*< this is the last enumeration value */
45 } eef_proctype_t;
46
47
48 /*! Argument types */
49 typedef enum {
50 TYPE_NONE,
51 TYPE_SCHAR,
52 TYPE_UCHAR,
53 TYPE_SHORT,
54 TYPE_USHORT,
55 TYPE_INT,
56 TYPE_UINT,
57 TYPE_LONGINT,
58 TYPE_ULONGINT,
59 #ifdef HAVE_LONG_LONG_INT
60 TYPE_LONGLONGINT,
61 TYPE_ULONGLONGINT,
62 #endif
63 TYPE_FLOAT,
64 TYPE_DOUBLE,
65 #ifdef HAVE_LONG_DOUBLE
66 TYPE_LONGDOUBLE,
67 #endif
68 TYPE_CHAR,
69 #ifdef HAVE_WINT_T
70 TYPE_WIDE_CHAR,
71 #endif
72 TYPE_STRING,
73 #ifdef HAVE_WCHAR_T
74 TYPE_WIDE_STRING,
75 #endif
76 TYPE_POINTER,
77 TYPE_COUNT_SCHAR_POINTER,
78 TYPE_COUNT_SHORT_POINTER,
79 TYPE_COUNT_INT_POINTER,
80 TYPE_COUNT_LONGINT_POINTER,
81 #ifdef HAVE_LONG_LONG_INT
82 TYPE_COUNT_LONGLONGINT_POINTER,
83 #endif
84 TYPE_PEM,
85 TYPE_X509,
86 TYPE_STACK_OF_X509,
87 TYPE_EVP_PKEY
88 } eef_arg_type;
89
90 /*!
91 * \brief Node structure to hold plugin nodes
92 */
93 typedef struct eef_plugindl_s
94 {
95 void * handle; /*!< dlopen handle to plugin module */
96 eef_proc_t procs[MAXPROCS]; /*!< list of handles to interface functions of plugin */
97 char name[FILENAME_MAX]; /*!< name of plugin */
98 char args[LCMAPS_MAXARGSTRING]; /*!< argument string */
99 int init_argc; /*!< number of arguments for the initialization function */
100 char * init_argv[ARG_MAX]; /*!< list of arguments for the initialization function */
101 struct eef_plugindl_s * next; /*!< pointer to the next plugin in the plugin list */
102 } eef_plugindl_t;
103
104
105 /* Policy parser types */
106
107 /*!
108 * \brief Structure for symbols used by the parser internally
109 */
110 typedef struct em_record_s {
111 char* string; /*!< Hold the symbol that lex has found. */
112 int lineno; /*!< Hold the line number the symbol has been found. */
113 } record_t;
114
115
116 /*!
117 * \brief Structure keeps track of the variables, their value and the line number they are defined on.
118 */
119 typedef struct em_var_s {
120 char* name; /*!< Name of the variable. */
121 char* value; /*!< Value of the variable. */
122 unsigned int lineno; /*!< Line number the variable appears on. */
123 struct em_var_s* next; /*!< Next variable, or 0 if none. */
124 } var_t;
125
126 /*!
127 * \brief Structure to make a tree of
128 *
129 */
130 typedef struct em_rule_s {
131 unsigned int lineno; /*!< Line number where rule appeared. */
132 char* state; /*!< Name of the state.*/
133 struct em_rule_s* true_branch; /*!< True branch or NULL if none */
134 struct em_rule_s* false_branch; /*!< False branch or NULL if none */
135 struct em_rule_s* next; /*!< Next rule, or NULL if none */
136 eef_plugindl_t* plugin;
137 } rule_t;
138
139 /*!
140 * \brief Structure to build a tree of plugins as defined in a policy in the config file
141 */
142 typedef struct em_policy_s {
143 char* name;
144 unsigned int lineno;
145 rule_t* rules;
146 int rules_list_transformed_to_tree;
147 struct em_policy_s* next;
148 } policy_t;
149
150
151 /* AOS Types */
152
153 /*!
154 * \brief Node structure to store AOS arguments
155 */
156 typedef struct aos_argument_s {
157 void* data; /*! a pointer to store the data */
158 int needs_free; /*! a flag that determines wheter the data should be free'd */
159 const char * label; /*! a label to identify the data */
160 eef_arg_type type; /*! a type identifier */
161 struct aos_argument_s * parent; /*! a pointer to the 'parent' object */
162 struct aos_argument_s * child; /*! a pointer to the 'child' object */
163 struct aos_argument_s * next; /*! a pointer to the next node */
164 eef_plugindl_t * setting_plugin; /*! a pointer to the plugin that initialized this data */
165 } aos_argument_t;
166
167 typedef struct aos_attribute_s {
168 char * id; /*! a label to identify the data */
169 char * issuer; /*! a string to identify the issuer */
170 char * type; /*! a type identifier */
171 int needs_free; /*! a flag that determines wheter the data should be free'd */
172 void* data; /*! a pointer to store the data */
173 struct aos_attribute_s * parent; /*! a pointer to the 'parent' object */
174 struct aos_attribute_s * child; /*! a pointer to the 'child' object */
175 struct aos_attribute_s * next; /*! a pointer to the next node */
176 eef_plugindl_t * setting_plugin; /*! a pointer to the plugin that initialized this data */
177 } aos_attribute_t;
178
179 typedef enum aos_context_class_e {
180 SUBJECT,
181 ACTION,
182 RESOURCE,
183 ENVIRONMENT,
184 NONE,
185 ANY,
186 OBLIGATION
187 } aos_context_class_t;
188
189 typedef struct aos_context_s {
190 aos_attribute_t * list_attributes;
191 aos_attribute_t * last_attribute;
192 aos_context_class_t context_class;
193 char* obligation_name;
194 struct aos_context_s * next;
195 } aos_context_t;
196
197 typedef struct aos_storage_s {
198 aos_context_t * list_contexts;
199 aos_context_t * last_context;
200 } aos_storage_t;
201
202
203 #endif

Properties

Name Value
svn:mergeinfo

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