Core configuration module implementation file. More...
#include "mcl_core/mcl_core_configuration.h"
#include "core_configuration.h"
#include "definitions.h"
#include "mcl_core/mcl_string_util.h"
#include "mcl_core/mcl_assert.h"
#include "mcl_core/mcl_memory.h"
#include "string_util.h"
Go to the source code of this file.
Macros | |
#define | USER_AGENT_HEADER_FORMAT "MCL/" MCL_VERSION_STRING " (%s)" |
Functions | |
mcl_error_t | mcl_core_configuration_initialize (mcl_core_configuration_t **configuration) |
mcl_error_t | mcl_core_configuration_set_parameter (mcl_core_configuration_t *configuration, E_MCL_CORE_CONFIGURATION_PARAMETER parameter, const void *value) |
mcl_error_t | core_configuration_validate (core_configuration_t *configuration) |
void | mcl_core_configuration_destroy (mcl_core_configuration_t **configuration) |
void | core_configuration_log (core_configuration_t *configuration) |
Core configuration module implementation file.
Definition in file core_configuration.c.
#define USER_AGENT_HEADER_FORMAT "MCL/" MCL_VERSION_STRING " (%s)" |
Definition at line 17 of file core_configuration.c.
Referenced by mcl_core_configuration_set_parameter().
void core_configuration_log | ( | core_configuration_t * | configuration | ) |
This function is used to log core configuration which is used to initialize core.
[in] | configuration | Core configuration to log. |
Definition at line 277 of file core_configuration.c.
References core_configuration_t::credentials_load_callback, core_configuration_t::credentials_save_callback, core_configuration_t::critical_section_enter_callback, core_configuration_t::critical_section_leave_callback, core_configuration_t::http_request_timeout, core_configuration_t::initial_access_token, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_INFO, MCL_NULL, MCL_PROXY_HTTP, MCL_PROXY_HTTP_1_0, MCL_PROXY_SOCKS4, MCL_PROXY_SOCKS4A, MCL_PROXY_SOCKS5, MCL_PROXY_SOCKS5_HOSTNAME, MCL_SECURITY_SHARED_SECRET, core_configuration_t::mindsphere_certificate, core_configuration_t::mindsphere_hostname, core_configuration_t::mindsphere_port, core_configuration_t::proxy_domain, core_configuration_t::proxy_hostname, core_configuration_t::proxy_password, core_configuration_t::proxy_port, core_configuration_t::proxy_type, core_configuration_t::proxy_username, mcl_credentials_load_callback_t::rsa, mcl_credentials_save_callback_t::rsa, core_configuration_t::security_profile, core_configuration_t::tenant, and core_configuration_t::user_agent.
Referenced by mcl_core_initialize().
mcl_error_t core_configuration_validate | ( | core_configuration_t * | configuration | ) |
This function checks whether all mandatory parameters of a core configuration are set or not.
[in] | configuration | Core configuration to validate. |
Definition at line 196 of file core_configuration.c.
References MAXIMUM_HOST_NAME_LENGTH, MAXIMUM_PROXY_DOMAIN_LENGTH, MAXIMUM_PROXY_PASSWORD_LENGTH, MAXIMUM_PROXY_USER_NAME_LENGTH, MAXIMUM_USER_AGENT_LENGTH, MCL_ASSERT_CODE, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_INVALID_PARAMETER, MCL_NULL, MCL_OK, core_configuration_t::mindsphere_hostname, core_configuration_t::proxy_domain, core_configuration_t::proxy_hostname, core_configuration_t::proxy_password, core_configuration_t::proxy_username, string_util_strnlen(), core_configuration_t::tenant, and core_configuration_t::user_agent.
Referenced by mcl_core_initialize().
void mcl_core_configuration_destroy | ( | mcl_core_configuration_t ** | configuration | ) |
This function destroys the mcl_core_configuration_t data structure.
[in] | configuration | Core configuration handle which is going to be destroyed. |
Definition at line 253 of file core_configuration.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, MCL_NULL, and MCL_OK.
mcl_error_t mcl_core_configuration_initialize | ( | mcl_core_configuration_t ** | configuration | ) |
This function initializes a new mcl_core_configuration_t data structure with default values.
[out] | configuration | Data structure holding the configuration parameters. |
configuration
is NULL. Definition at line 19 of file core_configuration.c.
References DEFAULT_HTTP_REQUEST_TIMEOUT, MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_PROXY_UNKNOWN, and MCL_SECURITY_SHARED_SECRET.
mcl_error_t mcl_core_configuration_set_parameter | ( | mcl_core_configuration_t * | configuration, |
E_MCL_CORE_CONFIGURATION_PARAMETER | parameter, | ||
const void * | value | ||
) |
This function is used to set a parameter of a core configuration.
[in] | configuration | Core configuration to set its parameter. |
[in] | parameter | One of the parameters listed in E_MCL_CORE_CONFIGURATION_PARAMETER. |
[in] | value | New value of the parameter . |
configuration
or value
is NULL. parameter
is invalid. Definition at line 57 of file core_configuration.c.
References MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_CORE_CONFIGURATION_PARAMETER_CERTIFICATE, MCL_CORE_CONFIGURATION_PARAMETER_CERTIFICATE_FILE, MCL_CORE_CONFIGURATION_PARAMETER_CREDENTIALS_LOAD_CALLBACK, MCL_CORE_CONFIGURATION_PARAMETER_CREDENTIALS_SAVE_CALLBACK, MCL_CORE_CONFIGURATION_PARAMETER_CRITICAL_SECTION_ENTER_CALLBACK, MCL_CORE_CONFIGURATION_PARAMETER_CRITICAL_SECTION_LEAVE_CALLBACK, MCL_CORE_CONFIGURATION_PARAMETER_HTTP_REQUEST_TIMEOUT, MCL_CORE_CONFIGURATION_PARAMETER_IAT, MCL_CORE_CONFIGURATION_PARAMETER_MAX_HTTP_PAYLOAD_SIZE, MCL_CORE_CONFIGURATION_PARAMETER_MDSP_HOST, MCL_CORE_CONFIGURATION_PARAMETER_MDSP_PORT, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_DOMAIN, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_HOST, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_PASS, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_PORT, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_TYPE, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_USER, MCL_CORE_CONFIGURATION_PARAMETER_SECURITY_PROFILE, MCL_CORE_CONFIGURATION_PARAMETER_TENANT, MCL_CORE_CONFIGURATION_PARAMETER_USER_AGENT, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FALSE, MCL_FREE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, MCL_MALLOC, MCL_NO_FILE_SUPPORT, MCL_NULL, MCL_NULL_CHAR_SIZE, MCL_OK, MCL_OUT_OF_MEMORY, MCL_PROXY_END, MCL_PROXY_HTTP, MCL_SECURITY_PROFILE_END, MCL_SECURITY_SHARED_SECRET, mcl_string_util_reset(), mcl_string_util_snprintf(), mcl_string_util_strlen(), MCL_TRUE, MCL_VERSION_STRING, and USER_AGENT_HEADER_FORMAT.