[388] | 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 UWS_FRAME_ENCODER_H
|
---|
| 5 | #define UWS_FRAME_ENCODER_H
|
---|
| 6 |
|
---|
| 7 | #include "azure_c_shared_utility/buffer_.h"
|
---|
| 8 | #include "azure_c_shared_utility/umock_c_prod.h"
|
---|
| 9 | #include "azure_c_shared_utility/macro_utils.h"
|
---|
| 10 |
|
---|
| 11 | #ifdef __cplusplus
|
---|
| 12 | #include <cstddef>
|
---|
| 13 | extern "C" {
|
---|
| 14 | #else
|
---|
| 15 | #include <stdbool.h>
|
---|
| 16 | #include <stddef.h>
|
---|
| 17 | #endif
|
---|
| 18 |
|
---|
| 19 | #define RESERVED_1 0x04
|
---|
| 20 | #define RESERVED_2 0x02
|
---|
| 21 | #define RESERVED_3 0x01
|
---|
| 22 |
|
---|
| 23 | #define WS_FRAME_TYPE_VALUES \
|
---|
| 24 | WS_CONTINUATION_FRAME, \
|
---|
| 25 | WS_TEXT_FRAME, \
|
---|
| 26 | WS_BINARY_FRAME, \
|
---|
| 27 | WS_RESERVED_NON_CONTROL_FRAME_3, \
|
---|
| 28 | WS_RESERVED_NON_CONTROL_FRAME_4, \
|
---|
| 29 | WS_RESERVED_NON_CONTROL_FRAME_5, \
|
---|
| 30 | WS_RESERVED_NON_CONTROL_FRAME_6, \
|
---|
| 31 | WS_RESERVED_NON_CONTROL_FRAME_7, \
|
---|
| 32 | WS_CLOSE_FRAME, \
|
---|
| 33 | WS_PING_FRAME, \
|
---|
| 34 | WS_PONG_FRAME, \
|
---|
| 35 | WS_RESERVED_CONTROL_FRAME_B, \
|
---|
| 36 | WS_RESERVED_CONTROL_FRAME_C, \
|
---|
| 37 | WS_RESERVED_CONTROL_FRAME_D, \
|
---|
| 38 | WS_RESERVED_CONTROL_FRAME_E, \
|
---|
| 39 | WS_RESERVED_CONTROL_FRAME_F
|
---|
| 40 |
|
---|
| 41 | MU_DEFINE_ENUM(WS_FRAME_TYPE, WS_FRAME_TYPE_VALUES);
|
---|
| 42 |
|
---|
| 43 | MOCKABLE_FUNCTION(, BUFFER_HANDLE, uws_frame_encoder_encode, WS_FRAME_TYPE, opcode, const unsigned char*, payload, size_t, length, bool, is_masked, bool, is_final, unsigned char, reserved);
|
---|
| 44 |
|
---|
| 45 | #ifdef __cplusplus
|
---|
| 46 | }
|
---|
| 47 | #endif /* __cplusplus */
|
---|
| 48 |
|
---|
| 49 | #endif /* UWS_FRAME_ENCODER_H */
|
---|