[457] | 1 | // Copyright (c) Microsoft. All rights reserved.
|
---|
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
---|
| 3 |
|
---|
| 4 | #ifndef PROV_TRANSPORT_AMQP_COMMON_H
|
---|
| 5 | #define PROV_TRANSPORT_AMQP_COMMON_H
|
---|
| 6 |
|
---|
| 7 | #ifdef __cplusplus
|
---|
| 8 | extern "C" {
|
---|
| 9 | #include <cstdint>
|
---|
| 10 | #include <cstddef>
|
---|
| 11 | #else
|
---|
| 12 | #include <stdint.h>
|
---|
| 13 | #include <stddef.h>
|
---|
| 14 | #include <stdbool.h>
|
---|
| 15 | #endif /* __cplusplus */
|
---|
| 16 |
|
---|
| 17 | #include "umock_c/umock_c_prod.h"
|
---|
| 18 | #include "azure_macro_utils/macro_utils.h"
|
---|
| 19 | #include "azure_prov_client/prov_transport.h"
|
---|
| 20 | #include "azure_prov_client/internal/prov_transport_private.h"
|
---|
| 21 | #include "azure_c_shared_utility/http_proxy_io.h"
|
---|
| 22 |
|
---|
| 23 | typedef XIO_HANDLE(*PROV_MQTT_TRANSPORT_IO)(const char* fully_qualified_name, const HTTP_PROXY_OPTIONS* proxy_info);
|
---|
| 24 |
|
---|
| 25 | MOCKABLE_FUNCTION(, PROV_DEVICE_TRANSPORT_HANDLE, prov_transport_common_mqtt_create, const char*, uri, TRANSPORT_HSM_TYPE, type, const char*, scope_id, const char*, api_version, PROV_MQTT_TRANSPORT_IO, transport_io, PROV_TRANSPORT_ERROR_CALLBACK, error_cb, void*, error_ctx);
|
---|
| 26 | MOCKABLE_FUNCTION(, void, prov_transport_common_mqtt_destroy, PROV_DEVICE_TRANSPORT_HANDLE, handle);
|
---|
| 27 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_open, PROV_DEVICE_TRANSPORT_HANDLE, handle, const char*, registration_id, BUFFER_HANDLE, ek, BUFFER_HANDLE, srk, PROV_DEVICE_TRANSPORT_REGISTER_CALLBACK, data_callback, void*, user_ctx, PROV_DEVICE_TRANSPORT_STATUS_CALLBACK, status_cb, void*, status_ctx, PROV_TRANSPORT_CHALLENGE_CALLBACK, reg_challenge_cb, void*, challenge_ctx);
|
---|
| 28 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_close, PROV_DEVICE_TRANSPORT_HANDLE, handle);
|
---|
| 29 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_register_device, PROV_DEVICE_TRANSPORT_HANDLE, handle, PROV_TRANSPORT_JSON_PARSE, json_parse_cb, PROV_TRANSPORT_CREATE_JSON_PAYLOAD, json_create_cb, void*, json_ctx);
|
---|
| 30 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_get_operation_status, PROV_DEVICE_TRANSPORT_HANDLE, handle);
|
---|
| 31 | MOCKABLE_FUNCTION(, void, prov_transport_common_mqtt_dowork, PROV_DEVICE_TRANSPORT_HANDLE, handle);
|
---|
| 32 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_set_trace, PROV_DEVICE_TRANSPORT_HANDLE, handle, bool, trace_on);
|
---|
| 33 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_set_proxy, PROV_DEVICE_TRANSPORT_HANDLE, handle, const HTTP_PROXY_OPTIONS*, proxy_options);
|
---|
| 34 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_set_trusted_cert, PROV_DEVICE_TRANSPORT_HANDLE, handle, const char*, certificate);
|
---|
| 35 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_x509_cert, PROV_DEVICE_TRANSPORT_HANDLE, handle, const char*, certificate, const char*, private_key);
|
---|
| 36 | MOCKABLE_FUNCTION(, int, prov_transport_common_mqtt_set_option, PROV_DEVICE_TRANSPORT_HANDLE, handle, const char*, option, const void*, value);
|
---|
| 37 |
|
---|
| 38 | #ifdef __cplusplus
|
---|
| 39 | }
|
---|
| 40 | #endif /* __cplusplus */
|
---|
| 41 |
|
---|
| 42 | #endif // PROV_TRANSPORT_AMQP_COMMON_H
|
---|