fixed some rekey collision issues
[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 typedef struct configuration_t configuration_t;
27
28 #include <library.h>
29
30 /**
31 * @brief The interface for various daemon related configs.
32 *
33 * @b Constructors:
34 * - configuration_create()
35 *
36 * @ingroup config
37 */
38 struct configuration_t {
39
40 /**
41 * @brief Returns the retransmit timeout.
42 *
43 * A return value of zero means the request should not be
44 * retransmitted again.
45 *
46 * @param this calling object
47 * @param retransmitted number of times a message was retransmitted so far
48 * @return time in milliseconds, when to do next retransmit
49 */
50 u_int32_t (*get_retransmit_timeout) (configuration_t *this,
51 u_int32_t retransmitted);
52
53 /**
54 * @brief Returns the timeout for an half open IKE_SA in ms.
55 *
56 * Half open means that the IKE_SA is still on a not established state
57 *
58 * @param this calling object
59 * @return timeout in milliseconds (ms)
60 */
61 u_int32_t (*get_half_open_ike_sa_timeout) (configuration_t *this);
62
63 /**
64 * @brief Returns the keepalive interval in s.
65 *
66 * The keepalive interval defines the idle time after which a
67 * NAT keepalive packet should be sent.
68 *
69 * @param this calling object
70 * @return interval in s
71 */
72 u_int32_t (*get_keepalive_interval) (configuration_t *this);
73
74 /**
75 * @brief Returns the interval to retry a failed action again.
76 *
77 * In some situations, the protocol may be in a state where processing
78 * is not possible and an action must be retried (e.g. rekeying).
79 *
80 * @param this calling object
81 * @return interval in s
82 */
83 u_int32_t (*get_retry_interval) (configuration_t *this);
84
85 /**
86 * @brief Destroys a configuration_t object.
87 *
88 * @param this calling object
89 */
90 void (*destroy) (configuration_t *this);
91 };
92
93 /**
94 * @brief Creates a configuration backend.
95 *
96 * @return static_configuration_t object
97 *
98 * @ingroup config
99 */
100 configuration_t *configuration_create(void);
101
102 #endif /*CONFIGURATION_H_*/