Argus PEP client API  2.3
pep.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Members of the EGEE Collaboration. 2006-2010.
3  * See http://www.eu-egee.org/partners/ for details on the copyright holders.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /*
19  * Argus PEP client API
20  *
21  * $Id$
22  * @author Valery Tschopp <valery.tschopp@switch.ch>
23  * @version 2.1
24  */
25 #ifndef _PEP_H_
26 #define _PEP_H_
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
71 #include <stdarg.h> /* va_list */
72 #include "xacml.h"
73 #include "profiles.h"
74 #include "pip.h"
75 #include "oh.h"
76 #include "error.h"
77 
78 
79 
107 #define PEP_LOGLEVEL_NONE -1
108 #define PEP_LOGLEVEL_ERROR 0
109 #define PEP_LOGLEVEL_WARN 1
110 #define PEP_LOGLEVEL_INFO 2
111 #define PEP_LOGLEVEL_DEBUG 3
152 typedef int pep_log_handler_callback(int level, const char * format, va_list args);
153 
166 typedef struct pep_handle PEP;
167 
173 typedef enum pep_option {
188 } pep_option_t;
189 
194 const char * pep_version(void);
195 
210 
222 void pep_global_cleanup(void);
223 
231 PEP * pep_initialize(void);
232 
240 int pep_getid(PEP * pep);
241 
253 pep_error_t pep_addpip(PEP * pep, const pep_pip_t * pip);
254 
267 
325 pep_error_t pep_setoption(PEP * pep, pep_option_t option, ... );
326 
343 pep_error_t pep_authorize(PEP * pep, xacml_request_t ** request, xacml_response_t ** response);
344 
352 void pep_destroy(PEP * pep);
353 
360 #ifdef __cplusplus
361 }
362 #endif
363 
364 #endif
void pep_global_cleanup(void)
NOT THREAD SAFE.
pep_error_t pep_authorize(PEP *pep, xacml_request_t **request, xacml_response_t **response)
Sends the XACML request to the PEP daemon and returns the XACML response.
void pep_destroy(PEP *pep)
Cleanups and destroys the PEP client.
Obligation Handler type.
Definition: oh.h:83
int pep_getid(PEP *pep)
Returns the id of the PEP handle.
enum pep_option pep_option_t
PEP client configuration options.
const char * pep_version(void)
Returns a human readable string with the version number of the PEP client API and some of its importa...
Enable PIPs pre-processing: 0 or 1 (default 1)
Definition: pep.h:185
pep_error_t pep_global_init(void)
NOT THREAD SAFE.
Set the mandatory PEP daemon endpoint URL.
Definition: pep.h:177
PIP type.
Definition: pip.h:81
pep_error_t pep_addpip(PEP *pep, const pep_pip_t *pip)
Adds a PIP request pre-processor to the PEP client.
pep_error_t pep_setoption(PEP *pep, pep_option_t option,...)
Sets a PEP client configuration option.
PEP daemon server SSL certificate (PEM format): absolute filename.
Definition: pep.h:179
Timeout for the connection to endpoint URL in second (default 30s)
Definition: pep.h:184
pep_error_t pep_addobligationhandler(PEP *pep, const pep_obligationhandler_t *oh)
Adds an Obligation Handler post-processor to the PEP client.
struct pep_handle PEP
PEP client handle.
Definition: pep.h:166
PEP client SSL certificate (PEM format) for client authN: absolute filename.
Definition: pep.h:181
Set log engine file descriptor: stderr, stdout, NULL (default NULL)
Definition: pep.h:175
Enable SSL validation: 0 or 1 (default 1)
Definition: pep.h:178
PEP * pep_initialize(void)
Creates and initializes a new PEP client handle.
PEP client list of ciphers to use for the SSL connection: string.
Definition: pep.h:187
struct xacml_request xacml_request_t
PEP XACML Request type.
Definition: xacml.h:413
Directory holding CA certificates (hashed filenames in PEM format) to verify the PEP daemon: absolute...
Definition: pep.h:180
Set log level (default PEP_LOGLEVEL_NONE)
Definition: pep.h:174
Enable OHs post-processing: 0 or 1 (default 1)
Definition: pep.h:186
PEP client SSL private key password for client authN: string.
Definition: pep.h:183
pep_error_t
PEP client error codes.
Definition: error.h:59
Set the optional log handler callback function pointer (default NULL)
Definition: pep.h:176
pep_option
PEP client configuration options.
Definition: pep.h:173
PEP client SSL private key (PEM format) for client authN: absolute filename.
Definition: pep.h:182
struct xacml_response xacml_response_t
PEP XACML Response type.
Definition: xacml.h:904