17 #define USER_AGENT_HEADER_FORMAT "MCL/" MCL_VERSION_STRING " (%s)" 23 MCL_DEBUG_ENTRY(
"mcl_core_configuration_t **configuration = <%p>", configuration);
31 (*configuration)->mindsphere_hostname =
MCL_NULL;
32 (*configuration)->mindsphere_port = 0;
33 (*configuration)->mindsphere_certificate =
MCL_NULL;
34 (*configuration)->proxy_hostname =
MCL_NULL;
35 (*configuration)->proxy_port = 0;
37 (*configuration)->proxy_username =
MCL_NULL;
38 (*configuration)->proxy_password =
MCL_NULL;
39 (*configuration)->proxy_domain =
MCL_NULL;
42 (*configuration)->user_agent =
MCL_NULL;
43 (*configuration)->initial_access_token =
MCL_NULL;
45 (*configuration)->credentials_load_callback.rsa =
MCL_NULL;
46 (*configuration)->credentials_save_callback.rsa =
MCL_NULL;
47 (*configuration)->critical_section_enter_callback =
MCL_NULL;
48 (*configuration)->critical_section_leave_callback =
MCL_NULL;
49 (*configuration)->register_endpoint =
MCL_NULL;
50 (*configuration)->token_endpoint =
MCL_NULL;
62 MCL_DEBUG_ENTRY(
"mcl_core_configuration_t *configuration = <%p>, E_MCL_CORE_CONFIGURATION_PARAMETER parameter = <%d>, const void *value = <%p>",
63 configuration, parameter, value);
77 configuration->mindsphere_port = *((
mcl_uint16_t *) value);
82 configuration->certificate_is_file =
MCL_FALSE;
88 configuration->certificate_is_file =
MCL_TRUE;
98 "Invalid proxy type value.");
136 configuration->http_request_timeout = *((
mcl_uint32_t *) value);
143 MCL_FREE(configuration->user_agent);
145 configuration->user_agent =
MCL_MALLOC(user_agent_length + 1);
147 if (
MCL_NULL != configuration->user_agent)
153 MCL_FREE(configuration->user_agent);
206 MCL_DEBUG_ENTRY(
"core_configuration_t *configuration = <%p>", configuration);
255 MCL_DEBUG_ENTRY(
"mcl_core_configuration_t **configuration = <%p>", configuration);
260 MCL_FREE((*configuration)->mindsphere_hostname);
261 MCL_FREE((*configuration)->mindsphere_certificate);
262 MCL_FREE((*configuration)->proxy_hostname);
263 MCL_FREE((*configuration)->proxy_username);
264 MCL_FREE((*configuration)->proxy_password);
265 MCL_FREE((*configuration)->proxy_domain);
266 MCL_FREE((*configuration)->user_agent);
267 MCL_FREE((*configuration)->initial_access_token);
269 MCL_FREE((*configuration)->register_endpoint);
270 MCL_FREE((*configuration)->token_endpoint);
279 MCL_DEBUG_ENTRY(
"core_configuration_t *configuration = <%p>", configuration);
287 MCL_INFO(
"Mindsphere Certificate: Provided.");
291 MCL_INFO(
"Mindsphere Certificate: Not provided.");
302 MCL_INFO(
"Proxy Type: MCL_PROXY_HTTP.");
306 MCL_INFO(
"Proxy Type: MCL_PROXY_HTTP_1_0.");
310 MCL_INFO(
"Proxy Type: MCL_PROXY_SOCKS4.");
314 MCL_INFO(
"Proxy Type: MCL_PROXY_SOCKS5.");
318 MCL_INFO(
"Proxy Type: MCL_PROXY_SOCKS4A.");
322 MCL_INFO(
"Proxy Type: MCL_PROXY_SOCKS5_HOSTNAME.");
326 MCL_INFO(
"Proxy Type: MCL_PROXY_UNKNOWN.");
348 MCL_INFO(
"Security Profile: MCL_SECURITY_SHARED_SECRET.");
353 MCL_INFO(
"Security Profile: MCL_SECURITY_RSA_3072.");
361 MCL_INFO(
"Initial Access Token: Provided.");
365 MCL_INFO(
"Initial Access Token: Not provided.");
372 MCL_INFO(
"Security Information: Callback functions will be used.");
376 MCL_INFO(
"Security Information: Will not be saved.");
381 MCL_INFO(
"Critical Section: Callback functions are provided.");
385 MCL_INFO(
"Critical Section: Callback functions are not provided.");
mcl_error_t(* mcl_critical_section_enter_callback_t)(void)
mcl_credentials_save_rsa_callback_t rsa
Callback type to save RSA key.
#define MCL_FUNCTION_LEAVE_LABEL
Mindsphere port parameter as mcl_uint16_t.
Custom function for entering critical section parameter as mcl_critical_section_enter_callback_t (opt...
char * proxy_hostname
Proxy hostname. Optional.
void core_configuration_log(core_configuration_t *configuration)
mcl_size_t string_util_strnlen(const char *buffer, mcl_size_t maximum_length)
Assert module header file.
The system does not support file handling.
mcl_uint16_t proxy_port
Proxy port number. Mandatory if proxy host name is set, ineffective otherwise.
#define DEFAULT_HTTP_REQUEST_TIMEOUT
Custom function for loading credentials parameter as mcl_credentials_load_callback_t.
MCL_CORE_EXPORT mcl_error_t mcl_string_util_reset(const void *value, char **target)
void mcl_core_configuration_destroy(mcl_core_configuration_t **configuration)
mcl_uint16_t mindsphere_port
Mindsphere port number.
mcl_credentials_load_callback_t credentials_load_callback
Custom function for loading credentials. If both credentials_load_callback and credentials_save_callb...
Proxy port number parameter as mcl_uint16_t. Mandatory if proxy host name is set, ineffective otherwi...
#define MCL_DEBUG_ENTRY(...)
Security profile parameter as E_MCL_SECURITY_PROFILE.
Custom function for leaving critical section parameter as mcl_critical_section_leave_callback_t (opti...
mcl_credentials_save_callback_t credentials_save_callback
Custom function for saving credentials. If both credentials_load_callback and credentials_save_callba...
End of security profile codes.
#define USER_AGENT_HEADER_FORMAT
String utility module header file.
MCL_CORE_EXPORT mcl_size_t mcl_string_util_strlen(const char *buffer)
mcl_credentials_load_rsa_callback_t rsa
Callback type to load RSA key.
E_MCL_CORE_CONFIGURATION_PARAMETER
mcl_error_t core_configuration_validate(core_configuration_t *configuration)
Tenant parameter as char*.
#define MCL_ASSERT_CODE_MESSAGE(condition, return_code,...)
char * tenant
Tenant name.
struct mcl_core_configuration_t mcl_core_configuration_t
char * user_agent
User agent.
HTTP request timeout (in seconds) parameter as mcl_uint32_t. Default timeout is 300 seconds...
void(* mcl_critical_section_leave_callback_t)(void)
E_MCL_SECURITY_PROFILE security_profile
Security profile E_MCL_SECURITY_PROFILE.
mcl_uint32_t http_request_timeout
Timeout value (in seconds) for HTTP requests. Default timeout is 300 seconds.
Initial access token parameter as char*.
Definitions module header file.
Proxy host name parameter as char* (optional).
Core configuration module header file.
mcl_error_t mcl_core_configuration_set_parameter(mcl_core_configuration_t *configuration, E_MCL_CORE_CONFIGURATION_PARAMETER parameter, const void *value)
#define MAXIMUM_HOST_NAME_LENGTH
char * proxy_username
Proxy username. Optional if proxy host name is set, ineffective otherwise.
#define MCL_ASSERT_NOT_NULL(argument, return_variable)
E_MCL_PROXY proxy_type
Proxy type E_MCL_PROXY. Mandatory if proxy host name is set, ineffective otherwise.
Proxy domain parameter as char*. Optional if proxy host name and proxy username are set...
MCL_CORE_EXPORT mcl_error_t mcl_string_util_snprintf(char *string, mcl_size_t length, const char *format,...)
#define MCL_ASSERT_CODE(condition, return_code)
mcl_critical_section_leave_callback_t critical_section_leave_callback
Custom function for leaving critical section (optional, default is NULL).
This is an obsolete parameter. Setting it will have no effect.
char * proxy_domain
Proxy domain. Optional if proxy host name and proxy username are set, ineffective otherwise...
Custom function for saving credentials parameter as mcl_credentials_save_callback_t.
#define MAXIMUM_PROXY_DOMAIN_LENGTH
mcl_error_t mcl_core_configuration_initialize(mcl_core_configuration_t **configuration)
String utility module interface header file.
#define MCL_VERSION_STRING
Mindsphere certificate file parameter as char*. If certificate is not set (as itself or as file)...
mcl_error_t(* mcl_credentials_save_rsa_callback_t)(const char *client_id, const char *public_key, const char *private_key, const char *registration_access_token, const char *registration_uri)
Proxy password parameter as char*. Mandatory if proxy host name and proxy username are set...
#define MCL_NULL_CHAR_SIZE
#define MAXIMUM_PROXY_PASSWORD_LENGTH
Mindsphere hostname parameter as char*.
#define MCL_MALLOC(bytes)
char * initial_access_token
Initial access token.
General invalid parameter fail.
User agent parameter as char*.
#define MCL_DEBUG_LEAVE(...)
char * mindsphere_certificate
Mindsphere certificate. Optional. If NULL, MCL will use default CA certificate store (if provided at ...
Mindsphere certificate parameter as char*. If certificate is not set (as itself or as file)...
Proxy type parameter as E_MCL_PROXY. Mandatory if proxy host name is set, ineffective otherwise...
#define MAXIMUM_USER_AGENT_LENGTH
#define MAXIMUM_PROXY_USER_NAME_LENGTH
char * proxy_password
Proxy password. Mandatory if proxy host name and proxy username are set, ineffective otherwise...
Proxy username parameter as char*. Optional if proxy host name is set, ineffective otherwise...
mcl_critical_section_enter_callback_t critical_section_enter_callback
Custom function for entering critical section (optional, default is NULL).
char * mindsphere_hostname
Mindsphere hostname.
mcl_error_t(* mcl_credentials_load_rsa_callback_t)(char **client_id, char **public_key, char **private_key, char **registration_access_token, char **registration_uri)
Core configuration module interface header file.
Memory module interface header file.