/usr/include/pion/spdy/types.hpp is in libpion-dev 5.0.4+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | // ---------------------------------------------------------------------
// pion: a Boost C++ framework for building lightweight HTTP interfaces
// ---------------------------------------------------------------------
// Copyright (C) 2007-2012 Cloudmeter, Inc. (http://www.cloudmeter.com)
//
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//
#ifndef __PION_SPDYTYPES_HEADER__
#define __PION_SPDYTYPES_HEADER__
#include <map>
#include <pion/config.hpp>
namespace pion { // begin namespace pion
namespace spdy { // begin namespace spdy
#define MIN_SPDY_VERSION 3
// The types of SPDY frames
#define SPDY_DATA 0
#define SPDY_SYN_STREAM 1
#define SPDY_SYN_REPLY 2
#define SPDY_RST_STREAM 3
#define SPDY_SETTINGS 4
#define SPDY_PING 6
#define SPDY_GOAWAY 7
#define SPDY_HEADERS 8
#define SPDY_WINDOW_UPDATE 9
#define SPDY_CREDENTIAL 10
#define SPDY_INVALID 11
#define SPDY_FLAG_FIN 0x01
#define SPDY_FLAG_UNIDIRECTIONAL 0x02
#define SIZE_OF_BYTE 8
#define NON_SPDY 0
#define HTTP_REQUEST 1
#define HTTP_RESPONSE 2
#define HTTP_DATA 3
#define SPDY_CONTROL 4
/// SPDY value string data type
typedef struct _value_string {
boost::uint32_t value;
std::string str;
} value_string;
/// Int-String value pairs of the status code for the RST Stream
static const value_string rst_stream_status_names[] = {
{ 1, "PROTOCOL_ERROR" },
{ 2, "INVALID_STREAM" },
{ 3, "REFUSED_STREAM" },
{ 4, "UNSUPPORTED_VERSION" },
{ 5, "CANCEL" },
{ 6, "INTERNAL_ERROR" },
{ 7, "FLOW_CONTROL_ERROR" },
{ 8, "STREAM_IN_USE" },
{ 9, "STREAM_ALREADY_CLOSED" },
{ 10, "INVALID_CREDENTIALS" },
{ 11, "FRAME_TOO_LARGE" },
{ 12, "INVALID" },
};
/// This structure will be tied to each SPDY frame
typedef struct spdy_control_frame_info{
bool control_bit;
boost::uint16_t version;
boost::uint16_t type;
boost::uint8_t flags;
boost::uint32_t length; // Actually only 24 bits.
} spdy_control_frame_info;
/// This structure will be tied to each SPDY header frame.
/// Only applies to frames containing headers: SYN_STREAM, SYN_REPLY, HEADERS
/// Note that there may be multiple SPDY frames in one packet.
typedef struct _spdy_header_info{
boost::uint32_t stream_id;
boost::uint8_t *header_block;
boost::uint8_t header_block_len;
boost::uint16_t frame_type;
} spdy_header_info;
/// This structure contains the HTTP Protocol information
typedef struct _http_protocol_info_t{
std::map<std::string, std::string> http_headers;
boost::uint32_t http_type;
boost::uint32_t stream_id;
boost::uint32_t data_offset;
boost::uint32_t data_size;
bool last_chunk;
_http_protocol_info_t()
: http_type(NON_SPDY),
stream_id(0),
data_offset(0),
data_size(0),
last_chunk(false){}
} http_protocol_info;
enum spdy_frame_type{
spdy_data_frame = 1,
spdy_control_frame = 2,
spdy_invalid_frame = 3
};
} // end namespace spdy
} // end namespace pion
#endif
|