Fundamental HTTP/2 protocol definitions and parsers. More...
#include "HTTP2.h"
#include "ink_assert.h"
Go to the source code of this file.
Data Structures | |
union | byte_pointer |
union | byte_addressable_value< T > |
Functions | |
static void | write_and_advance (byte_pointer &dst, uint32_t src) |
static void | write_and_advance (byte_pointer &dst, uint16_t src) |
static void | write_and_advance (byte_pointer &dst, uint8_t src) |
template<unsigned N> | |
static void | memcpy_and_advance (uint8_t(&dst)[N], byte_pointer &src) |
void | memcpy_and_advance (uint8_t(&dst), byte_pointer &src) |
static bool | http2_are_frame_flags_valid (uint8_t ftype, uint8_t fflags) |
bool | http2_frame_header_is_valid (const Http2FrameHeader &hdr) |
bool | http2_settings_parameter_is_valid (const Http2SettingsParameter ¶m) |
bool | http2_parse_frame_header (IOVec iov, Http2FrameHeader &hdr) |
bool | http2_write_frame_header (const Http2FrameHeader &hdr, IOVec iov) |
bool | http2_write_goaway (const Http2Goaway &goaway, IOVec iov) |
bool | http2_parse_settings_parameter (IOVec iov, Http2SettingsParameter ¶m) |
Variables | |
const char *const | HTTP2_CONNECTION_PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" |
Fundamental HTTP/2 protocol definitions and parsers.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file HTTP2.cc.
static bool http2_are_frame_flags_valid | ( | uint8_t | ftype, | |
uint8_t | fflags | |||
) | [static] |
Definition at line 87 of file HTTP2.cc.
Referenced by http2_frame_header_is_valid().
bool http2_frame_header_is_valid | ( | const Http2FrameHeader & | hdr | ) |
Definition at line 109 of file HTTP2.cc.
References Http2FrameHeader::flags, http2_are_frame_flags_valid(), HTTP2_FRAME_TYPE_MAX, HTTP2_MAX_FRAME_PAYLOAD, Http2FrameHeader::length, and Http2FrameHeader::type.
bool http2_parse_frame_header | ( | IOVec | iov, | |
Http2FrameHeader & | hdr | |||
) |
Definition at line 163 of file HTTP2.cc.
References byte_addressable_value< T >::bytes, Http2FrameHeader::flags, HTTP2_FRAME_HEADER_LEN, Http2FrameHeader::length, memcpy_and_advance(), Http2FrameHeader::streamid, Http2FrameHeader::type, unlikely, and byte_addressable_value< T >::value.
Referenced by Http2Frame::alloc().
bool http2_parse_settings_parameter | ( | IOVec | iov, | |
Http2SettingsParameter & | param | |||
) |
Definition at line 241 of file HTTP2.cc.
References byte_addressable_value< T >::bytes, HTTP2_SETTINGS_PARAMETER_LEN, Http2SettingsParameter::id, memcpy_and_advance(), unlikely, byte_addressable_value< T >::value, and Http2SettingsParameter::value.
Referenced by rcv_settings_frame().
bool http2_settings_parameter_is_valid | ( | const Http2SettingsParameter & | param | ) |
Definition at line 127 of file HTTP2.cc.
References HTTP2_MAX_WINDOW_SIZE, HTTP2_SETTINGS_MAX, Http2SettingsParameter::id, and Http2SettingsParameter::value.
Referenced by rcv_settings_frame().
bool http2_write_frame_header | ( | const Http2FrameHeader & | hdr, | |
IOVec | iov | |||
) |
Definition at line 187 of file HTTP2.cc.
References Http2FrameHeader::flags, HTTP2_FRAME_HEADER_LEN, Http2FrameHeader::length, Http2FrameHeader::streamid, Http2FrameHeader::type, unlikely, and write_and_advance().
Referenced by Http2Frame::finalize(), and Http2Frame::Http2Frame().
bool http2_write_goaway | ( | const Http2Goaway & | goaway, | |
IOVec | iov | |||
) |
Definition at line 216 of file HTTP2.cc.
References Http2Goaway::error_code, HTTP2_GOAWAY_LEN, Http2Goaway::last_streamid, unlikely, and write_and_advance().
Referenced by Http2ConnectionState::main_event_handler().
void memcpy_and_advance | ( | uint8_t & | dst, | |
byte_pointer & | src | |||
) |
Definition at line 80 of file HTTP2.cc.
References byte_pointer::u8.
static void memcpy_and_advance | ( | uint8_t(&) | dst[N], | |
byte_pointer & | src | |||
) | [static] |
Definition at line 73 of file HTTP2.cc.
References memcpy, and byte_pointer::u8.
Referenced by http2_parse_frame_header(), and http2_parse_settings_parameter().
static void write_and_advance | ( | byte_pointer & | dst, | |
uint16_t | src | |||
) | [static] |
Definition at line 56 of file HTTP2.cc.
References byte_addressable_value< T >::bytes, memcpy, byte_pointer::u8, and byte_addressable_value< T >::value.
static void write_and_advance | ( | byte_pointer & | dst, | |
uint32_t | src | |||
) | [static] |
Definition at line 46 of file HTTP2.cc.
References byte_addressable_value< T >::bytes, memcpy, byte_pointer::u8, and byte_addressable_value< T >::value.
Referenced by http2_write_frame_header(), and http2_write_goaway().
static void write_and_advance | ( | byte_pointer & | dst, | |
uint8_t | src | |||
) | [static] |
Definition at line 66 of file HTTP2.cc.
References byte_pointer::u8.
const char* const HTTP2_CONNECTION_PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" |
Definition at line 27 of file HTTP2.cc.
Referenced by proto_is_http2().