- new configuration support added to ike_sa and states
[strongswan.git] / Source / charon / config / configuration_manager.h
1 /**
2 * @file configuration_manager.h
3 *
4 * @brief Manages all configuration aspects of the daemon.
5 *
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, 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_MANAGER_H_
24 #define CONFIGURATION_MANAGER_H_
25
26 #include <types.h>
27 #include <config/init_config.h>
28 #include <config/sa_config.h>
29
30
31 typedef struct configuration_manager_t configuration_manager_t;
32
33 /**
34 * @brief Manages all configuration aspects of the daemon.
35 *
36 * @ingroup config
37 *
38 */
39 struct configuration_manager_t {
40
41 /**
42 * Gets the configuration information needed for IKE_SA_INIT exchange
43 * for a specific configuration name.
44 *
45 * The returned init_config_t object MUST NOT be destroyed cause it's the original one.
46 *
47 * @param this calling object
48 * @param name name of the configuration
49 * @param[out] init_config the configuration is stored at this place
50 *
51 * @return
52 * - NOT_FOUND
53 * - SUCCESS
54 */
55 status_t (*get_init_config_for_name) (configuration_manager_t *this, char *name, init_config_t **init_config);
56
57 /**
58 * Gets the configuration information needed for IKE_SA_INIT exchange
59 * for specific host informations.
60 *
61 * The returned init_config_t object MUST NOT be destroyed cause it's the original one.
62 *
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
67 *
68 * @return
69 * - NOT_FOUND
70 * - SUCCESS
71 */
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);
73
74 /**
75 * Gets the configuration information needed after IKE_SA_INIT exchange.
76 *
77 * The returned sa_config_t object MUST not be destroyed cause it's the original one.
78 *
79 * @param this calling object
80 * @param name name of the configuration
81 * @param[out] sa_config the configuration is stored at this place
82 *
83 * @return
84 * - NOT_FOUND
85 * - SUCCESS
86 */
87 status_t (*get_sa_config_for_name) (configuration_manager_t *this, char *name, sa_config_t **sa_config);
88
89 /**
90 * Gets the configuration information needed after IKE_SA_INIT exchange
91 * for specific init_config_t and ID data.
92 *
93 * The returned sa_config_t object MUST NOT be destroyed cause it's the original one.
94 *
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
100 *
101 * @return
102 * - NOT_FOUND
103 * - SUCCESS
104 */
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);
106
107 /**
108 * Destroys configuration manager
109 *
110 *
111 * @param this calling object
112 * @return
113 * - SUCCESS
114 */
115 void (*destroy) (configuration_manager_t *this);
116 };
117
118 /**
119 * Creates the mighty configuration manager
120 *
121 * @return
122 * - pointer to created manager object if succeeded
123 * - NULL if memory allocation failed
124 *
125 * @ingroup config
126 */
127 configuration_manager_t *configuration_manager_create();
128
129 #endif /*CONFIGURATION_MANAGER_H_*/