diff options
Diffstat (limited to 'Source/charon/config/configuration_manager.h')
-rw-r--r-- | Source/charon/config/configuration_manager.h | 143 |
1 files changed, 39 insertions, 104 deletions
diff --git a/Source/charon/config/configuration_manager.h b/Source/charon/config/configuration_manager.h index 787286a1d..9cc6a313b 100644 --- a/Source/charon/config/configuration_manager.h +++ b/Source/charon/config/configuration_manager.h @@ -24,12 +24,8 @@ #define CONFIGURATION_MANAGER_H_ #include <types.h> -#include <utils/linked_list.h> -#include <network/host.h> -#include <encoding/payloads/transform_substructure.h> -#include <transforms/prfs/prf.h> -#include <transforms/signers/signer.h> -#include <transforms/crypters/crypter.h> +#include <config/init_config.h> +#include <config/sa_config.h> typedef struct configuration_manager_t configuration_manager_t; @@ -37,138 +33,77 @@ typedef struct configuration_manager_t configuration_manager_t; /** * @brief Manages all configuration aspects of the daemon. * - * Currently the configuration manager class does not store specific configurations. - * It is expected, that in future different configurations are stored in a linked list - * or a hash map and are managed by this class. - * * @ingroup config * */ struct configuration_manager_t { - + /** - * Gets the remote host information for a specific configuration name. + * Gets the configuration information needed for IKE_SA_INIT exchange + * for a specific configuration name. * - * A host information consist of IP address and UDP port. + * The returned init_config_t object MUST NOT be destroyed cause it's the original one. * - * @param this calling object - * @param name name of the configuration - * @param host remote host information gets stored at this location + * @param this calling object + * @param name name of the configuration + * @param[out] init_config the configuration is stored at this place * * @return * - NOT_FOUND * - SUCCESS */ - status_t (*get_remote_host) (configuration_manager_t *this, char *name, host_t **host); + status_t (*get_init_config_for_name) (configuration_manager_t *this, char *name, init_config_t **init_config); /** - * Gets the local host information for a specific configuration name + * Gets the configuration information needed for IKE_SA_INIT exchange + * for specific host informations. * - * A host information consist of IP address and UDP port. + * The returned init_config_t object MUST NOT be destroyed cause it's the original one. * - * @param this calling object - * @param name name of the configuration - * @param host local host information gets stored at this location + * @param this calling object + * @param my_host my host informations + * @param other_host other host informations + * @param[out] init_config the configuration is stored at this place * * @return - * - NOT_FOUND (not yet implemented) + * - NOT_FOUND * - SUCCESS - */ - status_t (*get_local_host) (configuration_manager_t *this, char *name, host_t **host); + */ + status_t (*get_init_config_for_host) (configuration_manager_t *this, host_t *my_host, host_t *other_host,init_config_t **init_config); /** - * Returns the DH group number to use when initiating a connection. - * - * To make sure that different group numbers are supported in case - * a group number is not supported by other peer, a priority has to get defined. + * Gets the configuration information needed after IKE_SA_INIT exchange. * + * The returned sa_config_t object MUST not be destroyed cause it's the original one. * * @param this calling object * @param name name of the configuration - * @param dh_group_number the DH group number gets stored at this location - * @param priority priority to use for selection of DH group number. - * Highest priority is 1. All higher values have lower - * priority. + * @param[out] sa_config the configuration is stored at this place * * @return - * - FAILED (not yet implemented) - * - NOT_FOUND (not yet implemented) - * - SUCCESS - */ - status_t (*get_dh_group_number) (configuration_manager_t *this, char *name, u_int16_t *dh_group_number, u_int16_t priority); - - /** - * Returns the proposals which should be used to initiate a connection with a specific - * host. - * - * The proposals of type proposal_substructure_t * are returned over the given iterator - * and have to be destroyed by the caller. - * - * - * @param this calling object - * @param host host information used to find the correct proposals - * @param list iterator where the proposals are written to - * - * @return - * - NOT_FOUND (not yet implemented) - * - SUCCESS - */ - status_t (*get_proposals_for_host) (configuration_manager_t *this, host_t *host, iterator_t *list); - - /** - * Checks the suggested proposals passed as iterator in and selects one proposal to be sent as selection - * of this proposals. - * - * Currently there is no check implemented. The first suggested proposal is cloned and then as selected returned. - * - * - * @param this calling object - * @param host host information used to find the correct proposals - * @param in iterator with suggested proposals of type proposal_substructure_t * - * @param out The selected proposals of type proposal_substructure_t * are written to this iterator - * - * @return - * - FAILED - * - NOT_FOUND (not yet implemented) - * - SUCCESS - */ - status_t (*select_proposals_for_host) (configuration_manager_t *this, host_t *host, iterator_t *in, iterator_t *out); - - /** - * Checks if the selected proposals of a remote hosts are valid. - * - * - * @param this calling object - * @param host host information - * @param proposals iterator with selected proposals - * @param[out] valid TRUE if selected proposals are accepted - * - * @return - * - FAILED - * - NOT_FOUND (not yet implemented) - * - SUCCESS + * - NOT_FOUND + * - SUCCESS */ - status_t (*check_selected_proposals_for_host) (configuration_manager_t *this, - host_t *host, - iterator_t *proposals, - bool *valid); + status_t (*get_sa_config_for_name) (configuration_manager_t *this, char *name, sa_config_t **sa_config); /** - * Checks if a given dh_group number is allowed for a specific host + * Gets the configuration information needed after IKE_SA_INIT exchange + * for specific init_config_t and ID data. * + * The returned sa_config_t object MUST NOT be destroyed cause it's the original one. * * @param this calling object - * @param host host information - * @param group DH group number to check if allowed - * @param[out] allowed will be set to TRUE if group number is allowed, FALSE otherwise + * @param init_config init_config_t object + * @param other_id identification of other one + * @param my_id my identification (can be NULL) + * @param[out] sa_config the configuration is stored at this place * * @return - * - FAILED - * - NOT_FOUND (not yet implemented) - * - SUCCESS - */ - status_t (*is_dh_group_allowed_for_host) (configuration_manager_t *this, host_t *host, diffie_hellman_group_t group, bool *allowed); - + * - NOT_FOUND + * - SUCCESS + */ + 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); + /** * Destroys configuration manager * @@ -177,7 +112,7 @@ struct configuration_manager_t { * @return * - SUCCESS */ - status_t (*destroy) (configuration_manager_t *this); + void (*destroy) (configuration_manager_t *this); }; /** |