00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _PEP_H_
00026 #define _PEP_H_
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00071 #include <stdarg.h>
00072 #include "xacml.h"
00073 #include "profiles.h"
00074 #include "pip.h"
00075 #include "oh.h"
00076 #include "error.h"
00077
00078
00079
00107 #define PEP_LOGLEVEL_NONE -1
00108 #define PEP_LOGLEVEL_ERROR 0
00109 #define PEP_LOGLEVEL_WARN 1
00110 #define PEP_LOGLEVEL_INFO 2
00111 #define PEP_LOGLEVEL_DEBUG 3
00152 typedef int pep_log_handler_callback(int level, const char * format, va_list args);
00153
00166 typedef struct pep_handle PEP;
00167
00173 typedef enum pep_option {
00174 PEP_OPTION_LOG_LEVEL,
00175 PEP_OPTION_LOG_STDERR,
00176 PEP_OPTION_LOG_HANDLER,
00177 PEP_OPTION_ENDPOINT_URL,
00178 PEP_OPTION_ENDPOINT_SSL_VALIDATION,
00179 PEP_OPTION_ENDPOINT_SERVER_CERT,
00180 PEP_OPTION_ENDPOINT_SERVER_CAPATH,
00181 PEP_OPTION_ENDPOINT_CLIENT_CERT,
00182 PEP_OPTION_ENDPOINT_CLIENT_KEY,
00183 PEP_OPTION_ENDPOINT_CLIENT_KEYPASSWORD,
00184 PEP_OPTION_ENDPOINT_TIMEOUT,
00185 PEP_OPTION_ENABLE_PIPS,
00186 PEP_OPTION_ENABLE_OBLIGATIONHANDLERS,
00187 PEP_OPTION_ENDPOINT_SSL_CIPHER_LIST
00188 } pep_option_t;
00189
00194 const char * pep_version(void);
00195
00209 pep_error_t pep_global_init(void);
00210
00222 void pep_global_cleanup(void);
00223
00231 PEP * pep_initialize(void);
00232
00240 int pep_getid(PEP * pep);
00241
00253 pep_error_t pep_addpip(PEP * pep, const pep_pip_t * pip);
00254
00266 pep_error_t pep_addobligationhandler(PEP * pep, const pep_obligationhandler_t * oh);
00267
00325 pep_error_t pep_setoption(PEP * pep, pep_option_t option, ... );
00326
00343 pep_error_t pep_authorize(PEP * pep, xacml_request_t ** request, xacml_response_t ** response);
00344
00352 void pep_destroy(PEP * pep);
00353
00360 #ifdef __cplusplus
00361 }
00362 #endif
00363
00364 #endif