2 * @file configuration_manager.h
4 * @brief Manages all configuration aspects of the daemon.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
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>.
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
23 #ifndef CONFIGURATION_MANAGER_H_
24 #define CONFIGURATION_MANAGER_H_
27 #include <config/init_config.h>
28 #include <config/sa_config.h>
31 typedef struct configuration_manager_t configuration_manager_t
;
34 * @brief Manages all configuration aspects of the daemon.
39 struct configuration_manager_t
{
42 * Get the configuration information needed for IKE_SA_INIT exchange
43 * for a specific configuration name.
45 * The returned init_config_t object MUST NOT be destroyed cause it's the original one.
47 * @param this calling object
48 * @param name name of the configuration
49 * @param[out] init_config the configuration is stored at this place
55 status_t (*get_init_config_for_name
) (configuration_manager_t
*this, char *name
, init_config_t
**init_config
);
58 * Get the configuration information needed for IKE_SA_INIT exchange
59 * for specific host informations.
61 * The returned init_config_t object MUST NOT be destroyed cause it's the original one.
63 * @param this calling object
64 * @param my_host my host informations
65 * @param other_host other host informations
66 * @param[out] init_config the configuration is stored at this place
72 status_t (*get_init_config_for_host
) (configuration_manager_t
*this, host_t
*my_host
, host_t
*other_host
,init_config_t
**init_config
);
75 * Get the configuration information needed after IKE_SA_INIT exchange.
77 * The returned sa_config_t object MUST not be destroyed cause it's the original one.
79 * @param this calling object
80 * @param name name of the configuration
81 * @param[out] sa_config the configuration is stored at this place
87 status_t (*get_sa_config_for_name
) (configuration_manager_t
*this, char *name
, sa_config_t
**sa_config
);
90 * Get the configuration information needed after IKE_SA_INIT exchange
91 * for specific init_config_t and ID data.
93 * The returned sa_config_t object MUST NOT be destroyed cause it's the original one.
95 * @param this calling object
96 * @param init_config init_config_t object
97 * @param other_id identification of other one
98 * @param my_id my identification (can be NULL)
99 * @param[out] sa_config the configuration is stored at this place
105 status_t (*get_sa_config_for_init_config_and_id
) (configuration_manager_t
*this, init_config_t
*init_config
, identification_t
*other_id
, identification_t
*my_id
,sa_config_t
**sa_config
);
108 * Get the retransmit timeout.
110 * The timeout values are managed by the configuration manager.
112 * @param this calling object
113 * @param retransmit_count number of times a message was allready retransmitted
114 * @param[out] timeout the new retransmit timeout in milliseconds
117 * - FAILED if the message should not be resent again
120 status_t (*get_retransmit_timeout
) (configuration_manager_t
*this, u_int32_t retransmit_count
, u_int32_t
*timeout
);
123 * Destroys configuration manager
126 * @param this calling object
130 void (*destroy
) (configuration_manager_t
*this);
134 * Creates the mighty configuration manager
136 * @param first_retransmit_timeout first retransmit timeout in milliseconds
137 * @param max_retransmit_count max number of retransmitted requests (0 for infinite)
139 * - pointer to created manager object if succeeded
140 * - NULL if memory allocation failed
144 configuration_manager_t
*configuration_manager_create(u_int32_t first_retransmit_timeout
,u_int32_t max_retransmit_count
);
146 #endif /*CONFIGURATION_MANAGER_H_*/