- applied patch from andreas, which allows certificate listing via stroke
[strongswan.git] / src / charon / config / configuration.h
1 /**
2 * @file configuration.h
3 *
4 * @brief Interface configuration_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #ifndef CONFIGURATION_H_
24 #define CONFIGURATION_H_
25
26 #include <types.h>
27
28
29 typedef struct configuration_t configuration_t;
30
31 /**
32 * @brief The interface for various daemon related configs.
33 *
34 * @b Constructors:
35 * - configuration_create()
36 *
37 * @ingroup config
38 */
39 struct configuration_t {
40
41 /**
42 * @brief Returns the retransmit timeout.
43 *
44 * The timeout values are managed by the configuration, so
45 * another backoff algorithm may be implemented here.
46 *
47 * @param this calling object
48 * @param retransmit_count number of times a message was retransmitted so far
49 * @param[out] timeout the new retransmit timeout in milliseconds
50 *
51 * @return
52 * - FAILED, if the message should not be retransmitted
53 * - SUCCESS
54 */
55 status_t (*get_retransmit_timeout) (configuration_t *this, u_int32_t retransmit_count, u_int32_t *timeout);
56
57 /**
58 * @brief Returns the timeout for an half open IKE_SA in ms.
59 *
60 * Half open means that the IKE_SA is still in one of the following states:
61 * - INITIATOR_INIT
62 * - RESPONDER_INIT
63 * - IKE_SA_INIT_REQUESTED
64 * - IKE_SA_INIT_RESPONDED
65 * - IKE_AUTH_REQUESTED
66 *
67 * @param this calling object
68 * @return timeout in milliseconds (ms)
69 */
70 u_int32_t (*get_half_open_ike_sa_timeout) (configuration_t *this);
71
72 /**
73 * @brief Destroys a configuration_t object.
74 *
75 * @param this calling object
76 */
77 void (*destroy) (configuration_t *this);
78 };
79
80 /**
81 * @brief Creates a configuration backend.
82 *
83 * @return static_configuration_t object
84 *
85 * @ingroup config
86 */
87 configuration_t *configuration_create(void);
88
89 #endif /*CONFIGURATION_H_*/