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 * Gets 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 * Gets 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 * Gets 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 * Gets 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 * Destroys configuration manager
111 * @param this calling object
115 void (*destroy
) (configuration_manager_t
*this);
119 * Creates the mighty configuration manager
122 * - pointer to created manager object if succeeded
123 * - NULL if memory allocation failed
127 configuration_manager_t
*configuration_manager_create();
129 #endif /*CONFIGURATION_MANAGER_H_*/