RESTinio
|
Classes | |
struct | connection_input_t |
Websocket input stuff. More... | |
struct | expected_data_t |
Data with expected size. More... | |
class | message_details_t |
Websocket message class with more detailed protocol information. More... | |
struct | unmasker_t |
class | ws_connection_base_t |
WebSocket connection base. More... | |
class | ws_connection_t |
Context for handling websocket connections. More... | |
class | ws_outgoing_data_t |
A queue for outgoing buffers. More... | |
class | ws_parser_t |
Websocket parser. More... | |
class | ws_protocol_validator_t |
Class for websocket protocol validations. More... | |
Typedefs | |
using | write_groups_queue_t = std::queue< write_group_t > |
using | ws_connection_handle_t = std::shared_ptr< ws_connection_base_t > |
Alias for WebSocket connection handle. More... | |
Enumerations | |
enum class | validation_state_t { initial_state , frame_header_is_valid , payload_part_is_valid , frame_is_valid , invalid_opcode , empty_mask_from_client_side , non_final_control_frame , non_zero_rsv_flags , payload_len_is_too_big , continuation_frame_without_data_frame , new_data_frame_without_finishing_previous , invalid_close_code , incorrect_utf8_data } |
States of validated frame. More... | |
Functions | |
bool | check_utf8_is_correct (string_view_t sv) noexcept |
constexpr size_t | websocket_header_max_size () |
Max possible size of websocket frame header (a part before payload). More... | |
template<typename T > | |
void | read_number_from_big_endian_bytes (T &number, const raw_data_t &data) |
Read number from buffer with network bytes order. More... | |
template<int Bytes> | |
void | write_number_to_big_endian_bytes (std::uint64_t &number, raw_data_t &data) |
Save number to buffer with network bytes order. More... | |
void | mask_unmask_payload (std::uint32_t masking_key, raw_data_t &payload) |
Do msak/unmask operation with buffer. More... | |
raw_data_t | write_message_details (const message_details_t &message) |
Serialize websocket message details into bytes buffer. More... | |
raw_data_t | write_message_details (final_frame_flag_t final_flag, opcode_t opcode, size_t payload_len) |
Serialize websocket message details into bytes buffer. More... | |
raw_data_t | write_message_details (final_frame_flag_t final_flag, opcode_t opcode, size_t payload_len, std::uint32_t masking_key) |
Serialize websocket message details into bytes buffer. More... | |
const char * | validation_state_str (validation_state_t state) |
Helper function for logging validation states. More... | |
bool | is_control_frame (opcode_t opcode) |
Check frame is control frame. More... | |
bool | is_data_frame (opcode_t opcode) |
Check frame is data frame. More... | |
Variables | |
constexpr size_t | websocket_first_two_bytes_size = 2 |
Websocket parser constants. More... | |
constexpr size_t | websocket_max_payload_size_without_ext = 125 |
constexpr size_t | websocket_short_ext_payload_length = 2 |
constexpr size_t | websocket_long_ext_payload_length = 8 |
constexpr size_t | websocket_short_ext_len_code = 126 |
constexpr size_t | websocket_long_ext_len_code = 127 |
constexpr size_t | websocket_masking_key_size = 4 |
constexpr byte_t | bit_flag_7 = 0x80 |
constexpr byte_t | bit_flag_6 = 0x40 |
constexpr byte_t | bit_flag_5 = 0x20 |
constexpr byte_t | bit_flag_4 = 0x10 |
constexpr byte_t | opcode_mask = 0x0F |
constexpr byte_t | payload_len_mask = 0x7F |
using restinio::websocket::basic::impl::write_groups_queue_t = typedef std::queue< write_group_t > |
Definition at line 42 of file ws_connection.hpp.
using restinio::websocket::basic::impl::ws_connection_handle_t = typedef std::shared_ptr< ws_connection_base_t > |
Alias for WebSocket connection handle.
Definition at line 65 of file ws_connection_base.hpp.
|
strong |
States of validated frame.
Definition at line 28 of file ws_protocol_validator.hpp.
|
inlinenoexcept |
|
inline |
Check frame is control frame.
Definition at line 87 of file ws_protocol_validator.hpp.
|
inline |
Check frame is data frame.
Definition at line 104 of file ws_protocol_validator.hpp.
|
inline |
Do msak/unmask operation with buffer.
Definition at line 488 of file ws_parser.hpp.
|
inline |
Read number from buffer with network bytes order.
Definition at line 221 of file ws_parser.hpp.
|
inline |
Helper function for logging validation states.
Definition at line 55 of file ws_protocol_validator.hpp.
|
constexpr |
Max possible size of websocket frame header (a part before payload).
Definition at line 46 of file ws_connection.hpp.
|
inline |
Serialize websocket message details into bytes buffer.
Definition at line 515 of file ws_parser.hpp.
|
inline |
Serialize websocket message details into bytes buffer.
Definition at line 586 of file ws_parser.hpp.
|
inline |
Serialize websocket message details into bytes buffer.
Definition at line 600 of file ws_parser.hpp.
|
inline |
Save number to buffer with network bytes order.
Definition at line 238 of file ws_parser.hpp.
|
constexpr |
Definition at line 52 of file ws_parser.hpp.
|
constexpr |
Definition at line 51 of file ws_parser.hpp.
|
constexpr |
Definition at line 50 of file ws_parser.hpp.
|
constexpr |
Definition at line 49 of file ws_parser.hpp.
|
constexpr |
Definition at line 53 of file ws_parser.hpp.
|
constexpr |
Definition at line 54 of file ws_parser.hpp.
|
constexpr |
Websocket parser constants.
Definition at line 41 of file ws_parser.hpp.
|
constexpr |
Definition at line 46 of file ws_parser.hpp.
|
constexpr |
Definition at line 44 of file ws_parser.hpp.
|
constexpr |
Definition at line 47 of file ws_parser.hpp.
|
constexpr |
Definition at line 42 of file ws_parser.hpp.
|
constexpr |
Definition at line 45 of file ws_parser.hpp.
|
constexpr |
Definition at line 43 of file ws_parser.hpp.