Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
frame.hpp File Reference
#include <algorithm>
#include <string>
#include <websocketpp/common/system_error.hpp>
#include <websocketpp/common/network.hpp>
#include <websocketpp/utilities.hpp>
Include dependency graph for frame.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  websocketpp::frame::uint16_converter
 Two byte conversion union. More...
 
union  websocketpp::frame::uint32_converter
 Four byte conversion union. More...
 
union  websocketpp::frame::uint64_converter
 Eight byte conversion union. More...
 
struct  websocketpp::frame::basic_header
 The constant size component of a WebSocket frame header. More...
 
struct  websocketpp::frame::extended_header
 The variable size component of a WebSocket frame header. More...
 

Namespaces

namespace  websocketpp
 Namespace for the WebSocket++ project.
 
namespace  websocketpp::frame
 Data structures and utility functions for manipulating WebSocket frames.
 
namespace  websocketpp::frame::opcode
 Constants and utility functions related to WebSocket opcodes.
 
namespace  websocketpp::frame::limits
 Constants related to frame and payload limits.
 

Typedefs

typedef uint32_converter websocketpp::frame::masking_key_type
 

Enumerations

enum  websocketpp::frame::opcode::value {
  websocketpp::frame::opcode::continuation = 0x0 , websocketpp::frame::opcode::text = 0x1 , websocketpp::frame::opcode::binary = 0x2 , websocketpp::frame::opcode::rsv3 = 0x3 ,
  websocketpp::frame::opcode::rsv4 = 0x4 , websocketpp::frame::opcode::rsv5 = 0x5 , websocketpp::frame::opcode::rsv6 = 0x6 , websocketpp::frame::opcode::rsv7 = 0x7 ,
  websocketpp::frame::opcode::close = 0x8 , websocketpp::frame::opcode::ping = 0x9 , websocketpp::frame::opcode::pong = 0xA , websocketpp::frame::opcode::control_rsvb = 0xB ,
  websocketpp::frame::opcode::control_rsvc = 0xC , websocketpp::frame::opcode::control_rsvd = 0xD , websocketpp::frame::opcode::control_rsve = 0xE , websocketpp::frame::opcode::control_rsvf = 0xF ,
  websocketpp::frame::opcode::CONTINUATION = 0x0 , websocketpp::frame::opcode::TEXT = 0x1 , websocketpp::frame::opcode::BINARY = 0x2 , websocketpp::frame::opcode::RSV3 = 0x3 ,
  websocketpp::frame::opcode::RSV4 = 0x4 , websocketpp::frame::opcode::RSV5 = 0x5 , websocketpp::frame::opcode::RSV6 = 0x6 , websocketpp::frame::opcode::RSV7 = 0x7 ,
  websocketpp::frame::opcode::CLOSE = 0x8 , websocketpp::frame::opcode::PING = 0x9 , websocketpp::frame::opcode::PONG = 0xA , websocketpp::frame::opcode::CONTROL_RSVB = 0xB ,
  websocketpp::frame::opcode::CONTROL_RSVC = 0xC , websocketpp::frame::opcode::CONTROL_RSVD = 0xD , websocketpp::frame::opcode::CONTROL_RSVE = 0xE , websocketpp::frame::opcode::CONTROL_RSVF = 0xF
}
 

Functions

bool websocketpp::frame::opcode::reserved (value v)
 Check if an opcode is reserved.
 
bool websocketpp::frame::opcode::invalid (value v)
 Check if an opcode is invalid.
 
bool websocketpp::frame::opcode::is_control (value v)
 Check if an opcode is for a control frame.
 
bool websocketpp::frame::get_fin (basic_header const &h)
 Check whether the frame's FIN bit is set.
 
void websocketpp::frame::set_fin (basic_header &h, bool value)
 Set the frame's FIN bit.
 
bool websocketpp::frame::get_rsv1 (const basic_header &h)
 check whether the frame's RSV1 bit is set
 
void websocketpp::frame::set_rsv1 (basic_header &h, bool value)
 Set the frame's RSV1 bit.
 
bool websocketpp::frame::get_rsv2 (const basic_header &h)
 check whether the frame's RSV2 bit is set
 
void websocketpp::frame::set_rsv2 (basic_header &h, bool value)
 Set the frame's RSV2 bit.
 
bool websocketpp::frame::get_rsv3 (const basic_header &h)
 check whether the frame's RSV3 bit is set
 
void websocketpp::frame::set_rsv3 (basic_header &h, bool value)
 Set the frame's RSV3 bit.
 
opcode::value websocketpp::frame::get_opcode (const basic_header &h)
 Extract opcode from basic header.
 
bool websocketpp::frame::get_masked (basic_header const &h)
 check whether the frame is masked
 
void websocketpp::frame::set_masked (basic_header &h, bool value)
 Set the frame's MASK bit.
 
uint8_t websocketpp::frame::get_basic_size (const basic_header &h)
 Extracts the raw payload length specified in the basic header.
 
size_t websocketpp::frame::get_header_len (basic_header const &h)
 Calculates the full length of the header based on the first bytes.
 
unsigned int websocketpp::frame::get_masking_key_offset (const basic_header &h)
 Calculate the offset location of the masking key within the extended header.
 
std::string websocketpp::frame::write_header (basic_header const &, extended_header const &)
 
masking_key_type websocketpp::frame::get_masking_key (const basic_header &h, const extended_header &e)
 Extract the masking key from a frame header.
 
uint16_t websocketpp::frame::get_extended_size (const extended_header &e)
 Extract the extended size field from an extended header.
 
uint64_t websocketpp::frame::get_jumbo_size (const extended_header &e)
 Extract the jumbo size field from an extended header.
 
uint64_t websocketpp::frame::get_payload_size (const basic_header &h, const extended_header &e)
 Extract the full payload size field from a WebSocket header.
 
size_t websocketpp::frame::prepare_masking_key (const masking_key_type &key)
 Extract a masking key into a value the size of a machine word.
 
size_t websocketpp::frame::circshift_prepared_key (size_t prepared_key, size_t offset)
 circularly shifts the supplied prepared masking key by offset bytes
 
template<typename input_iter , typename output_iter >
void websocketpp::frame::byte_mask (input_iter first, input_iter last, output_iter result, masking_key_type const &key, size_t key_offset)
 Byte by byte mask/unmask.
 
template<typename iter_type >
void websocketpp::frame::byte_mask (iter_type b, iter_type e, masking_key_type const &key, size_t key_offset)
 Byte by byte mask/unmask (in place)
 
void websocketpp::frame::word_mask_exact (uint8_t *input, uint8_t *output, size_t length, const masking_key_type &key)
 Exact word aligned mask/unmask.
 
void websocketpp::frame::word_mask_exact (uint8_t *data, size_t length, const masking_key_type &key)
 Exact word aligned mask/unmask (in place)
 
size_t websocketpp::frame::word_mask_circ (uint8_t *input, uint8_t *output, size_t length, size_t prepared_key)
 Circular word aligned mask/unmask.
 
size_t websocketpp::frame::word_mask_circ (uint8_t *data, size_t length, size_t prepared_key)
 Circular word aligned mask/unmask (in place)
 
std::string websocketpp::frame::prepare_header (const basic_header &h, const extended_header &e)
 Generate a properly sized contiguous string that encodes a full frame header.
 
size_t websocketpp::frame::byte_mask_circ (uint8_t *input, uint8_t *output, size_t length, size_t prepared_key)
 Circular byte aligned mask/unmask.
 
size_t websocketpp::frame::byte_mask_circ (uint8_t *data, size_t length, size_t prepared_key)
 Circular byte aligned mask/unmask (in place)