PionNetworkLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pion::spdy::parser Class Reference

#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_tget_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)
 

Detailed Description

parser : parsers and reads the SPDY frames

Member Enumeration Documentation

class-specific error code values

Enumerator
ERROR_INVALID_SPDY_FRAME 
ERROR_INVALID_SPDY_VERSION 
ERROR_DECOMPRESSION 
ERROR_PROTOCOL_ERROR 
ERROR_INTERNAL_SPDY_ERROR 
ERROR_MISSING_HEADER_DATA 

Constructor & Destructor Documentation

pion::spdy::parser::parser ( )

constructs a new parser object (default constructor)

pion::spdy::parser::~parser ( )
inline

destructor

Member Function Documentation

void pion::spdy::parser::create_error_category ( void  )
staticprotected

creates the unique parser error_category_t

Referenced by get_error_category().

boost::uint32_t pion::spdy::parser::get_control_frame_stream_id ( const char *  ptr)
static

get the stream id for the spdy control frame

Returns
true if it is a control frame else returns false

References pion::algorithm::to_uint32().

static error_category_t& pion::spdy::parser::get_error_category ( void  )
inlinestaticprotected

returns an instance of parser::error_category_t

References create_error_category().

const char* pion::spdy::parser::get_spdy_data_content ( )
inline

Get the pointer to the first character to the spdy data contect.

spdy_frame_type pion::spdy::parser::get_spdy_frame_type ( const char *  ptr)
static

checks if the frame is spdy frame or not

Returns
true if it is a frame else returns false

References pion::spdy::spdy_control_frame, pion::spdy::spdy_data_frame, and pion::spdy::spdy_invalid_frame.

const char* pion::spdy::parser::get_spdy_read_pointer ( )
inline

Get the pointer to the first character to the spdy data contect.

bool pion::spdy::parser::is_spdy_control_frame ( const char *  ptr)
static

checks if the frame is spdy control frame or not

Returns
true if it is a control frame else returns false

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

Returns
boost::tribool result of parsing: false = SPDY frame has an error, true = finished parsing SPDY frame, indeterminate = not yet finished parsing SPDY frame

References parse_spdy_frame(), and set_read_ptr().

void pion::spdy::parser::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 
)
protected
void pion::spdy::parser::parse_spdy_data ( boost::system::error_code &  ec,
const spdy_control_frame_info frame,
boost::uint32_t  stream_id,
http_protocol_info http_info 
)
protected
boost::tribool pion::spdy::parser::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 
)
protected
void pion::spdy::parser::parse_spdy_goaway_frame ( boost::system::error_code &  ec,
const spdy_control_frame_info frame 
)
protected
void pion::spdy::parser::parse_spdy_ping_frame ( boost::system::error_code &  ec,
const spdy_control_frame_info 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().

void pion::spdy::parser::parse_spdy_rst_stream ( boost::system::error_code &  ec,
const spdy_control_frame_info frame 
)
protected
void pion::spdy::parser::parse_spdy_settings_frame ( boost::system::error_code &  ec,
const spdy_control_frame_info frame 
)
protected

parses an the Settings Frame for SPDY

Referenced by parse_spdy_frame().

void pion::spdy::parser::parse_spdy_window_update_frame ( boost::system::error_code &  ec,
const spdy_control_frame_info frame 
)
protected

parses an the WindowUpdate Frame for SPDY

Referenced by parse_spdy_frame().

static void pion::spdy::parser::set_error ( boost::system::error_code &  ec,
error_value_t  ev 
)
inlinestaticprotected

sets an error code

Parameters
ecerror code variable to define
everror value to raise

Referenced by parse_header_payload(), parse_spdy_frame(), parse_spdy_goaway_frame(), and populate_frame().

void pion::spdy::parser::set_read_ptr ( const char *  ptr)
inlineprotected

resets the read pointer

Referenced by parse().


The documentation for this class was generated from the following files: