/[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 1569 - (show annotations) (download) (as text)
Tue Mar 16 17:35:17 2010 UTC (11 years, 10 months ago) by aramv
File MIME type: text/x-csrc
File size: 5801 byte(s)
Re-added AOS cleaning, so reduced memory leaks by quite a bit
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 "eef_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 typedef struct aos_attribute_s {
152 char * id; /*! a label to identify the data */
153 char * issuer; /*! a string to identify the issuer */
154 char * type; /*! a type identifier */
155 int needs_free; /*! a flag that determines wheter the data should be free'd */
156 void* data; /*! a pointer to store the data */
157 struct aos_attribute_s * parent; /*! a pointer to the 'parent' object */
158 struct aos_attribute_s * child; /*! a pointer to the 'child' object */
159 struct aos_attribute_s * next; /*! a pointer to the next node */
160 eef_plugindl_t * setting_plugin; /*! a pointer to the plugin that initialized this data */
161 } aos_attribute_t;
162
163 typedef enum aos_context_class_e {
164 SUBJECT,
165 ACTION,
166 RESOURCE,
167 ENVIRONMENT,
168 NONE,
169 ANY,
170 OBLIGATION
171 } aos_context_class_t;
172
173 typedef struct aos_context_s {
174 aos_attribute_t * list_attributes;
175 aos_attribute_t * last_attribute;
176 aos_context_class_t context_class;
177 char* obligation_name;
178 struct aos_context_s * next;
179 } aos_context_t;
180
181 typedef struct aos_storage_s {
182 aos_context_t * list_contexts;
183 aos_context_t * last_context;
184 } aos_storage_t;
185
186
187 #endif

Properties

Name Value
svn:mergeinfo

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