Common module interface header file. More...
Go to the source code of this file.
Data Structures | |
union | mcl_credentials_load_callback_t |
union | mcl_credentials_save_callback_t |
Macros | |
#define | MCL_FUNCTION_LEAVE_LABEL mcl_function_leave_label |
#define | MCL_FALSE ((mcl_bool_t) 0) |
#define | MCL_TRUE ((mcl_bool_t) 1) |
#define | MCL_SIZE_MAX ((mcl_size_t) - 1) |
#define | MCL_NULL ((void *) 0) |
#define | MCL_NULL_CHAR '\0' |
#define | MCL_NULL_CHAR_SIZE 1 |
#define | MCL_MAXIMUM_HTTP_PAYLOAD_SIZE (10485760) |
#define | MCL_NON_EXISTING_JSON_CHILD MCL_JSON_NON_EXISTING_CHILD |
#define | MCL_CORE_CODE_TO_STRING(code) (code < MCL_CORE_RETURN_CODE_END ? mcl_core_return_code_strings[code] : NULL) |
Typedefs | |
typedef size_t | mcl_size_t |
typedef int8_t | mcl_int8_t |
typedef int16_t | mcl_int16_t |
typedef int32_t | mcl_int32_t |
typedef int64_t | mcl_int64_t |
typedef uint8_t | mcl_uint8_t |
typedef uint16_t | mcl_uint16_t |
typedef uint32_t | mcl_uint32_t |
typedef uint64_t | mcl_uint64_t |
typedef mcl_uint8_t | mcl_bool_t |
typedef time_t | mcl_time_t |
typedef mcl_int32_t | mcl_error_t |
typedef mcl_error_t(* | mcl_credentials_load_shared_secret_callback_t) (char **client_id, char **client_secret, char **registration_access_token, char **registration_uri) |
typedef mcl_error_t(* | mcl_credentials_save_shared_secret_callback_t) (const char *client_id, const char *client_secret, const char *registration_access_token, const char *registration_uri) |
typedef 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) |
typedef 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) |
typedef mcl_error_t(* | mcl_critical_section_enter_callback_t) (void) |
typedef void(* | mcl_critical_section_leave_callback_t) (void) |
Variables | |
MCL_CORE_EXPORT const char * | mcl_core_return_code_strings [MCL_CORE_RETURN_CODE_END] |
Common module interface header file.
This module contains common type definitions used in various MCL modules.
Definition in file mcl_core_common.h.
#define MCL_CORE_CODE_TO_STRING | ( | code | ) | (code < MCL_CORE_RETURN_CODE_END ? mcl_core_return_code_strings[code] : NULL) |
Definition at line 162 of file mcl_core_common.h.
#define MCL_FALSE ((mcl_bool_t) 0) |
MCL bool definition for boolean value of false.
Definition at line 46 of file mcl_core_common.h.
Referenced by _is_empty_line(), _process_registration_response(), get_response(), json_util_get_bool_value(), json_util_has_child(), mcl_core_configuration_set_parameter(), mcl_core_is_onboarded(), mcl_core_onboard(), mcl_core_rotate_key(), mcl_file_util_check_if_regular_file(), mcl_http_client_initialize(), mcl_string_util_find(), mcl_string_util_find_case_insensitive(), security_rsa_sign(), send_with_callback(), string_util_find(), string_util_find_case_insensitive(), and string_util_memcmp().
#define MCL_FUNCTION_LEAVE_LABEL mcl_function_leave_label |
MCL function leave label.
Definition at line 41 of file mcl_core_common.h.
Referenced by mcl_core_configuration_initialize(), mcl_core_configuration_set_parameter(), mcl_core_get_access_token(), mcl_core_get_last_access_token(), mcl_core_get_last_token_time(), mcl_core_initialize(), mcl_core_onboard(), mcl_core_rotate_key(), mcl_core_update_credentials(), mcl_http_client_add_certificate(), mcl_http_client_initialize(), mcl_http_client_send(), mcl_http_request_add_header(), mcl_http_request_initialize(), mcl_http_request_set_parameter(), mcl_http_response_get_header(), mcl_http_response_get_status(), mcl_http_response_initialize(), mcl_json_util_add_bool(), mcl_json_util_add_double(), mcl_json_util_add_item_to_array(), mcl_json_util_add_null(), mcl_json_util_add_object(), mcl_json_util_add_string(), mcl_json_util_add_uint(), mcl_json_util_duplicate(), mcl_json_util_get_array_item(), mcl_json_util_get_array_size(), mcl_json_util_get_bool_value(), mcl_json_util_get_double_value(), mcl_json_util_get_number_value(), mcl_json_util_get_object_item(), mcl_json_util_get_string(), mcl_json_util_has_child(), mcl_json_util_initialize(), mcl_json_util_parse(), mcl_json_util_start_array(), mcl_json_util_start_object(), mcl_json_util_to_string(), mcl_list_add(), mcl_list_exist(), mcl_list_initialize(), mcl_list_next(), mcl_list_remove(), mcl_list_remove_with_content(), mcl_log_util_set_callback(), mcl_random_generate_bytes(), mcl_random_generate_guid(), mcl_string_util_reset(), mcl_string_util_strncmp(), mcl_tls_ca_chain_init(), mcl_tls_socket_init(), mcl_tls_socket_open(), and mcl_tls_socket_set_parameter().
#define MCL_MAXIMUM_HTTP_PAYLOAD_SIZE (10485760) |
Http request payload size limit for MindSphere.
Definition at line 66 of file mcl_core_common.h.
#define MCL_NON_EXISTING_JSON_CHILD MCL_JSON_NON_EXISTING_CHILD |
Definition at line 157 of file mcl_core_common.h.
#define MCL_NULL ((void *) 0) |
Definition at line 58 of file mcl_core_common.h.
Referenced by _add_jwks(), _add_number(), _add_schema_to_jwt(), _base64_encode_big_number(), _calculate_signature(), _certificate_list_destroy_callback(), _compose_access_token_request_payload(), _compose_rsa_key_rotation_json(), _compose_rsa_onboarding_json(), _create_self_issued_jwt_payload(), _decode_with_table(), _encode_with_table(), _generate_correlation_id_string(), _generate_token(), _get_rsa_private_key(), _get_rsa_public_key(), _join_with_dot(), _libcrypto_malloc(), _load_initial_credentials(), _process_registration_response(), _process_registration_response_rsa_3072(), _process_registration_response_shared_secret(), _response_header_callback(), _response_payload_callback(), _save_credentials(), _set_payload_options(), _set_request_options(), _ssl_context_callback(), core_configuration_log(), core_configuration_validate(), core_processor_destroy(), core_processor_get_access_token(), core_processor_initialize(), core_processor_register(), core_processor_update_credentials(), get_chunked_response(), get_content_length_response(), get_response(), hmac_sha256(), json_util_add_bool(), json_util_add_null(), json_util_add_object(), json_util_add_string(), json_util_destroy(), json_util_duplicate(), json_util_get_array_item(), json_util_get_object_item(), json_util_get_string(), json_util_has_child(), json_util_initialize(), json_util_parse(), json_util_start_array(), json_util_start_object(), json_util_to_string(), jwt_destroy(), jwt_get_token(), jwt_initialize(), mcl_core_configuration_destroy(), mcl_core_configuration_initialize(), mcl_core_configuration_set_parameter(), mcl_core_destroy(), mcl_core_get_client_id(), mcl_core_get_host_name(), mcl_core_get_http_client(), mcl_core_get_last_access_token(), mcl_core_get_last_token_time(), mcl_core_initialize(), mcl_core_is_onboarded(), mcl_core_onboard(), mcl_core_rotate_key(), mcl_core_update_credentials(), mcl_file_util_fclose_without_log(), mcl_file_util_fgets(), mcl_file_util_fopen_without_log(), mcl_file_util_rewind(), mcl_http_client_add_certificate(), mcl_http_client_destroy(), mcl_http_client_initialize(), mcl_http_client_send(), mcl_http_request_add_header(), mcl_http_request_destroy(), mcl_http_request_initialize(), mcl_http_request_set_parameter(), mcl_http_response_destroy(), mcl_http_response_get_header(), mcl_http_response_initialize(), mcl_json_util_duplicate(), mcl_list_add(), mcl_list_destroy(), mcl_list_destroy_with_content(), mcl_list_exist(), mcl_list_initialize(), mcl_list_next(), mcl_list_remove(), mcl_list_remove_with_content(), mcl_list_reset(), mcl_string_util_concatenate(), mcl_string_util_find(), mcl_string_util_find_case_insensitive(), mcl_string_util_memset(), mcl_string_util_strdup(), mcl_string_util_strlen(), mcl_string_util_strnlen(), mcl_time_util_convert_to_iso_8601_format(), mcl_time_util_validate_timestamp(), mcl_tls_socket_connect(), mcl_tls_socket_destroy(), mcl_tls_socket_init(), mcl_tls_socket_set_parameter(), random_generate_guid(), security_generate_rsa_key(), security_handler_destroy(), security_handler_initialize(), security_hash_sha256(), security_initialize(), security_rsa_get_modulus_and_exponent(), security_rsa_sign(), send_header_list(), start_http(), string_util_concatenate(), string_util_reset(), and string_util_strdup().
#define MCL_NULL_CHAR '\0' |
Definition at line 60 of file mcl_core_common.h.
Referenced by _decode_with_table(), _encode_with_table(), _get_rsa_private_key(), _get_rsa_public_key(), _response_header_callback(), get_response(), mcl_time_util_convert_to_iso_8601_format(), receive_until_lf(), start_http(), and string_util_strnlen().
#define MCL_NULL_CHAR_SIZE 1 |
Definition at line 61 of file mcl_core_common.h.
Referenced by _decode_with_table(), _encode_with_table(), _generate_correlation_id_string(), _join_with_dot(), core_processor_register(), get_response(), json_util_get_string(), mcl_core_configuration_set_parameter(), mcl_http_client_initialize(), mcl_time_util_convert_to_iso_8601_format(), mcl_time_util_validate_timestamp(), mcl_tls_ca_chain_add_certificate(), mcl_tls_socket_init(), receive_until_lf(), send_header(), start_http(), string_util_concatenate(), and string_util_strdup().
#define MCL_SIZE_MAX ((mcl_size_t) - 1) |
Definition at line 55 of file mcl_core_common.h.
Referenced by mcl_list_add().
#define MCL_TRUE ((mcl_bool_t) 1) |
MCL bool definition for boolean value of true.
Definition at line 51 of file mcl_core_common.h.
Referenced by _is_empty_line(), _process_registration_response(), _response_header_callback(), _ssl_context_callback(), core_processor_update_credentials(), get_response(), json_util_duplicate(), json_util_get_bool_value(), json_util_has_child(), mcl_core_configuration_set_parameter(), mcl_core_get_access_token(), mcl_core_get_client_id(), mcl_core_get_last_access_token(), mcl_core_is_onboarded(), mcl_core_update_credentials(), mcl_http_client_add_certificate(), mcl_http_client_initialize(), mcl_http_response_get_header(), mcl_time_util_validate_timestamp(), mcl_tls_ca_chain_add_certificate(), security_initialize(), security_rsa_sign(), send_with_callback(), string_util_find(), string_util_find_case_insensitive(), and string_util_memcmp().
typedef mcl_uint8_t mcl_bool_t |
Definition at line 34 of file mcl_core_common.h.
typedef 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) |
This is a callback function prototype to load credentials for RSA security profile.
[out] | client_id | Client ID. |
[out] | public_key | Public key. |
[out] | private_key | Private key. |
[out] | registration_access_token | Registration access token. |
[out] | registration_uri | Registration URI. |
Definition at line 211 of file mcl_core_common.h.
typedef mcl_error_t(* mcl_credentials_load_shared_secret_callback_t) (char **client_id, char **client_secret, char **registration_access_token, char **registration_uri) |
This is a callback function prototype to load credentials for Shared Secret security profile.
[out] | client_id | Client ID. |
[out] | client_secret | Client secret. |
[out] | registration_access_token | Registration access token. |
[out] | registration_uri | Registration URI. |
Definition at line 178 of file mcl_core_common.h.
typedef 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) |
This is a callback function prototype to save credentials for RSA security profile.
[in] | client_id | Client ID. |
[in] | public_key | Public key. |
[in] | private_key | Private key. |
[in] | registration_access_token | Registration access token. |
[in] | registration_uri | Registration URI. |
Definition at line 227 of file mcl_core_common.h.
typedef mcl_error_t(* mcl_credentials_save_shared_secret_callback_t) (const char *client_id, const char *client_secret, const char *registration_access_token, const char *registration_uri) |
This is a callback function prototype to save credentials for Shared Secret security profile.
[in] | client_id | Client ID. |
[in] | client_secret | Client secret. |
[in] | registration_access_token | Registration access token. |
[in] | registration_uri | Registration URI. |
Definition at line 194 of file mcl_core_common.h.
typedef mcl_error_t(* mcl_critical_section_enter_callback_t) (void) |
This is a callback function prototype to enter critical section (onboarding, key rotation, updating security information).
Definition at line 258 of file mcl_core_common.h.
typedef void(* mcl_critical_section_leave_callback_t) (void) |
This is a callback function prototype to leave critical section (onboarding, key rotation, updating security information).
Definition at line 265 of file mcl_core_common.h.
typedef mcl_int32_t mcl_error_t |
Definition at line 36 of file mcl_core_common.h.
typedef int16_t mcl_int16_t |
Definition at line 27 of file mcl_core_common.h.
typedef int32_t mcl_int32_t |
Definition at line 28 of file mcl_core_common.h.
typedef int64_t mcl_int64_t |
Definition at line 29 of file mcl_core_common.h.
typedef int8_t mcl_int8_t |
Definition at line 26 of file mcl_core_common.h.
typedef size_t mcl_size_t |
Definition at line 25 of file mcl_core_common.h.
typedef time_t mcl_time_t |
Definition at line 35 of file mcl_core_common.h.
typedef uint16_t mcl_uint16_t |
Definition at line 31 of file mcl_core_common.h.
typedef uint32_t mcl_uint32_t |
Definition at line 32 of file mcl_core_common.h.
typedef uint64_t mcl_uint64_t |
Definition at line 33 of file mcl_core_common.h.
typedef uint8_t mcl_uint8_t |
Definition at line 30 of file mcl_core_common.h.
MCL core return code definitions. Every function in core component returning a status code uses this enum values.
Enumerator | |
---|---|
MCL_OK |
Success. |
MCL_FAIL |
Internal failure in MCL. |
MCL_TRIGGERED_WITH_NULL |
Received parameter is null. |
MCL_OUT_OF_MEMORY |
Memory allocation fail. |
MCL_INVALID_PARAMETER |
General invalid parameter fail. |
MCL_INVALID_LOG_LEVEL |
Given log level is invalid. |
MCL_NO_SERVER_TIME |
Server time is not received from the server. |
MCL_NO_ACCESS_TOKEN_EXISTS |
No access token exists in mcl_core_t handle. |
MCL_NO_ACCESS_TOKEN_PROVIDED |
Neither initial access token nor loading/saving credentials callback functions are provided. |
MCL_NO_FILE_SUPPORT |
The system does not support file handling. |
MCL_OPERATION_NOT_SUPPORTED |
Requested operation is not supported. |
MCL_COULD_NOT_RESOLVE_PROXY |
Proxy host name given as a configuration parameter could not be resolved. |
MCL_COULD_NOT_RESOLVE_HOST |
Host name given as a configuration parameter could not be resolved. |
MCL_COULD_NOT_CONNECT |
MCL failed to connect to the host or proxy. |
MCL_SSL_HANDSHAKE_FAIL |
A problem occured during SSL/TLS handshake. |
MCL_NETWORK_SEND_FAIL |
A problem occured when sending data to the network. |
MCL_NETWORK_RECEIVE_FAIL |
A problem occured when receiving data from the network. |
MCL_SERVER_CERTIFICATE_NOT_VERIFIED |
Mindsphere certificate was not verified. |
MCL_IMPROPER_CERTIFICATE |
The server certificate provided is in improper format and it can not be parsed. |
MCL_REQUEST_TIMEOUT |
The server did not respond within a timeout period. |
MCL_SERVER_FAIL |
Internal server error. |
MCL_CREATED |
If the response of server is HTTP 201. |
MCL_PARTIAL_CONTENT |
If the response of server is HTTP 206. |
MCL_BAD_REQUEST |
If the response of server is HTTP 400. |
MCL_UNAUTHORIZED |
If the response of server is HTTP 401. |
MCL_FORBIDDEN |
If the response of server is HTTP 403. |
MCL_NOT_FOUND |
If the response of server is HTTP 404. |
MCL_CONFLICT |
If the response of server is HTTP 409. |
MCL_PRECONDITION_FAIL |
If the response of server is HTTP 412. |
MCL_REQUEST_PAYLOAD_TOO_LARGE |
If the response of server is HTTP 413. |
MCL_TOO_MANY_REQUESTS |
If the response of server is HTTP 429. |
MCL_UNEXPECTED_RESULT_CODE |
If the response of server is unexpected. |
MCL_NOT_ONBOARDED |
Agent is not onboarded to the server yet and does not possess an authentication key. |
MCL_ALREADY_ONBOARDED |
Agent is already onboarded to the server, hence the library did not try to onboard again. |
MCL_EXCHANGE_STREAMING_IS_ACTIVE |
The streaming is active and shouldn't be interrupted. |
MCL_CREDENTIALS_UP_TO_DATE |
Credentials of the mcl_core are already up to date. |
MCL_CANNOT_ENTER_CRITICAL_SECTION |
If agent cannot enter critical section. |
MCL_BAD_CONTENT_ENCODING |
If given content for Base64 encoding is bad. |
MCL_JSON_NON_EXISTING_CHILD |
Json child which we try to get doesn't exist in the parent Json object. |
MCL_JSON_NAME_DUPLICATION |
The same name can not be added in the same level of json object. |
MCL_JSON_TYPE_MISMATCH |
Type of the value of the json object does not match the type requested. |
MCL_SHA256_CALCULATION_FAIL |
If SHA256 calculation fails. |
MCL_CREDENTIALS_NOT_SAVED |
Credentials are not saved. |
MCL_CREDENTIALS_NOT_LOADED |
Credentials are not loaded. |
MCL_LIST_IS_EMPTY |
There is no element in the list. |
MCL_LIMIT_EXCEEDED |
No more space is left to add an additional object. |
MCL_CORE_RETURN_CODE_END |
End of return codes. |
Definition at line 96 of file mcl_core_common.h.
enum E_MCL_PROXY |
Proxy type definitions.
Definition at line 71 of file mcl_core_common.h.
Definitions of different security profiles for onboarding.
Enumerator | |
---|---|
MCL_SECURITY_SHARED_SECRET |
Shared secret. |
MCL_SECURITY_RSA_3072 |
RSA 3072. |
MCL_SECURITY_PROFILE_END |
End of security profile codes. |
Definition at line 86 of file mcl_core_common.h.
MCL_CORE_EXPORT const char* mcl_core_return_code_strings[MCL_CORE_RETURN_CODE_END] |
Definition at line 11 of file core_common.c.
Referenced by jwt_get_token().