| 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 AMQP_FRAME_CODEC_H |
| 5 |
#define AMQP_FRAME_CODEC_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 |
#endif /* __cplusplus */ |
| 15 |
#include "azure_uamqp_c/frame_codec.h" |
| 16 |
|
| 17 |
#include "umock_c/umock_c_prod.h" |
| 18 |
|
| 19 |
#define AMQP_OPEN (uint64_t)0x10 |
| 20 |
#define AMQP_BEGIN (uint64_t)0x11 |
| 21 |
#define AMQP_ATTACH (uint64_t)0x12 |
| 22 |
#define AMQP_FLOW (uint64_t)0x13 |
| 23 |
#define AMQP_TRANSFER (uint64_t)0x14 |
| 24 |
#define AMQP_DISPOSITION (uint64_t)0x15 |
| 25 |
#define AMQP_DETACH (uint64_t)0x16 |
| 26 |
#define AMQP_END (uint64_t)0x17 |
| 27 |
#define AMQP_CLOSE (uint64_t)0x18 |
| 28 |
|
| 29 |
typedef struct AMQP_FRAME_CODEC_TAG* AMQP_FRAME_CODEC_HANDLE; |
| 30 |
typedef void(*AMQP_EMPTY_FRAME_RECEIVED_CALLBACK)(void* context, uint16_t channel); |
| 31 |
typedef void(*AMQP_FRAME_RECEIVED_CALLBACK)(void* context, uint16_t channel, AMQP_VALUE performative, const unsigned char* payload_bytes, uint32_t frame_payload_size); |
| 32 |
typedef void(*AMQP_FRAME_CODEC_ERROR_CALLBACK)(void* context); |
| 33 |
|
| 34 |
MOCKABLE_FUNCTION(, AMQP_FRAME_CODEC_HANDLE, amqp_frame_codec_create, FRAME_CODEC_HANDLE, frame_codec, AMQP_FRAME_RECEIVED_CALLBACK, frame_received_callback, AMQP_EMPTY_FRAME_RECEIVED_CALLBACK, empty_frame_received_callback, AMQP_FRAME_CODEC_ERROR_CALLBACK, amqp_frame_codec_error_callback, void*, callback_context); |
| 35 |
MOCKABLE_FUNCTION(, void, amqp_frame_codec_destroy, AMQP_FRAME_CODEC_HANDLE, amqp_frame_codec); |
| 36 |
MOCKABLE_FUNCTION(, int, amqp_frame_codec_encode_frame, AMQP_FRAME_CODEC_HANDLE, amqp_frame_codec, uint16_t, channel, AMQP_VALUE, performative, const PAYLOAD*, payloads, size_t, payload_count, ON_BYTES_ENCODED, on_bytes_encoded, void*, callback_context); |
| 37 |
MOCKABLE_FUNCTION(, int, amqp_frame_codec_encode_empty_frame, AMQP_FRAME_CODEC_HANDLE, amqp_frame_codec, uint16_t, channel, ON_BYTES_ENCODED, on_bytes_encoded, void*, callback_context); |
| 38 |
|
| 39 |
#ifdef __cplusplus |
| 40 |
} |
| 41 |
#endif /* __cplusplus */ |
| 42 |
|
| 43 |
#endif /* AMQP_FRAME_CODEC_H */ |