PionNetworkLibrary
|
#include <parser.hpp>
Classes | |
class | error_category_t |
class-specific error category More... | |
Public Types | |
enum | error_value_t { ERROR_INVALID_SPDY_FRAME = 1, ERROR_INVALID_SPDY_VERSION, ERROR_DECOMPRESSION, ERROR_PROTOCOL_ERROR, ERROR_INTERNAL_SPDY_ERROR, ERROR_MISSING_HEADER_DATA } |
class-specific error code values More... | |
Public Member Functions | |
parser () | |
constructs a new parser object (default constructor) More... | |
~parser () | |
destructor More... | |
boost::tribool | parse (http_protocol_info &http_headers, boost::system::error_code &ec, const decompressor_ptr &decompressor, const char *packet_ptr, boost::uint32_t &length_packet, boost::uint32_t current_stream_count) |
const char * | get_spdy_data_content () |
Get the pointer to the first character to the spdy data contect. More... | |
const char * | get_spdy_read_pointer () |
Get the pointer to the first character to the spdy data contect. More... | |
Static Public Member Functions | |
static spdy_frame_type | get_spdy_frame_type (const char *ptr) |
static bool | is_spdy_control_frame (const char *ptr) |
static boost::uint32_t | get_control_frame_stream_id (const char *ptr) |
Protected Member Functions | |
void | set_read_ptr (const char *ptr) |
resets the read pointer More... | |
bool | populate_frame (boost::system::error_code &ec, spdy_control_frame_info &frame, boost::uint32_t &length_packet, boost::uint32_t &stream_id, http_protocol_info &http_headers) |
void | parse_header_payload (boost::system::error_code &ec, const decompressor_ptr &decompressor, const spdy_control_frame_info &frame, http_protocol_info &http_headers, boost::uint32_t current_stream_count) |
void | parse_spdy_data (boost::system::error_code &ec, const spdy_control_frame_info &frame, boost::uint32_t stream_id, http_protocol_info &http_info) |
void | parse_spdy_settings_frame (boost::system::error_code &ec, const spdy_control_frame_info &frame) |
void | parse_spdy_rst_stream (boost::system::error_code &ec, const spdy_control_frame_info &frame) |
void | parse_spdy_ping_frame (boost::system::error_code &ec, const spdy_control_frame_info &frame) |
void | parse_spdy_goaway_frame (boost::system::error_code &ec, const spdy_control_frame_info &frame) |
void | parse_spdy_window_update_frame (boost::system::error_code &ec, const spdy_control_frame_info &frame) |
boost::tribool | parse_spdy_frame (boost::system::error_code &ec, const decompressor_ptr &decompressor, http_protocol_info &http_headers, boost::uint32_t &length_packet, boost::uint32_t current_stream_count) |
Static Protected Member Functions | |
static void | create_error_category (void) |
creates the unique parser error_category_t More... | |
static error_category_t & | get_error_category (void) |
returns an instance of parser::error_category_t More... | |
static void | set_error (boost::system::error_code &ec, error_value_t ev) |
parser : parsers and reads the SPDY frames
pion::spdy::parser::parser | ( | ) |
constructs a new parser object (default constructor)
|
inline |
destructor
|
staticprotected |
creates the unique parser error_category_t
Referenced by get_error_category().
|
static |
get the stream id for the spdy control frame
References pion::algorithm::to_uint32().
|
inlinestaticprotected |
returns an instance of parser::error_category_t
References create_error_category().
|
inline |
Get the pointer to the first character to the spdy data contect.
|
static |
checks if the frame is spdy frame or not
References pion::spdy::spdy_control_frame, pion::spdy::spdy_data_frame, and pion::spdy::spdy_invalid_frame.
|
inline |
Get the pointer to the first character to the spdy data contect.
|
static |
checks if the frame is spdy control frame or not
References SPDY_INVALID, and pion::algorithm::to_uint16().
boost::tribool pion::spdy::parser::parse | ( | http_protocol_info & | http_headers, |
boost::system::error_code & | ec, | ||
const decompressor_ptr & | decompressor, | ||
const char * | packet_ptr, | ||
boost::uint32_t & | length_packet, | ||
boost::uint32_t | current_stream_count | ||
) |
parse a SPDY packet
References parse_spdy_frame(), and set_read_ptr().
|
protected |
parses an the header payload for SPDY
References ERROR_DECOMPRESSION, ERROR_INVALID_SPDY_FRAME, pion::spdy::_http_protocol_info_t::http_headers, pion::spdy::spdy_control_frame_info::length, PION_LOG_ERROR, set_error(), SPDY_HEADERS, SPDY_SYN_REPLY, SPDY_SYN_STREAM, pion::spdy::_http_protocol_info_t::stream_id, pion::algorithm::to_uint16(), pion::algorithm::to_uint32(), and pion::spdy::spdy_control_frame_info::type.
Referenced by parse_spdy_frame().
|
protected |
parses the data for SPDY
References pion::spdy::spdy_control_frame_info::flags, pion::spdy::_http_protocol_info_t::last_chunk, and SPDY_FLAG_FIN.
Referenced by parse_spdy_frame().
|
protected |
parse a SPDY frame (protected implementation)
There was an error; No need to further parse.
References pion::spdy::spdy_control_frame_info::control_bit, ERROR_INVALID_SPDY_FRAME, ERROR_INVALID_SPDY_VERSION, HTTP_DATA, HTTP_REQUEST, HTTP_RESPONSE, pion::spdy::_http_protocol_info_t::http_type, pion::spdy::spdy_control_frame_info::length, MIN_SPDY_VERSION, parse_header_payload(), parse_spdy_data(), parse_spdy_goaway_frame(), parse_spdy_ping_frame(), parse_spdy_rst_stream(), parse_spdy_settings_frame(), parse_spdy_window_update_frame(), PION_LOG_ERROR, populate_frame(), set_error(), SPDY_CONTROL, SPDY_CREDENTIAL, SPDY_DATA, SPDY_GOAWAY, SPDY_HEADERS, SPDY_PING, SPDY_RST_STREAM, SPDY_SETTINGS, SPDY_SYN_REPLY, SPDY_SYN_STREAM, SPDY_WINDOW_UPDATE, pion::spdy::spdy_control_frame_info::type, and pion::spdy::spdy_control_frame_info::version.
Referenced by parse().
|
protected |
parses an the GoAway Frame for SPDY
References ERROR_INTERNAL_SPDY_ERROR, ERROR_PROTOCOL_ERROR, pion::spdy::spdy_control_frame_info::length, PION_LOG_ERROR, PION_LOG_INFO, set_error(), and pion::algorithm::to_uint32().
Referenced by parse_spdy_frame().
|
protected |
parses an the Ping Frame for SPDY
References pion::spdy::spdy_control_frame_info::length, PION_LOG_INFO, and pion::algorithm::to_uint32().
Referenced by parse_spdy_frame().
|
protected |
parses an the RST stream for SPDY
References pion::spdy::spdy_control_frame_info::flags, pion::spdy::spdy_control_frame_info::length, PION_LOG_INFO, pion::spdy::rst_stream_status(), and pion::algorithm::to_uint32().
Referenced by parse_spdy_frame().
|
protected |
parses an the Settings Frame for SPDY
Referenced by parse_spdy_frame().
|
protected |
parses an the WindowUpdate Frame for SPDY
Referenced by parse_spdy_frame().
|
protected |
populates the frame for every spdy packet Returns false if there was an error else returns true
References pion::spdy::spdy_control_frame_info::control_bit, pion::spdy::_http_protocol_info_t::data_offset, pion::spdy::_http_protocol_info_t::data_size, ERROR_INVALID_SPDY_FRAME, pion::spdy::spdy_control_frame_info::flags, pion::spdy::spdy_control_frame_info::length, PION_LOG_ERROR, set_error(), SPDY_DATA, SPDY_INVALID, pion::spdy::_http_protocol_info_t::stream_id, pion::algorithm::to_uint16(), pion::algorithm::to_uint32(), pion::spdy::spdy_control_frame_info::type, and pion::spdy::spdy_control_frame_info::version.
Referenced by parse_spdy_frame().
|
inlinestaticprotected |
sets an error code
ec | error code variable to define |
ev | error value to raise |
Referenced by parse_header_payload(), parse_spdy_frame(), parse_spdy_goaway_frame(), and populate_frame().
|
inlineprotected |
resets the read pointer
Referenced by parse().