Common module interface header file. More...
Go to the source code of this file.
Data Structures | |
union | mcl_load_registration_information_callback_t |
union | mcl_save_registration_information_callback_t |
Macros | |
#define | MCL_LOG_UTIL_LEVEL_VERBOSE 1 |
#define | MCL_LOG_UTIL_LEVEL_DEBUG 2 |
#define | MCL_LOG_UTIL_LEVEL_INFO 3 |
#define | MCL_LOG_UTIL_LEVEL_WARN 4 |
#define | MCL_LOG_UTIL_LEVEL_ERROR 5 |
#define | MCL_LOG_UTIL_LEVEL_FATAL 6 |
#define | MCL_LOG_UTIL_LEVEL_NONE 0xFF |
#define | MCL_FALSE ((mcl_bool_t)0) |
MCL bool type. More... | |
#define | MCL_TRUE ((mcl_bool_t)1) |
#define | MCL_MAXIMUM_HTTP_PAYLOAD_SIZE (10485760) |
Http request payload size limit for MindSphere. More... | |
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 E_MCL_ERROR_CODE(* | mcl_load_shared_secret_callback_t) (char **client_id, char **client_secret, char **registration_access_token, char **registration_uri) |
Callback function prototype to load registration information for Shared Secret security profile. More... | |
typedef E_MCL_ERROR_CODE(* | mcl_save_shared_secret_callback_t) (const char *client_id, const char *client_secret, const char *registration_access_token, const char *registration_uri) |
Callback function prototype to save registration information for Shared Secret security profile. More... | |
typedef E_MCL_ERROR_CODE(* | mcl_load_rsa_callback_t) (char **client_id, char **public_key, char **private_key, char **registration_access_token, char **registration_uri) |
Callback function prototype to load registration information for RSA security profile. More... | |
typedef E_MCL_ERROR_CODE(* | mcl_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) |
Callback function prototype to save registration information for RSA security profile. More... | |
typedef E_MCL_ERROR_CODE(* | mcl_enter_critical_section_callback_t) (void) |
Callback function prototype to enter critical section (onboarding, key rotation, updating security information). More... | |
typedef void(* | mcl_leave_critical_section_callback_t) (void) |
Callback function prototype to leave critical section (onboarding, key rotation, updating security information). More... | |
Common module interface header file.
Definition in file mcl_common.h.
#define MCL_FALSE ((mcl_bool_t)0) |
MCL bool type.
Definition at line 53 of file mcl_common.h.
Referenced by _add_data_source_configuration_data_points(), _add_data_source_configuration_data_sources(), _add_event(), _add_item_meta_details(), _add_item_meta_payload_details(), _exchange_evaluate_response(), _exchange_fill_http_request(), _get_payload_from_file(), _is_empty_line(), _is_positive_integer(), _join_with_dot(), file_util_check_if_regular_file(), http_client_initialize(), http_request_add_raw_data(), http_request_add_single(), http_request_add_tuple(), http_request_end_tuple_sub_section(), http_request_initialize(), http_request_start_tuple(), http_request_start_tuple_sub_section(), json_util_get_bool_value(), json_util_has_child(), mcl_communication_initialize(), mcl_communication_is_onboarded(), mcl_data_source_configuration_add_data_point(), mcl_data_source_configuration_add_data_source(), mcl_store_initialize(), security_rsa_sign(), string_array_add(), string_array_initialize(), string_util_find(), string_util_find_case_insensitive(), and string_util_memcmp().
#define MCL_LOG_UTIL_LEVEL_DEBUG 2 |
Definition at line 31 of file mcl_common.h.
#define MCL_LOG_UTIL_LEVEL_ERROR 5 |
Definition at line 34 of file mcl_common.h.
#define MCL_LOG_UTIL_LEVEL_FATAL 6 |
Definition at line 35 of file mcl_common.h.
#define MCL_LOG_UTIL_LEVEL_INFO 3 |
Definition at line 32 of file mcl_common.h.
#define MCL_LOG_UTIL_LEVEL_NONE 0xFF |
Definition at line 36 of file mcl_common.h.
#define MCL_LOG_UTIL_LEVEL_VERBOSE 1 |
Definition at line 30 of file mcl_common.h.
#define MCL_LOG_UTIL_LEVEL_WARN 4 |
Definition at line 33 of file mcl_common.h.
#define MCL_MAXIMUM_HTTP_PAYLOAD_SIZE (10485760) |
Http request payload size limit for MindSphere.
Definition at line 59 of file mcl_common.h.
Referenced by mcl_communication_initialize().
#define MCL_TRUE ((mcl_bool_t)1) |
Definition at line 54 of file mcl_common.h.
Referenced by _add_authentication_header_to_request(), _add_data_source_configuration_data_points(), _add_data_source_configuration_data_sources(), _add_event(), _add_item_meta_details(), _add_item_meta_payload_details(), _exchange_evaluate_response(), _exchange_fill_http_request(), _exchange_update_store_data_state(), _is_empty_line(), _is_positive_integer(), _process_registration_response_rsa_3072(), _resize_payload_buffer_if_necessary(), _response_header_callback(), file_initialize(), http_client_initialize(), http_processor_exchange(), http_processor_get_access_token(), http_processor_stream(), http_processor_update_security_information(), http_request_add_header(), http_request_finalize(), http_response_get_header(), json_from_item_meta(), json_util_get_array_item(), json_util_get_bool_value(), json_util_has_child(), mcl_communication_exchange(), mcl_communication_get_access_token(), mcl_communication_initialize(), mcl_communication_is_onboarded(), mcl_communication_process(), mcl_custom_data_set_meta_details(), mcl_data_source_configuration_add_data_point(), mcl_data_source_configuration_add_data_source(), mcl_event_set_option(), mcl_store_new_data_source_configuration(), mcl_store_new_event(), mcl_store_new_file(), mcl_store_new_stream_data(), mcl_store_new_time_series(), string_array_destroy(), string_replace(), string_util_find(), string_util_find_case_insensitive(), and string_util_memcmp().
typedef mcl_uint8_t mcl_bool_t |
Definition at line 47 of file mcl_common.h.
typedef E_MCL_ERROR_CODE(* mcl_enter_critical_section_callback_t) (void) |
Callback function prototype to enter critical section (onboarding, key rotation, updating security information).
Definition at line 319 of file mcl_common.h.
typedef int16_t mcl_int16_t |
Definition at line 40 of file mcl_common.h.
typedef int32_t mcl_int32_t |
Definition at line 41 of file mcl_common.h.
typedef int64_t mcl_int64_t |
Definition at line 42 of file mcl_common.h.
typedef int8_t mcl_int8_t |
Definition at line 39 of file mcl_common.h.
typedef void(* mcl_leave_critical_section_callback_t) (void) |
Callback function prototype to leave critical section (onboarding, key rotation, updating security information).
Definition at line 326 of file mcl_common.h.
typedef E_MCL_ERROR_CODE(* mcl_load_rsa_callback_t) (char **client_id, char **public_key, char **private_key, char **registration_access_token, char **registration_uri) |
Callback function prototype to load registration information 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 272 of file mcl_common.h.
typedef E_MCL_ERROR_CODE(* mcl_load_shared_secret_callback_t) (char **client_id, char **client_secret, char **registration_access_token, char **registration_uri) |
Callback function prototype to load registration information 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 239 of file mcl_common.h.
typedef E_MCL_ERROR_CODE(* mcl_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) |
Callback function prototype to save registration information 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 288 of file mcl_common.h.
typedef E_MCL_ERROR_CODE(* mcl_save_shared_secret_callback_t) (const char *client_id, const char *client_secret, const char *registration_access_token, const char *registration_uri) |
Callback function prototype to save registration information 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 255 of file mcl_common.h.
typedef size_t mcl_size_t |
Definition at line 38 of file mcl_common.h.
typedef time_t mcl_time_t |
Definition at line 48 of file mcl_common.h.
typedef uint16_t mcl_uint16_t |
Definition at line 44 of file mcl_common.h.
typedef uint32_t mcl_uint32_t |
Definition at line 45 of file mcl_common.h.
typedef uint64_t mcl_uint64_t |
Definition at line 46 of file mcl_common.h.
typedef uint8_t mcl_uint8_t |
Definition at line 43 of file mcl_common.h.
Configuration types used in connection to the mindsphere.
Definition at line 87 of file mcl_common.h.
enum E_MCL_ERROR_CODE |
MCL Error code definitions. Every function returning an error 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_NO_FILE_SUPPORT | The system does not support file handling. |
MCL_NO_STORAGE_MEDIUM | The system does not have a storage medium. |
MCL_INVALID_LOG_LEVEL | Given log level is invalid. |
MCL_OPERATION_IS_NOT_SUPPORTED | If a particular operation is not supported. |
MCL_FILE_CANNOT_BE_OPENED | File can not be opened. |
MCL_JSON_NAME_DUPLICATION | The same name can not be added in the same level of json object. |
MCL_INDEX_OUT_OF_RANGE | If provided index is greater than collection size. |
MCL_ITEM_ALREADY_EXISTS | Occurs when same item is tried to be added to a collection of unique items. |
MCL_INVALID_EVENT_SEVERITY_LEVEL | Event severity 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_communication_t handle. |
MCL_INVALID_HOST_NAME | Host name given as a configuration parameter is either NULL or of inappropriate size. |
MCL_INVALID_CERTIFICATE | MindSphere certificate given as a configuration parameter is either NULL or of inappropriate size. |
MCL_INVALID_PROXY_HOST_NAME | MindSphere proxy host name given as a configuration parameter is either NULL or of inappropriate size. |
MCL_INVALID_PROXY_USER_NAME | MindSphere proxy user name given as a configuration parameter is either NULL or of inappropriate size. |
MCL_INVALID_PROXY_PASSWORD | MindSphere proxy password given as a configuration parameter is either NULL or of inappropriate size. |
MCL_INVALID_PROXY_DOMAIN | MindSphere proxy domain given as a configuration parameter is either NULL or of inappropriate size. |
MCL_INVALID_SECURITY_PROFILE | Security profile given as a configuration parameter is invalid. Please check the security profile options. |
MCL_INVALID_USER_AGENT | User-Agent for every HTTP request given as configuration parameter is either NULL or longer than 32 characters. |
MCL_INVALID_TENANT | Tenant for JWT is NULL. |
MCL_INVALID_MAX_HTTP_PAYLOAD_SIZE | Max HTTP payload size for every HTTP request given as configuration parameter is inappropriate size. |
MCL_NO_ACCESS_TOKEN_PROVIDED | Neither initial access token - initial registration URI pair nor the store path with registration information is provided. |
MCL_PATH_NOT_ACCESSIBLE | File provided in store path parameter in configuration structure is not accessible. |
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_INITIALIZED | MCL is not initialized, mcl_communication_initialize() function must be called first. |
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_STORE_IS_EMPTY | The store trying to be exchanged has no data inside. |
MCL_EXCHANGE_STREAMING_IS_ACTIVE | The streaming is active and shouldn't be interrupted. |
MCL_SECURITY_UP_TO_DATE | Security information of the mcl_communication is already up to date. |
MCL_CANNOT_ENTER_CRITICAL_SECTION | If agent cannot enter critical section. |
MCL_INITIALIZATION_FAIL | Initialization of MCL fails. |
MCL_STORE_ITEM_EXCEEDS_MAX_HTTP_REQUEST_SIZE | Store which is not streamable has an item that does not fit in a single http request. |
MCL_UNDEFINED_ENDPOINT | Unexpected endpoint type is received by the function to create a URI. |
MCL_BAD_CONTENT_ENCODING | If given content for Base64 encoding is bad. |
MCL_NON_EXISTING_JSON_CHILD | Json child which we try to get doesn't exist in the parent Json object. |
MCL_SHA256_CALCULATION_FAIL | If SHA256 calculation fails. |
MCL_SERVER_PROOF_FAIL | Server proof received with the server nonce mismatch. |
MCL_REGISTRATION_INFO_IS_NOT_SAVED | Registration information is not saved. |
MCL_REGISTRATION_INFO_IS_NOT_LOADED | Registration information is not loaded. |
MCL_BUFFER_OVERFLOW_ERROR | Indicates that a provided buffer does not have enough size for the operation. |
MCL_HTTP_REQUEST_NO_MORE_SPACE | There is no more space left in http message buffer. No data has been written in current call. |
MCL_LIMIT_EXCEEDED | No more space is left to add an additional object. |
MCL_ARRAY_IS_EMPTY | There is no element in the array. |
MCL_PARTIALLY_WRITTEN | Part of the data in store is written to the http request. There is still data left needs to be written. |
MCL_HTTP_REQUEST_FINALIZE_FAILED | Adding final closing boundary and Authentication header is failed. |
MCL_ERROR_CODE_END | End of error codes. |
Definition at line 137 of file mcl_common.h.
enum E_MCL_EVENT_OPTION |
Optional parameters for event.
Enumerator | |
---|---|
MCL_EVENT_OPTION_CORRELATION_ID | Correlation id option. |
MCL_EVENT_OPTION_DESCRIPTION | Description option. |
MCL_EVENT_OPTION_DETAILS | Details option. |
Definition at line 125 of file mcl_common.h.
enum E_MCL_EVENT_SEVERITY |
Severity values for events.
Definition at line 114 of file mcl_common.h.
enum E_MCL_PROXY |
Proxy type definitions. Used inside of mcl_configuration_t.
Definition at line 64 of file mcl_common.h.
Definitions of different security profiles for onboarding.
Enumerator | |
---|---|
MCL_SECURITY_SHARED_SECRET | Shared secret. |
MCL_SECURITY_RSA_3072 | RSA 3072. |
Definition at line 78 of file mcl_common.h.
enum E_MCL_SOURCE_TYPE |
Source type values for mcl entities.
Enumerator | |
---|---|
MCL_SOURCE_TYPE_ASSET | Source type is asset. |
MCL_SOURCE_TYPE_APPLICATION | Source type is application. |
MCL_SOURCE_TYPE_AGENT | Source type is agent. |
Definition at line 104 of file mcl_common.h.