├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── DEVELOPMENT.md ├── LICENSE ├── Makefile ├── README.md ├── VERSION ├── base ├── bvc-qlog │ └── src │ │ ├── base_qlogger.cc │ │ ├── base_qlogger.h │ │ ├── connection_debug_visitor.cc │ │ ├── connection_debug_visitor.h │ │ ├── file_qlogger.cc │ │ ├── file_qlogger.h │ │ ├── qlogger.cc │ │ ├── qlogger.h │ │ ├── qlogger_constants.cc │ │ ├── qlogger_constants.h │ │ ├── qlogger_types.cc │ │ └── qlogger_types.h ├── files │ ├── file_path.cc │ ├── file_path.h │ ├── file_path_constants.cc │ ├── file_util.cc │ ├── file_util.h │ ├── file_util_posix.cc │ └── scoped_file.h ├── posix │ └── eintr_wrapper.h ├── sinks │ ├── customize_file_helper-inl.h │ ├── customize_file_helper.h │ ├── sequence_file_sink-inl.h │ └── sequence_file_sink.h └── strings │ ├── stringprintf.cc │ └── stringprintf.h ├── cmake_install.cmake ├── decode.py ├── dragon3.pcap ├── googleurl ├── .bazelversion ├── .gitignore ├── AUTHORS ├── CMakeFiles │ ├── CMakeDirectoryInformation.cmake │ ├── gurl.dir │ │ ├── DependInfo.cmake │ │ ├── build.make │ │ ├── cmake_clean.cmake │ │ ├── cmake_clean_target.cmake │ │ ├── compiler_depend.make │ │ ├── compiler_depend.ts │ │ ├── depend.make │ │ ├── flags.make │ │ ├── link.txt │ │ └── progress.make │ └── progress.marks ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── README.md ├── WORKSPACE ├── base │ ├── BUILD │ ├── compiler_specific.h │ ├── containers │ │ ├── checked_iterators.h │ │ ├── contains.h │ │ ├── contiguous_iterator.h │ │ ├── span.h │ │ └── util.h │ ├── debug │ │ └── leak_annotations.h │ ├── functional │ │ ├── identity.h │ │ ├── invoke.h │ │ └── not_fn.h │ ├── macros.h │ ├── no_destructor.h │ ├── optional.h │ ├── ranges │ │ ├── algorithm.h │ │ ├── functional.h │ │ └── ranges.h │ ├── stl_util.h │ ├── strings │ │ ├── BUILD │ │ ├── abseil_string_conversions.cc │ │ ├── abseil_string_conversions.h │ │ ├── abseil_string_conversions_unittest.cc │ │ ├── char_traits.h │ │ ├── char_traits_unittest.cc │ │ ├── escape.cc │ │ ├── escape.h │ │ ├── escape_unittest.cc │ │ ├── latin1_string_conversions.cc │ │ ├── latin1_string_conversions.h │ │ ├── no_trigraphs_unittest.cc │ │ ├── nullable_string16.cc │ │ ├── nullable_string16.h │ │ ├── nullable_string16_unittest.cc │ │ ├── pattern.cc │ │ ├── pattern.h │ │ ├── pattern_unittest.cc │ │ ├── safe_sprintf.cc │ │ ├── safe_sprintf.h │ │ ├── safe_sprintf_unittest.cc │ │ ├── strcat.cc │ │ ├── strcat.h │ │ ├── strcat_internal.h │ │ ├── strcat_unittest.cc │ │ ├── strcat_win.cc │ │ ├── strcat_win.h │ │ ├── string16.cc │ │ ├── string16.h │ │ ├── string16_unittest.cc │ │ ├── string_number_conversions.cc │ │ ├── string_number_conversions.h │ │ ├── string_number_conversions_fuzzer.cc │ │ ├── string_number_conversions_internal.h │ │ ├── string_number_conversions_unittest.cc │ │ ├── string_number_conversions_win.cc │ │ ├── string_number_conversions_win.h │ │ ├── string_piece.cc │ │ ├── string_piece.h │ │ ├── string_piece_forward.h │ │ ├── string_piece_unittest.cc │ │ ├── string_split.cc │ │ ├── string_split.h │ │ ├── string_split_internal.h │ │ ├── string_split_unittest.cc │ │ ├── string_split_win.cc │ │ ├── string_split_win.h │ │ ├── string_tokenizer.h │ │ ├── string_tokenizer_fuzzer.cc │ │ ├── string_tokenizer_unittest.cc │ │ ├── string_util.cc │ │ ├── string_util.h │ │ ├── string_util_constants.cc │ │ ├── string_util_internal.h │ │ ├── string_util_perftest.cc │ │ ├── string_util_posix.h │ │ ├── string_util_unittest.cc │ │ ├── string_util_win.cc │ │ ├── string_util_win.h │ │ ├── stringize_macros.h │ │ ├── stringize_macros_unittest.cc │ │ ├── stringprintf.cc │ │ ├── stringprintf.h │ │ ├── stringprintf_unittest.cc │ │ ├── sys_string_conversions.h │ │ ├── sys_string_conversions_posix.cc │ │ ├── sys_string_conversions_unittest.cc │ │ ├── sys_string_conversions_win.cc │ │ ├── utf_offset_string_conversions.cc │ │ ├── utf_offset_string_conversions.h │ │ ├── utf_offset_string_conversions_unittest.cc │ │ ├── utf_string_conversion_utils.cc │ │ ├── utf_string_conversion_utils.h │ │ ├── utf_string_conversions.cc │ │ ├── utf_string_conversions.h │ │ ├── utf_string_conversions_fuzzer.cc │ │ └── utf_string_conversions_unittest.cc │ ├── template_util.h │ └── third_party │ │ └── icu │ │ ├── BUILD │ │ ├── LICENSE │ │ ├── README.chromium │ │ ├── icu_utf.cc │ │ └── icu_utf.h ├── build │ ├── BUILD │ └── build_config.h ├── build_config │ ├── BUILD │ ├── build_config.bzl │ └── common_settings.bzl ├── cmake_install.cmake ├── copy.bara.sky ├── polyfills │ ├── BUILD │ └── base │ │ ├── base_export.h │ │ ├── check.h │ │ ├── check_op.h │ │ ├── component_export.h │ │ ├── debug │ │ └── alias.h │ │ ├── export_template.h │ │ ├── logging.h │ │ ├── notreached.h │ │ └── trace_event │ │ └── memory_usage_estimator.h ├── test │ ├── BUILD │ └── basic_test.cc └── url │ ├── BUILD │ ├── gurl.cc │ ├── gurl.h │ ├── gurl_fuzzer.cc │ ├── gurl_unittest.cc │ ├── origin.cc │ ├── origin.h │ ├── origin_unittest.cc │ ├── run_all_perftests.cc │ ├── run_all_unittests.cc │ ├── scheme_host_port.cc │ ├── scheme_host_port.h │ ├── scheme_host_port_unittest.cc │ ├── third_party │ └── mozilla │ │ ├── DIR_METADATA │ │ ├── LICENSE.txt │ │ ├── OWNERS │ │ ├── README.chromium │ │ ├── url_parse.cc │ │ └── url_parse.h │ ├── url_canon.cc │ ├── url_canon.h │ ├── url_canon_etc.cc │ ├── url_canon_filesystemurl.cc │ ├── url_canon_fileurl.cc │ ├── url_canon_host.cc │ ├── url_canon_icu.cc │ ├── url_canon_icu.h │ ├── url_canon_icu_unittest.cc │ ├── url_canon_internal.cc │ ├── url_canon_internal.h │ ├── url_canon_internal_file.h │ ├── url_canon_ip.cc │ ├── url_canon_ip.h │ ├── url_canon_mailtourl.cc │ ├── url_canon_path.cc │ ├── url_canon_pathurl.cc │ ├── url_canon_query.cc │ ├── url_canon_relative.cc │ ├── url_canon_stdstring.cc │ ├── url_canon_stdstring.h │ ├── url_canon_stdurl.cc │ ├── url_canon_unittest.cc │ ├── url_constants.cc │ ├── url_constants.h │ ├── url_file.h │ ├── url_idna_icu.cc │ ├── url_parse_file.cc │ ├── url_parse_internal.h │ ├── url_parse_perftest.cc │ ├── url_parse_unittest.cc │ ├── url_test_utils.h │ ├── url_util.cc │ ├── url_util.h │ ├── url_util_internal.h │ └── url_util_unittest.cc ├── gquiche ├── BUILD.bazel ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── balsa │ ├── balsa_enums.cc │ ├── balsa_enums.h │ ├── balsa_frame.cc │ ├── balsa_frame.h │ ├── balsa_frame_test.cc │ ├── balsa_headers.cc │ ├── balsa_headers.h │ ├── balsa_headers_test.cc │ ├── balsa_visitor_interface.h │ ├── framer_interface.h │ ├── header_api.h │ ├── header_properties.cc │ ├── header_properties.h │ ├── header_properties_test.cc │ ├── http_validation_policy.cc │ ├── http_validation_policy.h │ ├── noop_balsa_visitor.h │ ├── simple_buffer.cc │ ├── simple_buffer.h │ ├── simple_buffer_test.cc │ ├── standard_header_map.cc │ └── standard_header_map.h ├── binary_http │ ├── binary_http_message.cc │ ├── binary_http_message.h │ └── binary_http_message_test.cc ├── common │ ├── platform │ │ ├── api │ │ │ ├── quiche_bug_tracker.h │ │ │ ├── quiche_client_stats.h │ │ │ ├── quiche_command_line_flags.h │ │ │ ├── quiche_containers.h │ │ │ ├── quiche_default_proof_providers.h │ │ │ ├── quiche_epoll.h │ │ │ ├── quiche_epoll_test_tools.h │ │ │ ├── quiche_event_loop.h │ │ │ ├── quiche_expect_bug.h │ │ │ ├── quiche_export.h │ │ │ ├── quiche_file_utils.cc │ │ │ ├── quiche_file_utils.h │ │ │ ├── quiche_file_utils_test.cc │ │ │ ├── quiche_flag_utils.h │ │ │ ├── quiche_flags.h │ │ │ ├── quiche_header_policy.h │ │ │ ├── quiche_hostname_utils.cc │ │ │ ├── quiche_hostname_utils.h │ │ │ ├── quiche_hostname_utils_test.cc │ │ │ ├── quiche_iovec.h │ │ │ ├── quiche_logging.h │ │ │ ├── quiche_lower_case_string.h │ │ │ ├── quiche_lower_case_string_test.cc │ │ │ ├── quiche_mem_slice.h │ │ │ ├── quiche_mem_slice_test.cc │ │ │ ├── quiche_mutex.cc │ │ │ ├── quiche_mutex.h │ │ │ ├── quiche_prefetch.h │ │ │ ├── quiche_reference_counted.h │ │ │ ├── quiche_reference_counted_test.cc │ │ │ ├── quiche_server_stats.h │ │ │ ├── quiche_stack_trace.h │ │ │ ├── quiche_stack_trace_test.cc │ │ │ ├── quiche_stream_buffer_allocator.h │ │ │ ├── quiche_system_event_loop.h │ │ │ ├── quiche_test.h │ │ │ ├── quiche_test_loopback.cc │ │ │ ├── quiche_test_loopback.h │ │ │ ├── quiche_test_output.h │ │ │ ├── quiche_testvalue.h │ │ │ ├── quiche_thread.h │ │ │ ├── quiche_thread_local.h │ │ │ ├── quiche_time_utils.h │ │ │ ├── quiche_time_utils_test.cc │ │ │ ├── quiche_udp_socket_platform_api.h │ │ │ ├── quiche_url_utils.h │ │ │ ├── quiche_url_utils_test.cc │ │ │ └── testdir │ │ │ │ ├── README.md │ │ │ │ ├── a │ │ │ │ ├── b │ │ │ │ │ └── c │ │ │ │ │ │ └── d │ │ │ │ │ │ └── e │ │ │ │ ├── subdir │ │ │ │ │ └── testfile │ │ │ │ └── z │ │ │ │ └── testfile │ │ └── default │ │ │ └── quiche_platform_impl │ │ │ ├── quiche_bug_tracker_impl.h │ │ │ ├── quiche_client_stats_impl.h │ │ │ ├── quiche_command_line_flags_impl.cc │ │ │ ├── quiche_command_line_flags_impl.h │ │ │ ├── quiche_containers_impl.h │ │ │ ├── quiche_event_loop_impl.h │ │ │ ├── quiche_expect_bug_impl.h │ │ │ ├── quiche_export_impl.h │ │ │ ├── quiche_file_utils_impl.cc │ │ │ ├── quiche_file_utils_impl.h │ │ │ ├── quiche_flag_utils_impl.h │ │ │ ├── quiche_flags_impl.cc │ │ │ ├── quiche_flags_impl.h │ │ │ ├── quiche_header_policy_impl.h │ │ │ ├── quiche_iovec_impl.h │ │ │ ├── quiche_logging_impl.h │ │ │ ├── quiche_lower_case_string_impl.h │ │ │ ├── quiche_mem_slice_impl.h │ │ │ ├── quiche_mutex_impl.cc │ │ │ ├── quiche_mutex_impl.h │ │ │ ├── quiche_prefetch_impl.h │ │ │ ├── quiche_reference_counted_impl.h │ │ │ ├── quiche_server_stats_impl.h │ │ │ ├── quiche_stack_trace_impl.cc │ │ │ ├── quiche_stack_trace_impl.h │ │ │ ├── quiche_stream_buffer_allocator_impl.h │ │ │ ├── quiche_system_event_loop_impl.h │ │ │ ├── quiche_test_impl.cc │ │ │ ├── quiche_test_impl.h │ │ │ ├── quiche_test_loopback_impl.cc │ │ │ ├── quiche_test_loopback_impl.h │ │ │ ├── quiche_test_output_impl.h │ │ │ ├── quiche_testvalue_impl.h │ │ │ ├── quiche_thread_impl.h │ │ │ ├── quiche_thread_local_impl.h │ │ │ ├── quiche_time_utils_impl.cc │ │ │ ├── quiche_time_utils_impl.h │ │ │ ├── quiche_url_utils_impl.cc │ │ │ └── quiche_url_utils_impl.h │ ├── print_elements.h │ ├── print_elements_test.cc │ ├── quiche_buffer_allocator.cc │ ├── quiche_buffer_allocator.h │ ├── quiche_buffer_allocator_test.cc │ ├── quiche_circular_deque.h │ ├── quiche_circular_deque_test.cc │ ├── quiche_data_reader.cc │ ├── quiche_data_reader.h │ ├── quiche_data_reader_test.cc │ ├── quiche_data_writer.cc │ ├── quiche_data_writer.h │ ├── quiche_data_writer_test.cc │ ├── quiche_endian.h │ ├── quiche_endian_test.cc │ ├── quiche_ip_address.cc │ ├── quiche_ip_address.h │ ├── quiche_ip_address_family.cc │ ├── quiche_ip_address_family.h │ ├── quiche_ip_address_test.cc │ ├── quiche_linked_hash_map.h │ ├── quiche_linked_hash_map_test.cc │ ├── quiche_mem_slice_storage.cc │ ├── quiche_mem_slice_storage.h │ ├── quiche_mem_slice_storage_test.cc │ ├── quiche_protocol_flags_list.h │ ├── quiche_text_utils.cc │ ├── quiche_text_utils.h │ ├── quiche_text_utils_test.cc │ ├── simple_buffer_allocator.cc │ ├── simple_buffer_allocator.h │ ├── simple_buffer_allocator_test.cc │ ├── structured_headers.cc │ ├── structured_headers.h │ ├── structured_headers_fuzzer.cc │ ├── structured_headers_generated_test.cc │ ├── structured_headers_test.cc │ └── test_tools │ │ ├── quiche_test_utils.cc │ │ └── quiche_test_utils.h ├── epoll_server │ ├── fake_simple_epoll_server.cc │ ├── fake_simple_epoll_server.h │ ├── platform │ │ └── api │ │ │ ├── epoll_address_test_utils.h │ │ │ ├── epoll_bug.h │ │ │ ├── epoll_expect_bug.h │ │ │ ├── epoll_logging.h │ │ │ ├── epoll_test.h │ │ │ └── epoll_thread.h │ ├── simple_epoll_server.cc │ ├── simple_epoll_server.h │ └── simple_epoll_server_test.cc ├── http2 │ ├── adapter │ │ ├── adapter_impl_comparison_test.cc │ │ ├── callback_visitor.cc │ │ ├── callback_visitor.h │ │ ├── callback_visitor_test.cc │ │ ├── data_source.h │ │ ├── event_forwarder.cc │ │ ├── event_forwarder.h │ │ ├── event_forwarder_test.cc │ │ ├── header_validator.cc │ │ ├── header_validator.h │ │ ├── header_validator_base.h │ │ ├── header_validator_test.cc │ │ ├── http2_adapter.h │ │ ├── http2_protocol.cc │ │ ├── http2_protocol.h │ │ ├── http2_session.h │ │ ├── http2_util.cc │ │ ├── http2_util.h │ │ ├── http2_visitor_interface.h │ │ ├── mock_http2_visitor.h │ │ ├── mock_nghttp2_callbacks.cc │ │ ├── mock_nghttp2_callbacks.h │ │ ├── nghttp2.h │ │ ├── nghttp2_adapter.cc │ │ ├── nghttp2_adapter.h │ │ ├── nghttp2_adapter_test.cc │ │ ├── nghttp2_callbacks.cc │ │ ├── nghttp2_callbacks.h │ │ ├── nghttp2_data_provider.cc │ │ ├── nghttp2_data_provider.h │ │ ├── nghttp2_data_provider_test.cc │ │ ├── nghttp2_session.cc │ │ ├── nghttp2_session.h │ │ ├── nghttp2_session_test.cc │ │ ├── nghttp2_test.cc │ │ ├── nghttp2_test_utils.cc │ │ ├── nghttp2_test_utils.h │ │ ├── nghttp2_util.cc │ │ ├── nghttp2_util.h │ │ ├── nghttp2_util_test.cc │ │ ├── noop_header_validator.cc │ │ ├── noop_header_validator.h │ │ ├── noop_header_validator_test.cc │ │ ├── oghttp2_adapter.cc │ │ ├── oghttp2_adapter.h │ │ ├── oghttp2_adapter_test.cc │ │ ├── oghttp2_session.cc │ │ ├── oghttp2_session.h │ │ ├── oghttp2_session_test.cc │ │ ├── oghttp2_util.cc │ │ ├── oghttp2_util.h │ │ ├── oghttp2_util_test.cc │ │ ├── recording_http2_visitor.cc │ │ ├── recording_http2_visitor.h │ │ ├── recording_http2_visitor_test.cc │ │ ├── test_frame_sequence.cc │ │ ├── test_frame_sequence.h │ │ ├── test_utils.cc │ │ ├── test_utils.h │ │ ├── test_utils_test.cc │ │ ├── window_manager.cc │ │ ├── window_manager.h │ │ └── window_manager_test.cc │ ├── core │ │ ├── http2_trace_logging.cc │ │ ├── http2_trace_logging.h │ │ ├── priority_write_scheduler.h │ │ ├── priority_write_scheduler_test.cc │ │ └── write_scheduler.h │ ├── decoder │ │ ├── decode_buffer.cc │ │ ├── decode_buffer.h │ │ ├── decode_buffer_test.cc │ │ ├── decode_http2_structures.cc │ │ ├── decode_http2_structures.h │ │ ├── decode_http2_structures_test.cc │ │ ├── decode_status.cc │ │ ├── decode_status.h │ │ ├── frame_decoder_state.cc │ │ ├── frame_decoder_state.h │ │ ├── http2_frame_decoder.cc │ │ ├── http2_frame_decoder.h │ │ ├── http2_frame_decoder_listener.cc │ │ ├── http2_frame_decoder_listener.h │ │ ├── http2_frame_decoder_test.cc │ │ ├── http2_structure_decoder.cc │ │ ├── http2_structure_decoder.h │ │ ├── http2_structure_decoder_test.cc │ │ └── payload_decoders │ │ │ ├── altsvc_payload_decoder.cc │ │ │ ├── altsvc_payload_decoder.h │ │ │ ├── altsvc_payload_decoder_test.cc │ │ │ ├── continuation_payload_decoder.cc │ │ │ ├── continuation_payload_decoder.h │ │ │ ├── continuation_payload_decoder_test.cc │ │ │ ├── data_payload_decoder.cc │ │ │ ├── data_payload_decoder.h │ │ │ ├── data_payload_decoder_test.cc │ │ │ ├── goaway_payload_decoder.cc │ │ │ ├── goaway_payload_decoder.h │ │ │ ├── goaway_payload_decoder_test.cc │ │ │ ├── headers_payload_decoder.cc │ │ │ ├── headers_payload_decoder.h │ │ │ ├── headers_payload_decoder_test.cc │ │ │ ├── ping_payload_decoder.cc │ │ │ ├── ping_payload_decoder.h │ │ │ ├── ping_payload_decoder_test.cc │ │ │ ├── priority_payload_decoder.cc │ │ │ ├── priority_payload_decoder.h │ │ │ ├── priority_payload_decoder_test.cc │ │ │ ├── priority_update_payload_decoder.cc │ │ │ ├── priority_update_payload_decoder.h │ │ │ ├── priority_update_payload_decoder_test.cc │ │ │ ├── push_promise_payload_decoder.cc │ │ │ ├── push_promise_payload_decoder.h │ │ │ ├── push_promise_payload_decoder_test.cc │ │ │ ├── rst_stream_payload_decoder.cc │ │ │ ├── rst_stream_payload_decoder.h │ │ │ ├── rst_stream_payload_decoder_test.cc │ │ │ ├── settings_payload_decoder.cc │ │ │ ├── settings_payload_decoder.h │ │ │ ├── settings_payload_decoder_test.cc │ │ │ ├── unknown_payload_decoder.cc │ │ │ ├── unknown_payload_decoder.h │ │ │ ├── unknown_payload_decoder_test.cc │ │ │ ├── window_update_payload_decoder.cc │ │ │ ├── window_update_payload_decoder.h │ │ │ └── window_update_payload_decoder_test.cc │ ├── hpack │ │ ├── decoder │ │ │ ├── hpack_block_collector_test.cc │ │ │ ├── hpack_block_decoder.cc │ │ │ ├── hpack_block_decoder.h │ │ │ ├── hpack_block_decoder_test.cc │ │ │ ├── hpack_decoder.cc │ │ │ ├── hpack_decoder.h │ │ │ ├── hpack_decoder_listener.cc │ │ │ ├── hpack_decoder_listener.h │ │ │ ├── hpack_decoder_state.cc │ │ │ ├── hpack_decoder_state.h │ │ │ ├── hpack_decoder_state_test.cc │ │ │ ├── hpack_decoder_string_buffer.cc │ │ │ ├── hpack_decoder_string_buffer.h │ │ │ ├── hpack_decoder_string_buffer_test.cc │ │ │ ├── hpack_decoder_tables.cc │ │ │ ├── hpack_decoder_tables.h │ │ │ ├── hpack_decoder_tables_test.cc │ │ │ ├── hpack_decoder_test.cc │ │ │ ├── hpack_decoding_error.cc │ │ │ ├── hpack_decoding_error.h │ │ │ ├── hpack_entry_collector_test.cc │ │ │ ├── hpack_entry_decoder.cc │ │ │ ├── hpack_entry_decoder.h │ │ │ ├── hpack_entry_decoder_listener.cc │ │ │ ├── hpack_entry_decoder_listener.h │ │ │ ├── hpack_entry_decoder_test.cc │ │ │ ├── hpack_entry_type_decoder.cc │ │ │ ├── hpack_entry_type_decoder.h │ │ │ ├── hpack_entry_type_decoder_test.cc │ │ │ ├── hpack_string_decoder.cc │ │ │ ├── hpack_string_decoder.h │ │ │ ├── hpack_string_decoder_listener.cc │ │ │ ├── hpack_string_decoder_listener.h │ │ │ ├── hpack_string_decoder_test.cc │ │ │ ├── hpack_whole_entry_buffer.cc │ │ │ ├── hpack_whole_entry_buffer.h │ │ │ ├── hpack_whole_entry_buffer_test.cc │ │ │ ├── hpack_whole_entry_listener.cc │ │ │ └── hpack_whole_entry_listener.h │ │ ├── hpack_static_table_entries.inc │ │ ├── http2_hpack_constants.cc │ │ ├── http2_hpack_constants.h │ │ ├── http2_hpack_constants_test.cc │ │ ├── huffman │ │ │ ├── hpack_huffman_decoder.cc │ │ │ ├── hpack_huffman_decoder.h │ │ │ ├── hpack_huffman_decoder_test.cc │ │ │ ├── hpack_huffman_encoder.cc │ │ │ ├── hpack_huffman_encoder.h │ │ │ ├── hpack_huffman_encoder_test.cc │ │ │ ├── hpack_huffman_transcoder_test.cc │ │ │ ├── huffman_spec_tables.cc │ │ │ └── huffman_spec_tables.h │ │ └── varint │ │ │ ├── hpack_varint_decoder.cc │ │ │ ├── hpack_varint_decoder.h │ │ │ ├── hpack_varint_decoder_test.cc │ │ │ ├── hpack_varint_encoder.cc │ │ │ ├── hpack_varint_encoder.h │ │ │ ├── hpack_varint_encoder_test.cc │ │ │ └── hpack_varint_round_trip_test.cc │ ├── http2_constants.cc │ ├── http2_constants.h │ ├── http2_constants_test.cc │ ├── http2_structures.cc │ ├── http2_structures.h │ ├── http2_structures_test.cc │ └── test_tools │ │ ├── frame_decoder_state_test_util.cc │ │ ├── frame_decoder_state_test_util.h │ │ ├── frame_parts.cc │ │ ├── frame_parts.h │ │ ├── frame_parts_collector.cc │ │ ├── frame_parts_collector.h │ │ ├── frame_parts_collector_listener.cc │ │ ├── frame_parts_collector_listener.h │ │ ├── hpack_block_builder.cc │ │ ├── hpack_block_builder.h │ │ ├── hpack_block_builder_test.cc │ │ ├── hpack_block_collector.cc │ │ ├── hpack_block_collector.h │ │ ├── hpack_entry_collector.cc │ │ ├── hpack_entry_collector.h │ │ ├── hpack_example.cc │ │ ├── hpack_example.h │ │ ├── hpack_example_test.cc │ │ ├── hpack_string_collector.cc │ │ ├── hpack_string_collector.h │ │ ├── http2_constants_test_util.cc │ │ ├── http2_constants_test_util.h │ │ ├── http2_frame_builder.cc │ │ ├── http2_frame_builder.h │ │ ├── http2_frame_builder_test.cc │ │ ├── http2_frame_decoder_listener_test_util.cc │ │ ├── http2_frame_decoder_listener_test_util.h │ │ ├── http2_random.cc │ │ ├── http2_random.h │ │ ├── http2_random_test.cc │ │ ├── http2_structure_decoder_test_util.cc │ │ ├── http2_structure_decoder_test_util.h │ │ ├── http2_structures_test_util.cc │ │ ├── http2_structures_test_util.h │ │ ├── payload_decoder_base_test_util.cc │ │ ├── payload_decoder_base_test_util.h │ │ ├── random_decoder_test_base.cc │ │ ├── random_decoder_test_base.h │ │ ├── random_decoder_test_base_test.cc │ │ ├── random_util.cc │ │ ├── random_util.h │ │ └── verify_macros.h ├── quic │ ├── bindings │ │ ├── quic_libevent.cc │ │ ├── quic_libevent.h │ │ └── quic_libevent_test.cc │ ├── core │ │ ├── batch_writer │ │ │ ├── quic_batch_writer_base.cc │ │ │ ├── quic_batch_writer_base.h │ │ │ ├── quic_batch_writer_buffer.cc │ │ │ ├── quic_batch_writer_buffer.h │ │ │ ├── quic_batch_writer_buffer_test.cc │ │ │ ├── quic_batch_writer_test.cc │ │ │ ├── quic_batch_writer_test.h │ │ │ ├── quic_gso_batch_writer.cc │ │ │ ├── quic_gso_batch_writer.h │ │ │ ├── quic_gso_batch_writer_test.cc │ │ │ ├── quic_sendmmsg_batch_writer.cc │ │ │ ├── quic_sendmmsg_batch_writer.h │ │ │ ├── quic_sendmmsg_batch_writer_test.cc │ │ │ └── xsk │ │ │ │ ├── quic_xdp_socket_utils.cc │ │ │ │ ├── quic_xdp_socket_utils.h │ │ │ │ ├── quic_xsk_batch_writer.cc │ │ │ │ ├── quic_xsk_batch_writer.h │ │ │ │ ├── quic_xsk_batch_writer_base.cc │ │ │ │ ├── quic_xsk_batch_writer_base.h │ │ │ │ ├── quic_xsk_batch_writer_buffer.cc │ │ │ │ ├── quic_xsk_batch_writer_buffer.h │ │ │ │ ├── quic_xsk_packet_reader.cc │ │ │ │ ├── quic_xsk_packet_reader.h │ │ │ │ ├── quic_xsk_packet_writer.cc │ │ │ │ ├── quic_xsk_packet_writer.h │ │ │ │ └── quic_xsk_types.h │ │ ├── chlo_extractor.cc │ │ ├── chlo_extractor.h │ │ ├── chlo_extractor_test.cc │ │ ├── congestion_control │ │ │ ├── bandwidth_sampler.cc │ │ │ ├── bandwidth_sampler.h │ │ │ ├── bandwidth_sampler_test.cc │ │ │ ├── bbr2_drain.cc │ │ │ ├── bbr2_drain.h │ │ │ ├── bbr2_misc.cc │ │ │ ├── bbr2_misc.h │ │ │ ├── bbr2_probe_bw.cc │ │ │ ├── bbr2_probe_bw.h │ │ │ ├── bbr2_probe_rtt.cc │ │ │ ├── bbr2_probe_rtt.h │ │ │ ├── bbr2_sender.cc │ │ │ ├── bbr2_sender.h │ │ │ ├── bbr2_simulator_test.cc │ │ │ ├── bbr2_startup.cc │ │ │ ├── bbr2_startup.h │ │ │ ├── bbr_sender.cc │ │ │ ├── bbr_sender.h │ │ │ ├── bbr_sender_test.cc │ │ │ ├── cubic_bytes.cc │ │ │ ├── cubic_bytes.h │ │ │ ├── cubic_bytes_test.cc │ │ │ ├── general_loss_algorithm.cc │ │ │ ├── general_loss_algorithm.h │ │ │ ├── general_loss_algorithm_test.cc │ │ │ ├── hybrid_slow_start.cc │ │ │ ├── hybrid_slow_start.h │ │ │ ├── hybrid_slow_start_test.cc │ │ │ ├── loss_detection_interface.h │ │ │ ├── pacing_sender.cc │ │ │ ├── pacing_sender.h │ │ │ ├── pacing_sender_test.cc │ │ │ ├── prr_sender.cc │ │ │ ├── prr_sender.h │ │ │ ├── prr_sender_test.cc │ │ │ ├── rtt_stats.cc │ │ │ ├── rtt_stats.h │ │ │ ├── rtt_stats_test.cc │ │ │ ├── send_algorithm_interface.cc │ │ │ ├── send_algorithm_interface.h │ │ │ ├── send_algorithm_test.cc │ │ │ ├── tcp_cubic_sender_bytes.cc │ │ │ ├── tcp_cubic_sender_bytes.h │ │ │ ├── tcp_cubic_sender_bytes_test.cc │ │ │ ├── uber_loss_algorithm.cc │ │ │ ├── uber_loss_algorithm.h │ │ │ ├── uber_loss_algorithm_test.cc │ │ │ ├── windowed_filter.h │ │ │ └── windowed_filter_test.cc │ │ ├── connection_id_generator.h │ │ ├── crypto │ │ │ ├── aead_base_decrypter.cc │ │ │ ├── aead_base_decrypter.h │ │ │ ├── aead_base_encrypter.cc │ │ │ ├── aead_base_encrypter.h │ │ │ ├── aes_128_gcm_12_decrypter.cc │ │ │ ├── aes_128_gcm_12_decrypter.h │ │ │ ├── aes_128_gcm_12_decrypter_test.cc │ │ │ ├── aes_128_gcm_12_encrypter.cc │ │ │ ├── aes_128_gcm_12_encrypter.h │ │ │ ├── aes_128_gcm_12_encrypter_test.cc │ │ │ ├── aes_128_gcm_decrypter.cc │ │ │ ├── aes_128_gcm_decrypter.h │ │ │ ├── aes_128_gcm_decrypter_test.cc │ │ │ ├── aes_128_gcm_encrypter.cc │ │ │ ├── aes_128_gcm_encrypter.h │ │ │ ├── aes_128_gcm_encrypter_test.cc │ │ │ ├── aes_256_gcm_decrypter.cc │ │ │ ├── aes_256_gcm_decrypter.h │ │ │ ├── aes_256_gcm_decrypter_test.cc │ │ │ ├── aes_256_gcm_encrypter.cc │ │ │ ├── aes_256_gcm_encrypter.h │ │ │ ├── aes_256_gcm_encrypter_test.cc │ │ │ ├── aes_base_decrypter.cc │ │ │ ├── aes_base_decrypter.h │ │ │ ├── aes_base_encrypter.cc │ │ │ ├── aes_base_encrypter.h │ │ │ ├── boring_utils.h │ │ │ ├── cert_compressor.cc │ │ │ ├── cert_compressor.h │ │ │ ├── cert_compressor_test.cc │ │ │ ├── certificate_util.cc │ │ │ ├── certificate_util.h │ │ │ ├── certificate_util_test.cc │ │ │ ├── certificate_view.cc │ │ │ ├── certificate_view.h │ │ │ ├── certificate_view_der_fuzzer.cc │ │ │ ├── certificate_view_pem_fuzzer.cc │ │ │ ├── certificate_view_test.cc │ │ │ ├── chacha20_poly1305_decrypter.cc │ │ │ ├── chacha20_poly1305_decrypter.h │ │ │ ├── chacha20_poly1305_decrypter_test.cc │ │ │ ├── chacha20_poly1305_encrypter.cc │ │ │ ├── chacha20_poly1305_encrypter.h │ │ │ ├── chacha20_poly1305_encrypter_test.cc │ │ │ ├── chacha20_poly1305_tls_decrypter.cc │ │ │ ├── chacha20_poly1305_tls_decrypter.h │ │ │ ├── chacha20_poly1305_tls_decrypter_test.cc │ │ │ ├── chacha20_poly1305_tls_encrypter.cc │ │ │ ├── chacha20_poly1305_tls_encrypter.h │ │ │ ├── chacha20_poly1305_tls_encrypter_test.cc │ │ │ ├── chacha_base_decrypter.cc │ │ │ ├── chacha_base_decrypter.h │ │ │ ├── chacha_base_encrypter.cc │ │ │ ├── chacha_base_encrypter.h │ │ │ ├── channel_id.cc │ │ │ ├── channel_id.h │ │ │ ├── channel_id_test.cc │ │ │ ├── client_proof_source.cc │ │ │ ├── client_proof_source.h │ │ │ ├── client_proof_source_test.cc │ │ │ ├── crypto_framer.cc │ │ │ ├── crypto_framer.h │ │ │ ├── crypto_framer_test.cc │ │ │ ├── crypto_handshake.cc │ │ │ ├── crypto_handshake.h │ │ │ ├── crypto_handshake_message.cc │ │ │ ├── crypto_handshake_message.h │ │ │ ├── crypto_handshake_message_test.cc │ │ │ ├── crypto_message_parser.h │ │ │ ├── crypto_protocol.h │ │ │ ├── crypto_secret_boxer.cc │ │ │ ├── crypto_secret_boxer.h │ │ │ ├── crypto_secret_boxer_test.cc │ │ │ ├── crypto_server_test.cc │ │ │ ├── crypto_utils.cc │ │ │ ├── crypto_utils.h │ │ │ ├── crypto_utils_test.cc │ │ │ ├── curve25519_key_exchange.cc │ │ │ ├── curve25519_key_exchange.h │ │ │ ├── curve25519_key_exchange_test.cc │ │ │ ├── key_exchange.cc │ │ │ ├── key_exchange.h │ │ │ ├── null_decrypter.cc │ │ │ ├── null_decrypter.h │ │ │ ├── null_decrypter_test.cc │ │ │ ├── null_encrypter.cc │ │ │ ├── null_encrypter.h │ │ │ ├── null_encrypter_test.cc │ │ │ ├── p256_key_exchange.cc │ │ │ ├── p256_key_exchange.h │ │ │ ├── p256_key_exchange_test.cc │ │ │ ├── proof_source.cc │ │ │ ├── proof_source.h │ │ │ ├── proof_source_x509.cc │ │ │ ├── proof_source_x509.h │ │ │ ├── proof_source_x509_test.cc │ │ │ ├── proof_verifier.h │ │ │ ├── quic_client_session_cache.cc │ │ │ ├── quic_client_session_cache.h │ │ │ ├── quic_client_session_cache_test.cc │ │ │ ├── quic_compressed_certs_cache.cc │ │ │ ├── quic_compressed_certs_cache.h │ │ │ ├── quic_compressed_certs_cache_test.cc │ │ │ ├── quic_crypter.cc │ │ │ ├── quic_crypter.h │ │ │ ├── quic_crypto_client_config.cc │ │ │ ├── quic_crypto_client_config.h │ │ │ ├── quic_crypto_client_config_test.cc │ │ │ ├── quic_crypto_proof.cc │ │ │ ├── quic_crypto_proof.h │ │ │ ├── quic_crypto_server_config.cc │ │ │ ├── quic_crypto_server_config.h │ │ │ ├── quic_crypto_server_config_test.cc │ │ │ ├── quic_decrypter.cc │ │ │ ├── quic_decrypter.h │ │ │ ├── quic_encrypter.cc │ │ │ ├── quic_encrypter.h │ │ │ ├── quic_hkdf.cc │ │ │ ├── quic_hkdf.h │ │ │ ├── quic_hkdf_test.cc │ │ │ ├── quic_random.cc │ │ │ ├── quic_random.h │ │ │ ├── quic_random_test.cc │ │ │ ├── tls_client_connection.cc │ │ │ ├── tls_client_connection.h │ │ │ ├── tls_connection.cc │ │ │ ├── tls_connection.h │ │ │ ├── tls_server_connection.cc │ │ │ ├── tls_server_connection.h │ │ │ ├── transport_parameters.cc │ │ │ ├── transport_parameters.h │ │ │ ├── transport_parameters_test.cc │ │ │ ├── web_transport_fingerprint_proof_verifier.cc │ │ │ ├── web_transport_fingerprint_proof_verifier.h │ │ │ └── web_transport_fingerprint_proof_verifier_test.cc │ │ ├── deterministic_connection_id_generator.cc │ │ ├── deterministic_connection_id_generator.h │ │ ├── deterministic_connection_id_generator_test.cc │ │ ├── frames │ │ │ ├── quic_ack_frame.cc │ │ │ ├── quic_ack_frame.h │ │ │ ├── quic_ack_frequency_frame.cc │ │ │ ├── quic_ack_frequency_frame.h │ │ │ ├── quic_blocked_frame.cc │ │ │ ├── quic_blocked_frame.h │ │ │ ├── quic_connection_close_frame.cc │ │ │ ├── quic_connection_close_frame.h │ │ │ ├── quic_crypto_frame.cc │ │ │ ├── quic_crypto_frame.h │ │ │ ├── quic_frame.cc │ │ │ ├── quic_frame.h │ │ │ ├── quic_frames_test.cc │ │ │ ├── quic_goaway_frame.cc │ │ │ ├── quic_goaway_frame.h │ │ │ ├── quic_handshake_done_frame.cc │ │ │ ├── quic_handshake_done_frame.h │ │ │ ├── quic_inlined_frame.h │ │ │ ├── quic_max_streams_frame.cc │ │ │ ├── quic_max_streams_frame.h │ │ │ ├── quic_message_frame.cc │ │ │ ├── quic_message_frame.h │ │ │ ├── quic_mtu_discovery_frame.h │ │ │ ├── quic_new_connection_id_frame.cc │ │ │ ├── quic_new_connection_id_frame.h │ │ │ ├── quic_new_token_frame.cc │ │ │ ├── quic_new_token_frame.h │ │ │ ├── quic_padding_frame.cc │ │ │ ├── quic_padding_frame.h │ │ │ ├── quic_path_challenge_frame.cc │ │ │ ├── quic_path_challenge_frame.h │ │ │ ├── quic_path_response_frame.cc │ │ │ ├── quic_path_response_frame.h │ │ │ ├── quic_ping_frame.cc │ │ │ ├── quic_ping_frame.h │ │ │ ├── quic_retire_connection_id_frame.cc │ │ │ ├── quic_retire_connection_id_frame.h │ │ │ ├── quic_rst_stream_frame.cc │ │ │ ├── quic_rst_stream_frame.h │ │ │ ├── quic_stop_sending_frame.cc │ │ │ ├── quic_stop_sending_frame.h │ │ │ ├── quic_stop_waiting_frame.cc │ │ │ ├── quic_stop_waiting_frame.h │ │ │ ├── quic_stream_frame.cc │ │ │ ├── quic_stream_frame.h │ │ │ ├── quic_streams_blocked_frame.cc │ │ │ ├── quic_streams_blocked_frame.h │ │ │ ├── quic_window_update_frame.cc │ │ │ └── quic_window_update_frame.h │ │ ├── handshaker_delegate_interface.h │ │ ├── http │ │ │ ├── capsule.cc │ │ │ ├── capsule.h │ │ │ ├── capsule_test.cc │ │ │ ├── end_to_end_test.cc │ │ │ ├── http_constants.cc │ │ │ ├── http_constants.h │ │ │ ├── http_decoder.cc │ │ │ ├── http_decoder.h │ │ │ ├── http_decoder_test.cc │ │ │ ├── http_encoder.cc │ │ │ ├── http_encoder.h │ │ │ ├── http_encoder_test.cc │ │ │ ├── http_frames.h │ │ │ ├── http_frames_test.cc │ │ │ ├── quic_client_promised_info.cc │ │ │ ├── quic_client_promised_info.h │ │ │ ├── quic_client_promised_info_test.cc │ │ │ ├── quic_client_push_promise_index.cc │ │ │ ├── quic_client_push_promise_index.h │ │ │ ├── quic_client_push_promise_index_test.cc │ │ │ ├── quic_header_list.cc │ │ │ ├── quic_header_list.h │ │ │ ├── quic_header_list_test.cc │ │ │ ├── quic_headers_stream.cc │ │ │ ├── quic_headers_stream.h │ │ │ ├── quic_headers_stream_test.cc │ │ │ ├── quic_receive_control_stream.cc │ │ │ ├── quic_receive_control_stream.h │ │ │ ├── quic_receive_control_stream_test.cc │ │ │ ├── quic_send_control_stream.cc │ │ │ ├── quic_send_control_stream.h │ │ │ ├── quic_send_control_stream_test.cc │ │ │ ├── quic_server_initiated_spdy_stream.cc │ │ │ ├── quic_server_initiated_spdy_stream.h │ │ │ ├── quic_server_session_base.cc │ │ │ ├── quic_server_session_base.h │ │ │ ├── quic_server_session_base_test.cc │ │ │ ├── quic_spdy_client_session.cc │ │ │ ├── quic_spdy_client_session.h │ │ │ ├── quic_spdy_client_session_base.cc │ │ │ ├── quic_spdy_client_session_base.h │ │ │ ├── quic_spdy_client_session_test.cc │ │ │ ├── quic_spdy_client_stream.cc │ │ │ ├── quic_spdy_client_stream.h │ │ │ ├── quic_spdy_client_stream_test.cc │ │ │ ├── quic_spdy_server_stream_base.cc │ │ │ ├── quic_spdy_server_stream_base.h │ │ │ ├── quic_spdy_server_stream_base_test.cc │ │ │ ├── quic_spdy_session.cc │ │ │ ├── quic_spdy_session.h │ │ │ ├── quic_spdy_session_test.cc │ │ │ ├── quic_spdy_stream.cc │ │ │ ├── quic_spdy_stream.h │ │ │ ├── quic_spdy_stream_body_manager.cc │ │ │ ├── quic_spdy_stream_body_manager.h │ │ │ ├── quic_spdy_stream_body_manager_test.cc │ │ │ ├── quic_spdy_stream_test.cc │ │ │ ├── spdy_server_push_utils.cc │ │ │ ├── spdy_server_push_utils.h │ │ │ ├── spdy_server_push_utils_test.cc │ │ │ ├── spdy_utils.cc │ │ │ ├── spdy_utils.h │ │ │ ├── spdy_utils_test.cc │ │ │ ├── web_transport_http3.cc │ │ │ ├── web_transport_http3.h │ │ │ ├── web_transport_http3_test.cc │ │ │ ├── web_transport_stream_adapter.cc │ │ │ └── web_transport_stream_adapter.h │ │ ├── io │ │ │ ├── connecting_client_socket.h │ │ │ ├── event_loop_socket_factory.cc │ │ │ ├── event_loop_socket_factory.h │ │ │ ├── event_loop_tcp_client_socket.cc │ │ │ ├── event_loop_tcp_client_socket.h │ │ │ ├── event_loop_tcp_client_socket_test.cc │ │ │ ├── quic_all_event_loops_test.cc │ │ │ ├── quic_default_event_loop.cc │ │ │ ├── quic_default_event_loop.h │ │ │ ├── quic_event_loop.h │ │ │ ├── quic_poll_event_loop.cc │ │ │ ├── quic_poll_event_loop.h │ │ │ ├── quic_poll_event_loop_test.cc │ │ │ ├── socket.h │ │ │ ├── socket_factory.h │ │ │ ├── socket_posix.cc │ │ │ └── socket_test.cc │ │ ├── legacy_quic_stream_id_manager.cc │ │ ├── legacy_quic_stream_id_manager.h │ │ ├── legacy_quic_stream_id_manager_test.cc │ │ ├── packet_number_indexed_queue.h │ │ ├── packet_number_indexed_queue_test.cc │ │ ├── proto │ │ │ ├── CMakeFiles │ │ │ │ ├── CMakeDirectoryInformation.cmake │ │ │ │ ├── QuicCoreProto.dir │ │ │ │ │ ├── DependInfo.cmake │ │ │ │ │ ├── build.make │ │ │ │ │ ├── cmake_clean.cmake │ │ │ │ │ ├── cmake_clean_target.cmake │ │ │ │ │ ├── compiler_depend.make │ │ │ │ │ ├── compiler_depend.ts │ │ │ │ │ ├── depend.make │ │ │ │ │ ├── flags.make │ │ │ │ │ ├── link.txt │ │ │ │ │ └── progress.make │ │ │ │ └── progress.marks │ │ │ ├── CMakeLists.txt │ │ │ ├── Makefile │ │ │ ├── cached_network_parameters.pb.cc │ │ │ ├── cached_network_parameters.pb.h │ │ │ ├── cached_network_parameters.proto │ │ │ ├── cached_network_parameters_proto.h │ │ │ ├── cmake_install.cmake │ │ │ ├── crypto_server_config.pb.cc │ │ │ ├── crypto_server_config.pb.h │ │ │ ├── crypto_server_config.proto │ │ │ ├── crypto_server_config_proto.h │ │ │ ├── source_address_token.pb.cc │ │ │ ├── source_address_token.pb.h │ │ │ ├── source_address_token.proto │ │ │ └── source_address_token_proto.h │ │ ├── qpack │ │ │ ├── fuzzer │ │ │ │ ├── qpack_decoder_fuzzer.cc │ │ │ │ ├── qpack_decoder_stream_receiver_fuzzer.cc │ │ │ │ ├── qpack_decoder_stream_sender_fuzzer.cc │ │ │ │ ├── qpack_encoder_stream_receiver_fuzzer.cc │ │ │ │ ├── qpack_encoder_stream_sender_fuzzer.cc │ │ │ │ └── qpack_round_trip_fuzzer.cc │ │ │ ├── qpack_blocking_manager.cc │ │ │ ├── qpack_blocking_manager.h │ │ │ ├── qpack_blocking_manager_test.cc │ │ │ ├── qpack_decoded_headers_accumulator.cc │ │ │ ├── qpack_decoded_headers_accumulator.h │ │ │ ├── qpack_decoded_headers_accumulator_test.cc │ │ │ ├── qpack_decoder.cc │ │ │ ├── qpack_decoder.h │ │ │ ├── qpack_decoder_stream_receiver.cc │ │ │ ├── qpack_decoder_stream_receiver.h │ │ │ ├── qpack_decoder_stream_receiver_test.cc │ │ │ ├── qpack_decoder_stream_sender.cc │ │ │ ├── qpack_decoder_stream_sender.h │ │ │ ├── qpack_decoder_stream_sender_test.cc │ │ │ ├── qpack_decoder_test.cc │ │ │ ├── qpack_encoder.cc │ │ │ ├── qpack_encoder.h │ │ │ ├── qpack_encoder_stream_receiver.cc │ │ │ ├── qpack_encoder_stream_receiver.h │ │ │ ├── qpack_encoder_stream_receiver_test.cc │ │ │ ├── qpack_encoder_stream_sender.cc │ │ │ ├── qpack_encoder_stream_sender.h │ │ │ ├── qpack_encoder_stream_sender_test.cc │ │ │ ├── qpack_encoder_test.cc │ │ │ ├── qpack_header_table.cc │ │ │ ├── qpack_header_table.h │ │ │ ├── qpack_header_table_test.cc │ │ │ ├── qpack_index_conversions.cc │ │ │ ├── qpack_index_conversions.h │ │ │ ├── qpack_index_conversions_test.cc │ │ │ ├── qpack_instruction_decoder.cc │ │ │ ├── qpack_instruction_decoder.h │ │ │ ├── qpack_instruction_decoder_test.cc │ │ │ ├── qpack_instruction_encoder.cc │ │ │ ├── qpack_instruction_encoder.h │ │ │ ├── qpack_instruction_encoder_test.cc │ │ │ ├── qpack_instructions.cc │ │ │ ├── qpack_instructions.h │ │ │ ├── qpack_progressive_decoder.cc │ │ │ ├── qpack_progressive_decoder.h │ │ │ ├── qpack_receive_stream.cc │ │ │ ├── qpack_receive_stream.h │ │ │ ├── qpack_receive_stream_test.cc │ │ │ ├── qpack_required_insert_count.cc │ │ │ ├── qpack_required_insert_count.h │ │ │ ├── qpack_required_insert_count_test.cc │ │ │ ├── qpack_round_trip_test.cc │ │ │ ├── qpack_send_stream.cc │ │ │ ├── qpack_send_stream.h │ │ │ ├── qpack_send_stream_test.cc │ │ │ ├── qpack_static_table.cc │ │ │ ├── qpack_static_table.h │ │ │ ├── qpack_static_table_test.cc │ │ │ ├── qpack_stream_receiver.h │ │ │ ├── qpack_stream_sender_delegate.h │ │ │ ├── value_splitting_header_list.cc │ │ │ ├── value_splitting_header_list.h │ │ │ └── value_splitting_header_list_test.cc │ │ ├── quic_ack_listener_interface.cc │ │ ├── quic_ack_listener_interface.h │ │ ├── quic_alarm.cc │ │ ├── quic_alarm.h │ │ ├── quic_alarm_factory.h │ │ ├── quic_alarm_test.cc │ │ ├── quic_arena_scoped_ptr.h │ │ ├── quic_arena_scoped_ptr_test.cc │ │ ├── quic_bandwidth.cc │ │ ├── quic_bandwidth.h │ │ ├── quic_bandwidth_test.cc │ │ ├── quic_blocked_writer_interface.h │ │ ├── quic_buffered_packet_store.cc │ │ ├── quic_buffered_packet_store.h │ │ ├── quic_buffered_packet_store_test.cc │ │ ├── quic_chaos_protector.cc │ │ ├── quic_chaos_protector.h │ │ ├── quic_chaos_protector_test.cc │ │ ├── quic_clock.cc │ │ ├── quic_clock.h │ │ ├── quic_coalesced_packet.cc │ │ ├── quic_coalesced_packet.h │ │ ├── quic_coalesced_packet_test.cc │ │ ├── quic_config.cc │ │ ├── quic_config.h │ │ ├── quic_config_test.cc │ │ ├── quic_connection.cc │ │ ├── quic_connection.h │ │ ├── quic_connection_context.cc │ │ ├── quic_connection_context.h │ │ ├── quic_connection_context_test.cc │ │ ├── quic_connection_id.cc │ │ ├── quic_connection_id.h │ │ ├── quic_connection_id_manager.cc │ │ ├── quic_connection_id_manager.h │ │ ├── quic_connection_id_manager_test.cc │ │ ├── quic_connection_id_test.cc │ │ ├── quic_connection_stats.cc │ │ ├── quic_connection_stats.h │ │ ├── quic_connection_test.cc │ │ ├── quic_constants.cc │ │ ├── quic_constants.h │ │ ├── quic_control_frame_manager.cc │ │ ├── quic_control_frame_manager.h │ │ ├── quic_control_frame_manager_test.cc │ │ ├── quic_crypto_client_handshaker.cc │ │ ├── quic_crypto_client_handshaker.h │ │ ├── quic_crypto_client_handshaker_test.cc │ │ ├── quic_crypto_client_stream.cc │ │ ├── quic_crypto_client_stream.h │ │ ├── quic_crypto_client_stream_test.cc │ │ ├── quic_crypto_handshaker.cc │ │ ├── quic_crypto_handshaker.h │ │ ├── quic_crypto_server_stream.cc │ │ ├── quic_crypto_server_stream.h │ │ ├── quic_crypto_server_stream_base.cc │ │ ├── quic_crypto_server_stream_base.h │ │ ├── quic_crypto_server_stream_test.cc │ │ ├── quic_crypto_stream.cc │ │ ├── quic_crypto_stream.h │ │ ├── quic_crypto_stream_test.cc │ │ ├── quic_data_reader.cc │ │ ├── quic_data_reader.h │ │ ├── quic_data_writer.cc │ │ ├── quic_data_writer.h │ │ ├── quic_data_writer_test.cc │ │ ├── quic_datagram_queue.cc │ │ ├── quic_datagram_queue.h │ │ ├── quic_datagram_queue_test.cc │ │ ├── quic_default_clock.cc │ │ ├── quic_default_clock.h │ │ ├── quic_default_connection_helper.h │ │ ├── quic_default_packet_writer.cc │ │ ├── quic_default_packet_writer.h │ │ ├── quic_dispatcher.cc │ │ ├── quic_dispatcher.h │ │ ├── quic_dispatcher_test.cc │ │ ├── quic_epoll_alarm_factory.cc │ │ ├── quic_epoll_alarm_factory.h │ │ ├── quic_epoll_alarm_factory_test.cc │ │ ├── quic_epoll_clock.cc │ │ ├── quic_epoll_clock.h │ │ ├── quic_epoll_clock_test.cc │ │ ├── quic_epoll_connection_helper.cc │ │ ├── quic_epoll_connection_helper.h │ │ ├── quic_epoll_connection_helper_test.cc │ │ ├── quic_error_codes.cc │ │ ├── quic_error_codes.h │ │ ├── quic_error_codes_test.cc │ │ ├── quic_flags_list.h │ │ ├── quic_flow_controller.cc │ │ ├── quic_flow_controller.h │ │ ├── quic_flow_controller_test.cc │ │ ├── quic_framer.cc │ │ ├── quic_framer.h │ │ ├── quic_framer_test.cc │ │ ├── quic_idle_network_detector.cc │ │ ├── quic_idle_network_detector.h │ │ ├── quic_idle_network_detector_test.cc │ │ ├── quic_interval.h │ │ ├── quic_interval_deque.h │ │ ├── quic_interval_deque_test.cc │ │ ├── quic_interval_set.h │ │ ├── quic_interval_set_test.cc │ │ ├── quic_interval_test.cc │ │ ├── quic_legacy_version_encapsulator.cc │ │ ├── quic_legacy_version_encapsulator.h │ │ ├── quic_legacy_version_encapsulator_test.cc │ │ ├── quic_linux_socket_utils.cc │ │ ├── quic_linux_socket_utils.h │ │ ├── quic_linux_socket_utils_test.cc │ │ ├── quic_lru_cache.h │ │ ├── quic_lru_cache_test.cc │ │ ├── quic_mtu_discovery.cc │ │ ├── quic_mtu_discovery.h │ │ ├── quic_network_blackhole_detector.cc │ │ ├── quic_network_blackhole_detector.h │ │ ├── quic_network_blackhole_detector_test.cc │ │ ├── quic_one_block_arena.h │ │ ├── quic_one_block_arena_test.cc │ │ ├── quic_packet_creator.cc │ │ ├── quic_packet_creator.h │ │ ├── quic_packet_creator_test.cc │ │ ├── quic_packet_number.cc │ │ ├── quic_packet_number.h │ │ ├── quic_packet_number_test.cc │ │ ├── quic_packet_reader.cc │ │ ├── quic_packet_reader.h │ │ ├── quic_packet_writer.h │ │ ├── quic_packet_writer_wrapper.cc │ │ ├── quic_packet_writer_wrapper.h │ │ ├── quic_packets.cc │ │ ├── quic_packets.h │ │ ├── quic_packets_test.cc │ │ ├── quic_path_validator.cc │ │ ├── quic_path_validator.h │ │ ├── quic_path_validator_test.cc │ │ ├── quic_ping_manager.cc │ │ ├── quic_ping_manager.h │ │ ├── quic_ping_manager_test.cc │ │ ├── quic_process_packet_interface.h │ │ ├── quic_protocol_flags_list.h │ │ ├── quic_received_packet_manager.cc │ │ ├── quic_received_packet_manager.h │ │ ├── quic_received_packet_manager_test.cc │ │ ├── quic_sent_packet_manager.cc │ │ ├── quic_sent_packet_manager.h │ │ ├── quic_sent_packet_manager_test.cc │ │ ├── quic_server_id.cc │ │ ├── quic_server_id.h │ │ ├── quic_server_id_test.cc │ │ ├── quic_session.cc │ │ ├── quic_session.h │ │ ├── quic_session_test.cc │ │ ├── quic_socket_address_coder.cc │ │ ├── quic_socket_address_coder.h │ │ ├── quic_socket_address_coder_test.cc │ │ ├── quic_stream.cc │ │ ├── quic_stream.h │ │ ├── quic_stream_frame_data_producer.h │ │ ├── quic_stream_id_manager.cc │ │ ├── quic_stream_id_manager.h │ │ ├── quic_stream_id_manager_test.cc │ │ ├── quic_stream_send_buffer.cc │ │ ├── quic_stream_send_buffer.h │ │ ├── quic_stream_send_buffer_test.cc │ │ ├── quic_stream_sequencer.cc │ │ ├── quic_stream_sequencer.h │ │ ├── quic_stream_sequencer_buffer.cc │ │ ├── quic_stream_sequencer_buffer.h │ │ ├── quic_stream_sequencer_buffer_test.cc │ │ ├── quic_stream_sequencer_test.cc │ │ ├── quic_stream_test.cc │ │ ├── quic_sustained_bandwidth_recorder.cc │ │ ├── quic_sustained_bandwidth_recorder.h │ │ ├── quic_sustained_bandwidth_recorder_test.cc │ │ ├── quic_syscall_wrapper.cc │ │ ├── quic_syscall_wrapper.h │ │ ├── quic_tag.cc │ │ ├── quic_tag.h │ │ ├── quic_tag_test.cc │ │ ├── quic_time.cc │ │ ├── quic_time.h │ │ ├── quic_time_accumulator.h │ │ ├── quic_time_accumulator_test.cc │ │ ├── quic_time_test.cc │ │ ├── quic_time_wait_list_manager.cc │ │ ├── quic_time_wait_list_manager.h │ │ ├── quic_time_wait_list_manager_test.cc │ │ ├── quic_trace_visitor.cc │ │ ├── quic_trace_visitor.h │ │ ├── quic_trace_visitor_test.cc │ │ ├── quic_transmission_info.cc │ │ ├── quic_transmission_info.h │ │ ├── quic_types.cc │ │ ├── quic_types.h │ │ ├── quic_udp_socket.h │ │ ├── quic_udp_socket_posix.cc │ │ ├── quic_unacked_packet_map.cc │ │ ├── quic_unacked_packet_map.h │ │ ├── quic_unacked_packet_map_test.cc │ │ ├── quic_utils.cc │ │ ├── quic_utils.h │ │ ├── quic_utils_test.cc │ │ ├── quic_version_manager.cc │ │ ├── quic_version_manager.h │ │ ├── quic_version_manager_test.cc │ │ ├── quic_versions.cc │ │ ├── quic_versions.h │ │ ├── quic_versions_test.cc │ │ ├── quic_write_blocked_list.cc │ │ ├── quic_write_blocked_list.h │ │ ├── quic_write_blocked_list_test.cc │ │ ├── session_notifier_interface.h │ │ ├── stream_delegate_interface.h │ │ ├── tls_chlo_extractor.cc │ │ ├── tls_chlo_extractor.h │ │ ├── tls_chlo_extractor_test.cc │ │ ├── tls_client_handshaker.cc │ │ ├── tls_client_handshaker.h │ │ ├── tls_client_handshaker_test.cc │ │ ├── tls_handshaker.cc │ │ ├── tls_handshaker.h │ │ ├── tls_server_handshaker.cc │ │ ├── tls_server_handshaker.h │ │ ├── tls_server_handshaker_test.cc │ │ ├── uber_quic_stream_id_manager.cc │ │ ├── uber_quic_stream_id_manager.h │ │ ├── uber_quic_stream_id_manager_test.cc │ │ ├── uber_received_packet_manager.cc │ │ ├── uber_received_packet_manager.h │ │ ├── uber_received_packet_manager_test.cc │ │ └── web_transport_interface.h │ ├── load_balancer │ │ ├── load_balancer_config.cc │ │ ├── load_balancer_config.h │ │ ├── load_balancer_config_test.cc │ │ ├── load_balancer_decoder.cc │ │ ├── load_balancer_decoder.h │ │ ├── load_balancer_decoder_test.cc │ │ ├── load_balancer_encoder.cc │ │ ├── load_balancer_encoder.h │ │ ├── load_balancer_encoder_test.cc │ │ ├── load_balancer_server_id.cc │ │ ├── load_balancer_server_id.h │ │ ├── load_balancer_server_id_map.h │ │ ├── load_balancer_server_id_map_test.cc │ │ └── load_balancer_server_id_test.cc │ ├── masque │ │ ├── README.md │ │ ├── masque_client_bin.cc │ │ ├── masque_client_session.cc │ │ ├── masque_client_session.h │ │ ├── masque_client_tools.cc │ │ ├── masque_client_tools.h │ │ ├── masque_dispatcher.cc │ │ ├── masque_dispatcher.h │ │ ├── masque_encapsulated_client_session.cc │ │ ├── masque_encapsulated_client_session.h │ │ ├── masque_encapsulated_epoll_client.cc │ │ ├── masque_encapsulated_epoll_client.h │ │ ├── masque_epoll_client.cc │ │ ├── masque_epoll_client.h │ │ ├── masque_epoll_server.cc │ │ ├── masque_epoll_server.h │ │ ├── masque_server_backend.cc │ │ ├── masque_server_backend.h │ │ ├── masque_server_bin.cc │ │ ├── masque_server_session.cc │ │ ├── masque_server_session.h │ │ ├── masque_utils.cc │ │ └── masque_utils.h │ ├── platform │ │ ├── README.md │ │ └── api │ │ │ ├── README.md │ │ │ ├── quic_bug_tracker.h │ │ │ ├── quic_client_stats.h │ │ │ ├── quic_default_proof_providers.h │ │ │ ├── quic_epoll.h │ │ │ ├── quic_expect_bug.h │ │ │ ├── quic_export.h │ │ │ ├── quic_exported_stats.h │ │ │ ├── quic_flag_utils.h │ │ │ ├── quic_flags.h │ │ │ ├── quic_hostname_utils.h │ │ │ ├── quic_ip_address.h │ │ │ ├── quic_ip_address_family.h │ │ │ ├── quic_logging.h │ │ │ ├── quic_mutex.h │ │ │ ├── quic_server_stats.h │ │ │ ├── quic_socket_address.cc │ │ │ ├── quic_socket_address.h │ │ │ ├── quic_socket_address_test.cc │ │ │ ├── quic_stack_trace.h │ │ │ ├── quic_test.h │ │ │ ├── quic_test_loopback.h │ │ │ ├── quic_test_output.h │ │ │ ├── quic_testvalue.h │ │ │ ├── quic_thread.h │ │ │ └── quic_udp_socket_platform_api.h │ ├── proto_test │ │ ├── SpdyFramerVisitor.cc │ │ ├── SpdyFramerVisitor.h │ │ ├── client_session.cc │ │ ├── client_session.h │ │ ├── common_visitor.cc │ │ ├── common_visitor.h │ │ ├── config.h │ │ ├── hand_shake_visitor.cc │ │ ├── hand_shake_visitor.h │ │ ├── main.cc │ │ ├── packet_reader.h │ │ ├── pcap_reader.cc │ │ ├── pcap_reader.h │ │ ├── server_session.cc │ │ ├── server_session.h │ │ ├── session.cc │ │ ├── session.h │ │ └── test_visitor.h │ ├── qbone │ │ ├── bonnet │ │ │ ├── icmp_reachable.cc │ │ │ ├── icmp_reachable.h │ │ │ ├── icmp_reachable_interface.h │ │ │ ├── icmp_reachable_test.cc │ │ │ ├── mock_icmp_reachable.h │ │ │ ├── mock_packet_exchanger_stats_interface.h │ │ │ ├── mock_qbone_tunnel.h │ │ │ ├── mock_tun_device.h │ │ │ ├── mock_tun_device_controller.h │ │ │ ├── qbone_tunnel_info.cc │ │ │ ├── qbone_tunnel_info.h │ │ │ ├── qbone_tunnel_interface.h │ │ │ ├── qbone_tunnel_silo.cc │ │ │ ├── qbone_tunnel_silo.h │ │ │ ├── qbone_tunnel_silo_test.cc │ │ │ ├── tun_device.cc │ │ │ ├── tun_device.h │ │ │ ├── tun_device_controller.cc │ │ │ ├── tun_device_controller.h │ │ │ ├── tun_device_controller_test.cc │ │ │ ├── tun_device_interface.h │ │ │ ├── tun_device_packet_exchanger.cc │ │ │ ├── tun_device_packet_exchanger.h │ │ │ ├── tun_device_packet_exchanger_test.cc │ │ │ └── tun_device_test.cc │ │ ├── mock_qbone_client.h │ │ ├── mock_qbone_server_session.h │ │ ├── platform │ │ │ ├── icmp_packet.cc │ │ │ ├── icmp_packet.h │ │ │ ├── icmp_packet_test.cc │ │ │ ├── internet_checksum.cc │ │ │ ├── internet_checksum.h │ │ │ ├── internet_checksum_test.cc │ │ │ ├── ip_range.cc │ │ │ ├── ip_range.h │ │ │ ├── ip_range_test.cc │ │ │ ├── kernel_interface.h │ │ │ ├── mock_kernel.h │ │ │ ├── mock_netlink.h │ │ │ ├── netlink.cc │ │ │ ├── netlink.h │ │ │ ├── netlink_interface.h │ │ │ ├── netlink_test.cc │ │ │ ├── rtnetlink_message.cc │ │ │ ├── rtnetlink_message.h │ │ │ ├── rtnetlink_message_test.cc │ │ │ ├── tcp_packet.cc │ │ │ ├── tcp_packet.h │ │ │ └── tcp_packet_test.cc │ │ ├── qbone_client.cc │ │ ├── qbone_client.h │ │ ├── qbone_client_interface.h │ │ ├── qbone_client_session.cc │ │ ├── qbone_client_session.h │ │ ├── qbone_client_test.cc │ │ ├── qbone_constants.cc │ │ ├── qbone_constants.h │ │ ├── qbone_control.proto │ │ ├── qbone_control_placeholder.proto │ │ ├── qbone_control_stream.cc │ │ ├── qbone_control_stream.h │ │ ├── qbone_packet_exchanger.cc │ │ ├── qbone_packet_exchanger.h │ │ ├── qbone_packet_exchanger_test.cc │ │ ├── qbone_packet_processor.cc │ │ ├── qbone_packet_processor.h │ │ ├── qbone_packet_processor_test.cc │ │ ├── qbone_packet_processor_test_tools.cc │ │ ├── qbone_packet_processor_test_tools.h │ │ ├── qbone_packet_writer.h │ │ ├── qbone_server_session.cc │ │ ├── qbone_server_session.h │ │ ├── qbone_session_base.cc │ │ ├── qbone_session_base.h │ │ ├── qbone_session_test.cc │ │ ├── qbone_stream.cc │ │ ├── qbone_stream.h │ │ └── qbone_stream_test.cc │ ├── quic_transport │ │ └── README.md │ ├── test_tools │ │ ├── bad_packet_writer.cc │ │ ├── bad_packet_writer.h │ │ ├── crypto_test_utils.cc │ │ ├── crypto_test_utils.h │ │ ├── crypto_test_utils_test.cc │ │ ├── failing_proof_source.cc │ │ ├── failing_proof_source.h │ │ ├── fake_proof_source.cc │ │ ├── fake_proof_source.h │ │ ├── fake_proof_source_handle.cc │ │ ├── fake_proof_source_handle.h │ │ ├── first_flight.cc │ │ ├── first_flight.h │ │ ├── fuzzing │ │ │ ├── README.md │ │ │ ├── quic_framer_fuzzer.cc │ │ │ └── quic_framer_process_data_packet_fuzzer.cc │ │ ├── limited_mtu_test_writer.cc │ │ ├── limited_mtu_test_writer.h │ │ ├── mock_clock.cc │ │ ├── mock_clock.h │ │ ├── mock_connection_id_generator.h │ │ ├── mock_quic_client_promised_info.cc │ │ ├── mock_quic_client_promised_info.h │ │ ├── mock_quic_dispatcher.cc │ │ ├── mock_quic_dispatcher.h │ │ ├── mock_quic_session_visitor.cc │ │ ├── mock_quic_session_visitor.h │ │ ├── mock_quic_spdy_client_stream.cc │ │ ├── mock_quic_spdy_client_stream.h │ │ ├── mock_quic_time_wait_list_manager.cc │ │ ├── mock_quic_time_wait_list_manager.h │ │ ├── mock_random.cc │ │ ├── mock_random.h │ │ ├── packet_dropping_test_writer.cc │ │ ├── packet_dropping_test_writer.h │ │ ├── packet_reordering_writer.cc │ │ ├── packet_reordering_writer.h │ │ ├── qpack │ │ │ ├── qpack_decoder_test_utils.cc │ │ │ ├── qpack_decoder_test_utils.h │ │ │ ├── qpack_encoder_peer.cc │ │ │ ├── qpack_encoder_peer.h │ │ │ ├── qpack_offline_decoder.cc │ │ │ ├── qpack_offline_decoder.h │ │ │ ├── qpack_test_utils.cc │ │ │ └── qpack_test_utils.h │ │ ├── quic_buffered_packet_store_peer.cc │ │ ├── quic_buffered_packet_store_peer.h │ │ ├── quic_client_promised_info_peer.cc │ │ ├── quic_client_promised_info_peer.h │ │ ├── quic_client_session_cache_peer.h │ │ ├── quic_coalesced_packet_peer.cc │ │ ├── quic_coalesced_packet_peer.h │ │ ├── quic_config_peer.cc │ │ ├── quic_config_peer.h │ │ ├── quic_connection_id_manager_peer.h │ │ ├── quic_connection_peer.cc │ │ ├── quic_connection_peer.h │ │ ├── quic_crypto_server_config_peer.cc │ │ ├── quic_crypto_server_config_peer.h │ │ ├── quic_dispatcher_peer.cc │ │ ├── quic_dispatcher_peer.h │ │ ├── quic_flow_controller_peer.cc │ │ ├── quic_flow_controller_peer.h │ │ ├── quic_framer_peer.cc │ │ ├── quic_framer_peer.h │ │ ├── quic_http_response_cache_data │ │ │ └── test.example.com │ │ │ │ ├── index.html │ │ │ │ └── map.html │ │ ├── quic_interval_deque_peer.h │ │ ├── quic_mock_syscall_wrapper.cc │ │ ├── quic_mock_syscall_wrapper.h │ │ ├── quic_packet_creator_peer.cc │ │ ├── quic_packet_creator_peer.h │ │ ├── quic_path_validator_peer.cc │ │ ├── quic_path_validator_peer.h │ │ ├── quic_sent_packet_manager_peer.cc │ │ ├── quic_sent_packet_manager_peer.h │ │ ├── quic_server_peer.cc │ │ ├── quic_server_peer.h │ │ ├── quic_server_session_base_peer.h │ │ ├── quic_session_peer.cc │ │ ├── quic_session_peer.h │ │ ├── quic_spdy_session_peer.cc │ │ ├── quic_spdy_session_peer.h │ │ ├── quic_spdy_stream_peer.cc │ │ ├── quic_spdy_stream_peer.h │ │ ├── quic_stream_id_manager_peer.cc │ │ ├── quic_stream_id_manager_peer.h │ │ ├── quic_stream_peer.cc │ │ ├── quic_stream_peer.h │ │ ├── quic_stream_send_buffer_peer.cc │ │ ├── quic_stream_send_buffer_peer.h │ │ ├── quic_stream_sequencer_buffer_peer.cc │ │ ├── quic_stream_sequencer_buffer_peer.h │ │ ├── quic_stream_sequencer_peer.cc │ │ ├── quic_stream_sequencer_peer.h │ │ ├── quic_sustained_bandwidth_recorder_peer.cc │ │ ├── quic_sustained_bandwidth_recorder_peer.h │ │ ├── quic_test_backend.cc │ │ ├── quic_test_backend.h │ │ ├── quic_test_client.cc │ │ ├── quic_test_client.h │ │ ├── quic_test_server.cc │ │ ├── quic_test_server.h │ │ ├── quic_test_utils.cc │ │ ├── quic_test_utils.h │ │ ├── quic_test_utils_test.cc │ │ ├── quic_time_wait_list_manager_peer.cc │ │ ├── quic_time_wait_list_manager_peer.h │ │ ├── quic_unacked_packet_map_peer.cc │ │ ├── quic_unacked_packet_map_peer.h │ │ ├── rtt_stats_peer.cc │ │ ├── rtt_stats_peer.h │ │ ├── send_algorithm_test_result.proto │ │ ├── send_algorithm_test_utils.cc │ │ ├── send_algorithm_test_utils.h │ │ ├── server_thread.cc │ │ ├── server_thread.h │ │ ├── simple_data_producer.cc │ │ ├── simple_data_producer.h │ │ ├── simple_quic_framer.cc │ │ ├── simple_quic_framer.h │ │ ├── simple_session_cache.cc │ │ ├── simple_session_cache.h │ │ ├── simple_session_notifier.cc │ │ ├── simple_session_notifier.h │ │ ├── simple_session_notifier_test.cc │ │ ├── simulator │ │ │ ├── README.md │ │ │ ├── actor.cc │ │ │ ├── actor.h │ │ │ ├── alarm_factory.cc │ │ │ ├── alarm_factory.h │ │ │ ├── link.cc │ │ │ ├── link.h │ │ │ ├── packet_filter.cc │ │ │ ├── packet_filter.h │ │ │ ├── port.cc │ │ │ ├── port.h │ │ │ ├── queue.cc │ │ │ ├── queue.h │ │ │ ├── quic_endpoint.cc │ │ │ ├── quic_endpoint.h │ │ │ ├── quic_endpoint_base.cc │ │ │ ├── quic_endpoint_base.h │ │ │ ├── quic_endpoint_test.cc │ │ │ ├── simulator.cc │ │ │ ├── simulator.h │ │ │ ├── simulator_test.cc │ │ │ ├── switch.cc │ │ │ ├── switch.h │ │ │ ├── test_harness.cc │ │ │ ├── test_harness.h │ │ │ ├── traffic_policer.cc │ │ │ └── traffic_policer.h │ │ ├── test_certificates.cc │ │ ├── test_certificates.h │ │ ├── test_ticket_crypter.cc │ │ ├── test_ticket_crypter.h │ │ ├── web_transport_resets_backend.cc │ │ ├── web_transport_resets_backend.h │ │ └── web_transport_test_tools.h │ └── tools │ │ ├── connect_server_backend.cc │ │ ├── connect_server_backend.h │ │ ├── connect_tunnel.cc │ │ ├── connect_tunnel.h │ │ ├── connect_tunnel_test.cc │ │ ├── crypto_message_printer_bin.cc │ │ ├── fake_proof_verifier.h │ │ ├── qpack_offline_decoder_bin.cc │ │ ├── quic_backend_response.cc │ │ ├── quic_backend_response.h │ │ ├── quic_client.cc │ │ ├── quic_client.h │ │ ├── quic_client_base.cc │ │ ├── quic_client_base.h │ │ ├── quic_client_bin.cc │ │ ├── quic_client_default_network_helper.cc │ │ ├── quic_client_default_network_helper.h │ │ ├── quic_client_epoll_network_helper.cc │ │ ├── quic_client_epoll_network_helper.h │ │ ├── quic_client_interop_test_bin.cc │ │ ├── quic_client_test.cc │ │ ├── quic_default_client.cc │ │ ├── quic_default_client.h │ │ ├── quic_default_client_test.cc │ │ ├── quic_epoll_client_factory.cc │ │ ├── quic_epoll_client_factory.h │ │ ├── quic_memory_cache_backend.cc │ │ ├── quic_memory_cache_backend.h │ │ ├── quic_memory_cache_backend_test.cc │ │ ├── quic_name_lookup.cc │ │ ├── quic_name_lookup.h │ │ ├── quic_packet_printer_bin.cc │ │ ├── quic_reject_reason_decoder_bin.cc │ │ ├── quic_server.cc │ │ ├── quic_server.h │ │ ├── quic_server_bin.cc │ │ ├── quic_server_factory.cc │ │ ├── quic_server_factory.h │ │ ├── quic_server_test.cc │ │ ├── quic_simple_client_session.cc │ │ ├── quic_simple_client_session.h │ │ ├── quic_simple_client_stream.cc │ │ ├── quic_simple_client_stream.h │ │ ├── quic_simple_crypto_server_stream_helper.cc │ │ ├── quic_simple_crypto_server_stream_helper.h │ │ ├── quic_simple_dispatcher.cc │ │ ├── quic_simple_dispatcher.h │ │ ├── quic_simple_server_backend.h │ │ ├── quic_simple_server_session.cc │ │ ├── quic_simple_server_session.h │ │ ├── quic_simple_server_session_test.cc │ │ ├── quic_simple_server_stream.cc │ │ ├── quic_simple_server_stream.h │ │ ├── quic_simple_server_stream_test.cc │ │ ├── quic_spdy_client_base.cc │ │ ├── quic_spdy_client_base.h │ │ ├── quic_spdy_server_base.h │ │ ├── quic_tcp_like_trace_converter.cc │ │ ├── quic_tcp_like_trace_converter.h │ │ ├── quic_tcp_like_trace_converter_test.cc │ │ ├── quic_toy_client.cc │ │ ├── quic_toy_client.h │ │ ├── quic_toy_server.cc │ │ ├── quic_toy_server.h │ │ ├── quic_url.cc │ │ ├── quic_url.h │ │ ├── quic_url_test.cc │ │ ├── simple_ticket_crypter.cc │ │ ├── simple_ticket_crypter.h │ │ ├── simple_ticket_crypter_test.cc │ │ └── web_transport_test_visitors.h └── spdy │ ├── core │ ├── array_output_buffer.cc │ ├── array_output_buffer.h │ ├── array_output_buffer_test.cc │ ├── header_byte_listener_interface.h │ ├── hpack │ │ ├── hpack_constants.cc │ │ ├── hpack_constants.h │ │ ├── hpack_decoder_adapter.cc │ │ ├── hpack_decoder_adapter.h │ │ ├── hpack_decoder_adapter_test.cc │ │ ├── hpack_encoder.cc │ │ ├── hpack_encoder.h │ │ ├── hpack_encoder_test.cc │ │ ├── hpack_entry.cc │ │ ├── hpack_entry.h │ │ ├── hpack_entry_test.cc │ │ ├── hpack_header_table.cc │ │ ├── hpack_header_table.h │ │ ├── hpack_header_table_test.cc │ │ ├── hpack_output_stream.cc │ │ ├── hpack_output_stream.h │ │ ├── hpack_output_stream_test.cc │ │ ├── hpack_round_trip_test.cc │ │ ├── hpack_static_table.cc │ │ ├── hpack_static_table.h │ │ └── hpack_static_table_test.cc │ ├── http2_frame_decoder_adapter.cc │ ├── http2_frame_decoder_adapter.h │ ├── http2_header_block.cc │ ├── http2_header_block.h │ ├── http2_header_block_hpack_listener.h │ ├── http2_header_block_test.cc │ ├── http2_header_storage.cc │ ├── http2_header_storage.h │ ├── http2_header_storage_test.cc │ ├── metadata_extension.cc │ ├── metadata_extension.h │ ├── metadata_extension_test.cc │ ├── no_op_headers_handler.h │ ├── recording_headers_handler.cc │ ├── recording_headers_handler.h │ ├── spdy_alt_svc_wire_format.cc │ ├── spdy_alt_svc_wire_format.h │ ├── spdy_alt_svc_wire_format_test.cc │ ├── spdy_bitmasks.h │ ├── spdy_frame_builder.cc │ ├── spdy_frame_builder.h │ ├── spdy_frame_builder_test.cc │ ├── spdy_framer.cc │ ├── spdy_framer.h │ ├── spdy_framer_test.cc │ ├── spdy_headers_handler_interface.h │ ├── spdy_intrusive_list.h │ ├── spdy_intrusive_list_test.cc │ ├── spdy_no_op_visitor.cc │ ├── spdy_no_op_visitor.h │ ├── spdy_pinnable_buffer_piece.cc │ ├── spdy_pinnable_buffer_piece.h │ ├── spdy_pinnable_buffer_piece_test.cc │ ├── spdy_prefixed_buffer_reader.cc │ ├── spdy_prefixed_buffer_reader.h │ ├── spdy_prefixed_buffer_reader_test.cc │ ├── spdy_protocol.cc │ ├── spdy_protocol.h │ ├── spdy_protocol_test.cc │ ├── spdy_simple_arena.cc │ ├── spdy_simple_arena.h │ ├── spdy_simple_arena_test.cc │ └── zero_copy_output_buffer.h │ └── test_tools │ ├── mock_spdy_framer_visitor.cc │ ├── mock_spdy_framer_visitor.h │ ├── spdy_test_utils.cc │ └── spdy_test_utils.h ├── net ├── base │ ├── io_buffer.cc │ └── io_buffer.h └── http │ ├── http_request_headers.cc │ ├── http_request_headers.h │ ├── http_util.cc │ └── http_util.h ├── platform ├── base64.cc ├── base64.h ├── byte_order.h ├── epoll_platform_impl │ ├── epoll_bug_impl.h │ ├── epoll_export_impl.h │ ├── epoll_logging_impl.h │ ├── epoll_ptr_util_impl.h │ ├── epoll_time_impl.h │ ├── quic_epoll_clock.cc │ └── quic_epoll_clock.h ├── http2_platform_impl │ ├── http2_arraysize_impl.h │ ├── http2_bug_tracker_impl.h │ ├── http2_containers_impl.h │ ├── http2_estimate_memory_usage_impl.h │ ├── http2_flag_utils_impl.h │ ├── http2_flags_impl.h │ ├── http2_logging_impl.h │ ├── http2_macros_impl.h │ └── http2_string_utils_impl.h ├── mem_slice_buffer.cc ├── mem_slice_buffer.h ├── platform.h ├── quic_platform_impl │ ├── quic_bug_tracker_impl.h │ ├── quic_cert_utils_impl.cc │ ├── quic_cert_utils_impl.h │ ├── quic_client_stats_impl.h │ ├── quic_containers_impl.h │ ├── quic_default_proof_providers_impl.cc │ ├── quic_default_proof_providers_impl.h │ ├── quic_epoll_impl.h │ ├── quic_error_code_wrappers_impl.h │ ├── quic_expect_bug_impl.h │ ├── quic_file_utils_impl.cc │ ├── quic_file_utils_impl.h │ ├── quic_hostname_utils_impl.cc │ ├── quic_hostname_utils_impl.h │ ├── quic_iovec_impl.h │ ├── quic_map_util_impl.h │ ├── quic_mem_slice_impl.cc │ ├── quic_mem_slice_impl.h │ ├── quic_mem_slice_span_impl.cc │ ├── quic_mem_slice_span_impl.h │ ├── quic_mem_slice_storage_impl.cc │ ├── quic_mem_slice_storage_impl.h │ ├── quic_prefetch_impl.h │ ├── quic_reference_counted_impl.h │ ├── quic_server_stats_impl.h │ ├── quic_sleep_impl.h │ ├── quic_stack_trace_impl.h │ ├── quic_stream_buffer_allocator_impl.h │ ├── quic_system_event_loop_impl.h │ ├── quic_test_impl.h │ ├── quic_testvalue_impl.h │ ├── quic_thread_impl.h │ └── quic_udp_socket_platform_impl.h ├── quiche_platform_impl │ ├── flags_impl.cc │ ├── flags_impl.h │ ├── quic_mutex_impl.cc │ ├── quic_mutex_impl.h │ ├── quic_testvalue_impl.h │ ├── quiche_bug_tracker_impl.h │ ├── quiche_containers_impl.h │ ├── quiche_estimate_memory_usage_impl.h │ ├── quiche_export_impl.h │ ├── quiche_flag_utils_impl.h │ ├── quiche_flags_impl.h │ ├── quiche_logging_impl.cc │ ├── quiche_logging_impl.h │ ├── quiche_optional_impl.h │ ├── quiche_string_piece_impl.h │ ├── quiche_text_utils_impl.h │ ├── quiche_time_utils_impl.cc │ └── quiche_time_utils_impl.h ├── spdy_platform_impl │ ├── spdy_containers_impl.h │ └── spdy_string_utils_impl.h ├── string_utils.cc └── string_utils.h └── utils ├── ca.cnf ├── generate-certs.sh ├── google_quiche_rewrite.sh └── leaf.cnf /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | /build 35 | /third_party/* 36 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/abseil-cpp"] 2 | path = third_party/abseil-cpp 3 | url = https://github.com/abseil/abseil-cpp.git 4 | [submodule "third_party/spdlog"] 5 | path = third_party/spdlog 6 | url = https://github.com/gabime/spdlog.git 7 | [submodule "third_party/fmt"] 8 | path = third_party/fmt 9 | url = https://github.com/fmtlib/fmt.git 10 | [submodule "third_party/boringssl"] 11 | path = third_party/boringssl 12 | url = https://github.com/google/boringssl.git 13 | [submodule "third_party/rapidjson"] 14 | path = third_party/rapidjson 15 | url = https://github.com/Tencent/rapidjson.git 16 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | chromium_tag: 107.0.5304.62 2 | quiche_version: a80d590 3 | boringssl_version: 19009c5 4 | googleurl_version: 4c7645e 5 | absl_version: 1be36c8a 6 | 7 | -------------------------------------------------------------------------------- /base/files/file_path_constants.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | #include "base/files/file_path.h" 8 | 9 | namespace base { 10 | 11 | #if defined(FILE_PATH_USES_WIN_SEPARATORS) 12 | const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("\\/"); 13 | #else // FILE_PATH_USES_WIN_SEPARATORS 14 | const FilePath::CharType FilePath::kSeparators[] = FILE_PATH_LITERAL("/"); 15 | #endif // FILE_PATH_USES_WIN_SEPARATORS 16 | 17 | const size_t FilePath::kSeparatorsLength = std::size(kSeparators); 18 | 19 | const FilePath::CharType FilePath::kCurrentDirectory[] = FILE_PATH_LITERAL("."); 20 | const FilePath::CharType FilePath::kParentDirectory[] = FILE_PATH_LITERAL(".."); 21 | 22 | const FilePath::CharType FilePath::kExtensionSeparator = FILE_PATH_LITERAL('.'); 23 | 24 | } // namespace base -------------------------------------------------------------------------------- /base/files/scoped_file.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_BASE_FILES_SCOPED_FILE_H_ 2 | #define QUICHE_BASE_FILES_SCOPED_FILE_H_ 3 | 4 | #include 5 | #include 6 | 7 | namespace base { 8 | 9 | namespace internal { 10 | 11 | // Functor for |ScopedFILE| (below). 12 | struct ScopedFILECloser { 13 | inline void operator()(FILE* x) const { 14 | if (x) 15 | fclose(x); 16 | } 17 | }; 18 | 19 | } // namespace internal 20 | 21 | // Automatically closes |FILE*|s. 22 | typedef std::unique_ptr ScopedFILE; 23 | 24 | } // namespace base 25 | 26 | #endif // QUICHE_BASE_FILES_SCOPED_FILE_H_ 27 | -------------------------------------------------------------------------------- /base/sinks/customize_file_helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "spdlog/common.h" 4 | #include 5 | #include 6 | 7 | namespace spdlog { 8 | namespace details { 9 | 10 | class SPDLOG_API customize_file_helper { 11 | public: 12 | explicit customize_file_helper() = default; 13 | 14 | customize_file_helper(const customize_file_helper &) = delete; 15 | customize_file_helper &operator=(const customize_file_helper &) = delete; 16 | ~customize_file_helper(); 17 | 18 | void open(const filename_t &fname, bool truncate = false); 19 | void reopen(bool truncate); 20 | void flush(); 21 | void close(); 22 | void write(const memory_buf_t &buf, size_t pos); 23 | void write(const std::string &buf); 24 | size_t size() const; 25 | 26 | private: 27 | const int open_tries_ = 5; 28 | const int open_interval_ = 10; 29 | std::FILE *fd_{nullptr}; 30 | filename_t filename_; 31 | }; 32 | } // namespace details 33 | } // namespace spdlog 34 | 35 | #ifdef SPDLOG_HEADER_ONLY 36 | #include "customize_file_helper-inl.h" 37 | #endif -------------------------------------------------------------------------------- /dragon3.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aazhuliang/GQUIC_043_decrypt/fbcaa66f1eb5d79ab49afc6ea3eaf9cd67107fc5/dragon3.pcap -------------------------------------------------------------------------------- /googleurl/.bazelversion: -------------------------------------------------------------------------------- 1 | 3.6.0 2 | -------------------------------------------------------------------------------- /googleurl/.gitignore: -------------------------------------------------------------------------------- 1 | /bazel-* 2 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/zl/quiche/quiche") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/zl/quiche/quiche") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/gurl.dir/cmake_clean_target.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "libgurl.a" 3 | ) 4 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/gurl.dir/compiler_depend.make: -------------------------------------------------------------------------------- 1 | # Empty compiler generated dependencies file for gurl. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/gurl.dir/compiler_depend.ts: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Timestamp file for compiler generated dependencies management for gurl. 3 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/gurl.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for gurl. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/gurl.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_DEFINES = 6 | 7 | CXX_INCLUDES = -I/home/zl/quiche/quiche/googleurl 8 | 9 | CXX_FLAGS = -Wno-error=unused-result -O3 -DNDEBUG 10 | 11 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/gurl.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 2 | CMAKE_PROGRESS_2 = 3 | CMAKE_PROGRESS_3 = 4 | CMAKE_PROGRESS_4 = 57 5 | CMAKE_PROGRESS_5 = 6 | CMAKE_PROGRESS_6 = 7 | CMAKE_PROGRESS_7 = 8 | CMAKE_PROGRESS_8 = 9 | CMAKE_PROGRESS_9 = 10 | CMAKE_PROGRESS_10 = 11 | CMAKE_PROGRESS_11 = 12 | CMAKE_PROGRESS_12 = 13 | CMAKE_PROGRESS_13 = 14 | CMAKE_PROGRESS_14 = 15 | CMAKE_PROGRESS_15 = 58 16 | CMAKE_PROGRESS_16 = 17 | CMAKE_PROGRESS_17 = 18 | CMAKE_PROGRESS_18 = 19 | CMAKE_PROGRESS_19 = 20 | CMAKE_PROGRESS_20 = 21 | CMAKE_PROGRESS_21 = 22 | CMAKE_PROGRESS_22 = 23 | CMAKE_PROGRESS_23 = 24 | CMAKE_PROGRESS_24 = 25 | CMAKE_PROGRESS_25 = 26 | CMAKE_PROGRESS_26 = 59 27 | CMAKE_PROGRESS_27 = 28 | CMAKE_PROGRESS_28 = 29 | CMAKE_PROGRESS_29 = 30 | CMAKE_PROGRESS_30 = 31 | CMAKE_PROGRESS_31 = 32 | CMAKE_PROGRESS_32 = 33 | CMAKE_PROGRESS_33 = 34 | 35 | -------------------------------------------------------------------------------- /googleurl/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /googleurl/README.md: -------------------------------------------------------------------------------- 1 | # googleurl 2 | 3 | This is a copy of [Chrome's URL parsing 4 | library](https://cs.chromium.org/chromium/src/url/), adapted to work with 5 | [Bazel](https://bazel.build/). It is meant to be used by 6 | [QUICHE](https://quiche.googlesource.com/quiche/+/refs/heads/master), but can be 7 | also used by other projects that use Bazel. 8 | 9 | In order to be used successfully, C++14 or later and `-fno-strict-aliasing` 10 | compile flag are required. 11 | 12 | For questions, contact . 13 | 14 | ## Update Instructions 15 | 16 | In order to update this copy to the latest version of googleurl in Chromium, run 17 | the following commands in the root of the checkout: 18 | 19 | 1. `copybara copy.bara.sky import /src --folder-dir .` 20 | 1. `bazel test --cxxopt="-std=c++14" //...` 21 | (C++14 is replacible with later C++ versions) 22 | 1. Fix all of the compilation errors, potentially modifying the BUILD files and 23 | the polyfill headers in `polyfill/` as appropriate. 24 | 1. Check the new version into Git. 25 | -------------------------------------------------------------------------------- /googleurl/WORKSPACE: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | workspace(name = "com_google_googleurl") 6 | -------------------------------------------------------------------------------- /googleurl/base/containers/util.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef BASE_CONTAINERS_UTIL_H_ 6 | #define BASE_CONTAINERS_UTIL_H_ 7 | 8 | #include 9 | 10 | namespace gurl_base { 11 | 12 | // TODO(crbug.com/817982): What we really need is for checked_math.h to be 13 | // able to do checked arithmetic on pointers. 14 | template 15 | static inline uintptr_t get_uintptr(const T* t) { 16 | return reinterpret_cast(t); 17 | } 18 | 19 | } // namespace base 20 | 21 | #endif // BASE_CONTAINERS_UTIL_H_ 22 | -------------------------------------------------------------------------------- /googleurl/base/functional/identity.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef BASE_FUNCTIONAL_IDENTITY_H_ 6 | #define BASE_FUNCTIONAL_IDENTITY_H_ 7 | 8 | #include 9 | 10 | namespace gurl_base { 11 | 12 | // Implementation of C++20's std::identity. 13 | // 14 | // Reference: 15 | // - https://en.cppreference.com/w/cpp/utility/functional/identity 16 | // - https://wg21.link/func.identity 17 | struct identity { 18 | template 19 | constexpr T&& operator()(T&& t) const noexcept { 20 | return std::forward(t); 21 | } 22 | 23 | using is_transparent = void; 24 | }; 25 | 26 | } // namespace base 27 | 28 | #endif // BASE_FUNCTIONAL_IDENTITY_H_ 29 | -------------------------------------------------------------------------------- /googleurl/base/ranges/functional.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef BASE_RANGES_FUNCTIONAL_H_ 6 | #define BASE_RANGES_FUNCTIONAL_H_ 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace gurl_base { 13 | 14 | namespace ranges { 15 | 16 | // Simplified implementations of C++20's std::ranges comparison function 17 | // objects. As opposed to the std::ranges implementation, these versions do not 18 | // constrain the passed-in types. 19 | // 20 | // Reference: https://wg21.link/range.cmp 21 | using equal_to = std::equal_to<>; 22 | using not_equal_to = std::not_equal_to<>; 23 | using greater = std::greater<>; 24 | using less = std::less<>; 25 | using greater_equal = std::greater_equal<>; 26 | using less_equal = std::less_equal<>; 27 | 28 | } // namespace ranges 29 | 30 | } // namespace base 31 | 32 | #endif // BASE_RANGES_FUNCTIONAL_H_ 33 | -------------------------------------------------------------------------------- /googleurl/base/strings/abseil_string_conversions.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "base/strings/abseil_string_conversions.h" 6 | 7 | #include 8 | 9 | #include "base/containers/span.h" 10 | #include "base/ranges/algorithm.h" 11 | #include "base/strings/string_piece.h" 12 | #include "third_party/abseil-cpp/absl/strings/string_view.h" 13 | 14 | namespace gurl_base { 15 | 16 | std::vector StringPiecesToStringViews( 17 | span pieces) { 18 | std::vector views(pieces.size()); 19 | ranges::transform(pieces, views.begin(), &StringPieceToStringView); 20 | return views; 21 | } 22 | 23 | std::vector StringViewsToStringPieces( 24 | span views) { 25 | std::vector pieces(views.size()); 26 | ranges::transform(views, pieces.begin(), &StringViewToStringPiece); 27 | return pieces; 28 | } 29 | 30 | } // namespace base 31 | -------------------------------------------------------------------------------- /googleurl/base/strings/latin1_string_conversions.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "base/strings/latin1_string_conversions.h" 6 | 7 | namespace gurl_base { 8 | 9 | string16 Latin1OrUTF16ToUTF16(size_t length, 10 | const Latin1Char* latin1, 11 | const char16* utf16) { 12 | if (!length) 13 | return string16(); 14 | if (latin1) 15 | return string16(latin1, latin1 + length); 16 | return string16(utf16, utf16 + length); 17 | } 18 | 19 | } // namespace base 20 | -------------------------------------------------------------------------------- /googleurl/base/strings/no_trigraphs_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "base/strings/strcat.h" 6 | #include "testing/gtest/include/gtest/gtest.h" 7 | 8 | TEST(NoTrigraphs, Basic) { 9 | EXPECT_EQ("??=", gurl_base::StrCat({"?", "?", "="})); 10 | } 11 | -------------------------------------------------------------------------------- /googleurl/base/strings/pattern.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef BASE_STRINGS_PATTERN_H_ 6 | #define BASE_STRINGS_PATTERN_H_ 7 | 8 | #include "polyfills/base/base_export.h" 9 | #include "base/strings/string_piece.h" 10 | 11 | namespace gurl_base { 12 | 13 | // Returns true if the |string| passed in matches the |pattern|. The pattern 14 | // string can contain wildcards like * and ?. 15 | // 16 | // The backslash character (\) is an escape character for * and ?. 17 | // ? matches 0 or 1 character, while * matches 0 or more characters. 18 | BASE_EXPORT bool MatchPattern(StringPiece string, StringPiece pattern); 19 | BASE_EXPORT bool MatchPattern(StringPiece16 string, StringPiece16 pattern); 20 | 21 | } // namespace base 22 | 23 | #endif // BASE_STRINGS_PATTERN_H_ 24 | -------------------------------------------------------------------------------- /googleurl/base/strings/strcat_win.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "base/strings/strcat_win.h" 6 | 7 | #include 8 | 9 | #include "base/containers/span.h" 10 | #include "base/strings/strcat_internal.h" 11 | #include "base/strings/string_piece.h" 12 | 13 | namespace gurl_base { 14 | 15 | #if defined(BASE_STRING16_IS_STD_U16STRING) 16 | 17 | std::wstring StrCat(span pieces) { 18 | return internal::StrCatT(pieces); 19 | } 20 | 21 | std::wstring StrCat(span pieces) { 22 | return internal::StrCatT(pieces); 23 | } 24 | 25 | void StrAppend(std::wstring* dest, span pieces) { 26 | internal::StrAppendT(dest, pieces); 27 | } 28 | 29 | void StrAppend(std::wstring* dest, span pieces) { 30 | internal::StrAppendT(dest, pieces); 31 | } 32 | 33 | #endif 34 | 35 | } // namespace base 36 | -------------------------------------------------------------------------------- /googleurl/base/strings/string_piece_forward.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Forward declaration of StringPiece types from base/strings/string_piece.h 6 | 7 | #ifndef BASE_STRINGS_STRING_PIECE_FORWARD_H_ 8 | #define BASE_STRINGS_STRING_PIECE_FORWARD_H_ 9 | 10 | #include 11 | 12 | #include "base/strings/string16.h" 13 | 14 | namespace gurl_base { 15 | 16 | template 17 | class BasicStringPiece; 18 | typedef BasicStringPiece StringPiece; 19 | typedef BasicStringPiece StringPiece16; 20 | typedef BasicStringPiece WStringPiece; 21 | 22 | } // namespace base 23 | 24 | #endif // BASE_STRINGS_STRING_PIECE_FORWARD_H_ 25 | -------------------------------------------------------------------------------- /googleurl/base/third_party/icu/BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | load("//build_config:build_config.bzl", "build_config") 5 | 6 | cc_library( 7 | name = "icu", 8 | hdrs = ["icu_utf.h"], 9 | copts = build_config.default_copts, 10 | visibility = ["//visibility:public"], 11 | ) 12 | -------------------------------------------------------------------------------- /googleurl/base/third_party/icu/README.chromium: -------------------------------------------------------------------------------- 1 | Name: ICU 2 | URL: http://site.icu-project.org/ 3 | Version: 60 4 | License: Unicode 5 | License File: NOT_SHIPPED 6 | 7 | This file has the relevant components from ICU copied to handle basic UTF8/16/32 8 | conversions. Components are copied from umachine.h, utf.h, utf8.h, and utf16.h 9 | into icu_utf.h. 10 | 11 | The main change is that U_/U8_/U16_/UPRV_ prefixes have been replaced with 12 | CBU_/CBU8_/CBU16_/CBUPRV_ (for "Chrome Base") to avoid confusion with the "real" 13 | ICU macros should ICU be in use on the system. For the same reason, the 14 | functions and types have been put in the "base_icu" namespace. 15 | 16 | Note that this license file is marked as NOT_SHIPPED, since a more complete 17 | ICU license is included from //third_party/icu/README.chromium 18 | -------------------------------------------------------------------------------- /googleurl/build/BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | load("//build_config:build_config.bzl", "build_config") 5 | load("@rules_cc//cc:defs.bzl", "cc_library") 6 | 7 | cc_library( 8 | name = "build_config", 9 | hdrs = ["build_config.h"], 10 | copts = build_config.default_copts, 11 | visibility = ["//visibility:public"], 12 | ) 13 | -------------------------------------------------------------------------------- /googleurl/build_config/BUILD: -------------------------------------------------------------------------------- 1 | load("//build_config:common_settings.bzl", "bool_flag") 2 | 3 | licenses(["notice"]) 4 | 5 | config_setting( 6 | name = "windows_x86_64", 7 | values = {"cpu": "x64_windows"}, 8 | ) 9 | 10 | bool_flag( 11 | name = "system_icu", 12 | build_setting_default = True, 13 | ) 14 | 15 | config_setting( 16 | name = "with_system_icu", 17 | flag_values = { 18 | ":system_icu": "True", 19 | }, 20 | ) 21 | -------------------------------------------------------------------------------- /googleurl/polyfills/BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | load("//build_config:build_config.bzl", "build_config") 5 | 6 | cc_library( 7 | name = "polyfills", 8 | hdrs = [ 9 | "base/base_export.h", 10 | "base/check.h", 11 | "base/check_op.h", 12 | "base/component_export.h", 13 | "base/debug/alias.h", 14 | "base/export_template.h", 15 | "base/logging.h", 16 | "base/notreached.h", 17 | "base/trace_event/memory_usage_estimator.h", 18 | ], 19 | copts = build_config.default_copts, 20 | visibility = ["//visibility:public"], 21 | ) 22 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/base_export.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_BASE_EXPORT_H_ 6 | #define POLYFILLS_BASE_BASE_EXPORT_H_ 7 | 8 | #define BASE_EXPORT 9 | 10 | #endif /* POLYFILLS_BASE_BASE_EXPORT_H_ */ 11 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/check.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_CHECK_H_ 6 | #define POLYFILLS_BASE_CHECK_H_ 7 | 8 | #include "polyfills/base/logging.h" 9 | 10 | #endif /* POLYFILLS_BASE_CHECK_H_ */ 11 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/check_op.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_CHECK_OP_H_ 6 | #define POLYFILLS_BASE_CHECK_OP_H_ 7 | 8 | #include "polyfills/base/logging.h" 9 | 10 | #endif /* POLYFILLS_BASE_CHECK_OP_H_ */ 11 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/component_export.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_COMPONENT_EXPORT_H_ 6 | #define POLYFILLS_BASE_COMPONENT_EXPORT_H_ 7 | 8 | #define COMPONENT_EXPORT(component) 9 | 10 | #endif /* POLYFILLS_BASE_COMPONENT_EXPORT_H_ */ 11 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/debug/alias.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_DEBUG_ALIAS_H_ 6 | #define POLYFILLS_BASE_DEBUG_ALIAS_H_ 7 | 8 | #define DEBUG_ALIAS_FOR_CSTR(var_name, c_str, char_count) 9 | 10 | #endif // POLYFILLS_BASE_DEBUG_ALIAS_H_ 11 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/export_template.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_EXPORT_TEMPLATE_H_ 6 | #define POLYFILLS_BASE_EXPORT_TEMPLATE_H_ 7 | 8 | #define EXPORT_TEMPLATE_DEFINE(export) 9 | #define EXPORT_TEMPLATE_DECLARE(export) 10 | 11 | #endif /* POLYFILLS_BASE_EXPORT_TEMPLATE_H_ */ 12 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/notreached.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_NOTREACHED_H_ 6 | #define POLYFILLS_BASE_NOTREACHED_H_ 7 | 8 | #include "polyfills/base/logging.h" 9 | 10 | #endif /* POLYFILLS_BASE_NOTREACHED_H_ */ 11 | -------------------------------------------------------------------------------- /googleurl/polyfills/base/trace_event/memory_usage_estimator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef POLYFILLS_BASE_TRACE_EVENT_MEMORY_USAGE_ESTIMATOR_H_ 6 | #define POLYFILLS_BASE_TRACE_EVENT_MEMORY_USAGE_ESTIMATOR_H_ 7 | 8 | namespace gurl_base { 9 | namespace trace_event { 10 | 11 | template 12 | size_t EstimateMemoryUsage(const T& object) { return 0; } 13 | 14 | } // namespace trace_event 15 | } // namespace base 16 | 17 | #endif /* POLYFILLS_BASE_TRACE_EVENT_MEMORY_USAGE_ESTIMATOR_H_ */ 18 | -------------------------------------------------------------------------------- /googleurl/test/BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | load("//build_config:build_config.bzl", "build_config") 5 | load("@rules_cc//cc:defs.bzl", "cc_test") 6 | 7 | cc_test( 8 | name = "basic_test", 9 | srcs = ["basic_test.cc"], 10 | copts = build_config.default_copts, 11 | deps = ["//url"], 12 | ) 13 | -------------------------------------------------------------------------------- /googleurl/url/run_all_perftests.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "base/bind.h" 6 | #include "base/test/launcher/unit_test_launcher.h" 7 | #include "base/test/perf_test_suite.h" 8 | 9 | int main(int argc, char** argv) { 10 | gurl_base::PerfTestSuite test_suite(argc, argv); 11 | return gurl_base::LaunchUnitTestsSerially( 12 | argc, argv, 13 | gurl_base::BindOnce(&gurl_base::TestSuite::Run, gurl_base::Unretained(&test_suite))); 14 | } 15 | -------------------------------------------------------------------------------- /googleurl/url/run_all_unittests.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | #include "base/bind.h" 8 | #include "base/test/launcher/unit_test_launcher.h" 9 | #include "base/test/test_io_thread.h" 10 | #include "base/test/test_suite.h" 11 | #include "build/build_config.h" 12 | 13 | #if !defined(OS_IOS) 14 | #include "mojo/core/embedder/embedder.h" // nogncheck 15 | #endif 16 | 17 | int main(int argc, char** argv) { 18 | gurl_base::TestSuite test_suite(argc, argv); 19 | 20 | #if !defined(OS_IOS) 21 | mojo::core::Init(); 22 | #endif 23 | 24 | return gurl_base::LaunchUnitTests( 25 | argc, argv, 26 | gurl_base::BindOnce(&gurl_base::TestSuite::Run, gurl_base::Unretained(&test_suite))); 27 | } 28 | -------------------------------------------------------------------------------- /googleurl/url/third_party/mozilla/DIR_METADATA: -------------------------------------------------------------------------------- 1 | # Metadata information for this directory. 2 | # 3 | # For more information on DIR_METADATA files, see: 4 | # https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md 5 | # 6 | # For the schema of this file, see Metadata message: 7 | # https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto 8 | 9 | monorail { 10 | component: "Internals>Core" 11 | } -------------------------------------------------------------------------------- /googleurl/url/third_party/mozilla/OWNERS: -------------------------------------------------------------------------------- 1 | # COMPONENT: Internals>Core 2 | -------------------------------------------------------------------------------- /googleurl/url/third_party/mozilla/README.chromium: -------------------------------------------------------------------------------- 1 | Name: url_parse 2 | URL: http://mxr.mozilla.org/comm-central/source/mozilla/netwerk/base/src/nsURLParsers.cpp 3 | License: BSD and MPL 1.1/GPL 2.0/LGPL 2.1 4 | License File: LICENSE.txt 5 | 6 | Description: 7 | 8 | The file url_parse.cc is based on nsURLParsers.cc from Mozilla. 9 | -------------------------------------------------------------------------------- /googleurl/url/url_canon.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "url/url_canon.h" 6 | 7 | #include "polyfills/base/component_export.h" 8 | 9 | namespace url { 10 | 11 | template class EXPORT_TEMPLATE_DEFINE(COMPONENT_EXPORT(URL)) CanonOutputT; 12 | template class EXPORT_TEMPLATE_DEFINE(COMPONENT_EXPORT(URL)) 13 | CanonOutputT; 14 | 15 | } // namespace url 16 | -------------------------------------------------------------------------------- /googleurl/url/url_canon_stdstring.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "url/url_canon_stdstring.h" 6 | 7 | namespace url { 8 | 9 | StdStringCanonOutput::StdStringCanonOutput(std::string* str) 10 | : CanonOutput(), str_(str) { 11 | cur_len_ = static_cast(str_->size()); // Append to existing data. 12 | buffer_ = str_->empty() ? NULL : &(*str_)[0]; 13 | buffer_len_ = static_cast(str_->size()); 14 | } 15 | 16 | StdStringCanonOutput::~StdStringCanonOutput() { 17 | // Nothing to do, we don't own the string. 18 | } 19 | 20 | void StdStringCanonOutput::Complete() { 21 | str_->resize(cur_len_); 22 | buffer_len_ = cur_len_; 23 | } 24 | 25 | void StdStringCanonOutput::Resize(int sz) { 26 | str_->resize(sz); 27 | buffer_ = str_->empty() ? NULL : &(*str_)[0]; 28 | buffer_len_ = sz; 29 | } 30 | 31 | } // namespace url 32 | -------------------------------------------------------------------------------- /googleurl/url/url_util_internal.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef URL_URL_UTIL_INTERNAL_H_ 6 | #define URL_URL_UTIL_INTERNAL_H_ 7 | 8 | #include 9 | 10 | #include "base/strings/string16.h" 11 | #include "url/third_party/mozilla/url_parse.h" 12 | 13 | namespace url { 14 | 15 | // Given a string and a range inside the string, compares it to the given 16 | // lower-case |compare_to| buffer. 17 | bool CompareSchemeComponent(const char* spec, 18 | const Component& component, 19 | const char* compare_to); 20 | bool CompareSchemeComponent(const gurl_base::char16* spec, 21 | const Component& component, 22 | const char* compare_to); 23 | 24 | } // namespace url 25 | 26 | #endif // URL_URL_UTIL_INTERNAL_H_ 27 | -------------------------------------------------------------------------------- /gquiche/README.md: -------------------------------------------------------------------------------- 1 | # QUICHE 2 | 3 | QUICHE (QUIC, Http/2, Etc) is Google's implementation of QUIC and related 4 | protocols. It powers Chromium as well as Google's QUIC servers and some other 5 | projects. QUICHE is only supported on little-endian platforms. 6 | 7 | Code can be viewed in CodeSearch in Quiche and is imported into 8 | [Chromium](https://source.chromium.org/chromium/chromium/src/+/master:net/third_party/quiche/src). 9 | -------------------------------------------------------------------------------- /gquiche/balsa/framer_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_BALSA_FRAMER_INTERFACE_H_ 6 | #define QUICHE_BALSA_FRAMER_INTERFACE_H_ 7 | 8 | #include 9 | 10 | #include "gquiche/common/platform/api/quiche_export.h" 11 | 12 | namespace quiche { 13 | 14 | // A minimal interface supported by BalsaFrame and other framer types. For use 15 | // in HttpReader. 16 | class QUICHE_EXPORT_PRIVATE FramerInterface { 17 | public: 18 | virtual ~FramerInterface() {} 19 | virtual size_t ProcessInput(const char* input, size_t length) = 0; 20 | }; 21 | 22 | } // namespace quiche 23 | 24 | #endif // QUICHE_BALSA_FRAMER_INTERFACE_H_ 25 | -------------------------------------------------------------------------------- /gquiche/balsa/http_validation_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "quiche/balsa/http_validation_policy.h" 6 | 7 | #include 8 | 9 | #include "gquiche/common/platform/api/quiche_logging.h" 10 | 11 | namespace quiche { 12 | 13 | HttpValidationPolicy::HttpValidationPolicy(bool enforce_all) 14 | : enforce_all_(enforce_all) {} 15 | 16 | HttpValidationPolicy HttpValidationPolicy::CreateDefault() { 17 | return HttpValidationPolicy(false); 18 | } 19 | 20 | bool HttpValidationPolicy::operator==(const HttpValidationPolicy& other) const { 21 | return enforce_all_ == other.enforce_all_; 22 | } 23 | 24 | } // namespace quiche 25 | -------------------------------------------------------------------------------- /gquiche/balsa/standard_header_map.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_BALSA_STANDARD_HEADER_MAP_H_ 6 | #define QUICHE_BALSA_STANDARD_HEADER_MAP_H_ 7 | 8 | #include "absl/container/flat_hash_set.h" 9 | #include "absl/strings/string_view.h" 10 | #include "gquiche/common/quiche_text_utils.h" 11 | 12 | namespace quiche { 13 | 14 | // This specifies an absl::flat_hash_set with case-insensitive lookup and 15 | // hashing 16 | using StandardHttpHeaderNameSet = 17 | absl::flat_hash_set; 19 | 20 | const StandardHttpHeaderNameSet& GetStandardHeaderSet(); 21 | 22 | } // namespace quiche 23 | 24 | #endif // QUICHE_BALSA_STANDARD_HEADER_MAP_H_ 25 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_bug_tracker.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_BUG_TRACKER_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_BUG_TRACKER_H_ 7 | 8 | #include "platform/quiche_platform_impl/quiche_bug_tracker_impl.h" 9 | 10 | #define QUICHE_BUG QUICHE_BUG_IMPL 11 | #define QUICHE_BUG_IF QUICHE_BUG_IF_IMPL 12 | #define QUICHE_PEER_BUG QUICHE_PEER_BUG_IMPL 13 | #define QUICHE_PEER_BUG_IF QUICHE_PEER_BUG_IF_IMPL 14 | 15 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_BUG_TRACKER_H_ 16 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_containers.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_CONTAINERS_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_CONTAINERS_H_ 7 | 8 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_containers_impl.h" 9 | 10 | namespace quiche { 11 | 12 | // An ordered container optimized for small sets. 13 | // An implementation with O(n) mutations might be chosen 14 | // in case it has better memory usage and/or faster access. 15 | // 16 | // DOES NOT GUARANTEE POINTER OR ITERATOR STABILITY! 17 | template > 18 | using QuicheSmallOrderedSet = QuicheSmallOrderedSetImpl; 19 | 20 | } // namespace quiche 21 | 22 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_CONTAINERS_H_ 23 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_epoll.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_EPOLL_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_EPOLL_H_ 7 | 8 | #include "platform/quic_platform_impl/quic_epoll_impl.h" 9 | 10 | namespace quiche { 11 | 12 | using QuicheEpollServer = QuicheEpollServerImpl; 13 | using QuicheEpollEvent = QuicheEpollEventImpl; 14 | using QuicheEpollAlarmBase = QuicheEpollAlarmBaseImpl; 15 | using QuicheEpollCallbackInterface = QuicheEpollCallbackInterfaceImpl; 16 | 17 | } // namespace quiche 18 | 19 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_EPOLL_H_ 20 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_epoll_test_tools.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_EPOLL_TEST_TOOLS_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_EPOLL_TEST_TOOLS_H_ 7 | 8 | #include "platform/quiche_platform_impl/quiche_epoll_test_tools_impl.h" 9 | 10 | namespace quiche { 11 | 12 | using QuicheFakeEpollServer = QuicheFakeEpollServerImpl; 13 | 14 | } // namespace quiche 15 | 16 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_EPOLL_TEST_TOOLS_H_ 17 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_event_loop.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUIC_EVENT_LOOP_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUIC_EVENT_LOOP_H_ 7 | 8 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_event_loop_impl.h" 9 | 10 | namespace quic { 11 | class QuicEventLoopFactory; 12 | } 13 | 14 | namespace quiche { 15 | 16 | inline quic::QuicEventLoopFactory* GetOverrideForDefaultEventLoop() { 17 | return GetOverrideForDefaultEventLoopImpl(); 18 | } 19 | 20 | inline std::vector 21 | GetExtraEventLoopImplementations() { 22 | return GetExtraEventLoopImplementationsImpl(); 23 | } 24 | 25 | } // namespace quiche 26 | 27 | #endif // QUICHE_COMMON_PLATFORM_API_QUIC_EVENT_LOOP_H_ 28 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_expect_bug.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_EXPECT_BUG_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_EXPECT_BUG_H_ 7 | 8 | #include "platform/quiche_platform_impl/quiche_expect_bug_impl.h" 9 | 10 | #define EXPECT_QUICHE_BUG EXPECT_QUICHE_BUG_IMPL 11 | #define EXPECT_QUICHE_PEER_BUG(statement, regex) \ 12 | EXPECT_QUICHE_PEER_BUG_IMPL(statement, regex) 13 | 14 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_EXPECT_BUG_H_ 15 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_export.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_EXPORT_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_EXPORT_H_ 7 | 8 | #include "platform/quiche_platform_impl/quiche_export_impl.h" 9 | 10 | // QUICHE_EXPORT is not meant to be used. 11 | #define QUICHE_EXPORT QUICHE_EXPORT_IMPL 12 | 13 | // QUICHE_EXPORT_PRIVATE is meant for QUICHE functionality that is built in 14 | // Chromium as part of //net, and not fully contained in headers. 15 | #define QUICHE_EXPORT_PRIVATE QUICHE_EXPORT_PRIVATE_IMPL 16 | 17 | // QUICHE_NO_EXPORT is meant for QUICHE functionality that is either fully 18 | // defined in a header, or is built in Chromium as part of tests or tools. 19 | #define QUICHE_NO_EXPORT QUICHE_NO_EXPORT_IMPL 20 | 21 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_EXPORT_H_ 22 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_flag_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_FLAG_UTILS_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_FLAG_UTILS_H_ 7 | 8 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_flag_utils_impl.h" 9 | 10 | #define QUICHE_RELOADABLE_FLAG_COUNT QUICHE_RELOADABLE_FLAG_COUNT_IMPL 11 | #define QUICHE_RELOADABLE_FLAG_COUNT_N QUICHE_RELOADABLE_FLAG_COUNT_N_IMPL 12 | 13 | #define QUICHE_RESTART_FLAG_COUNT QUICHE_RESTART_FLAG_COUNT_IMPL 14 | #define QUICHE_RESTART_FLAG_COUNT_N QUICHE_RESTART_FLAG_COUNT_N_IMPL 15 | 16 | #define QUICHE_CODE_COUNT QUICHE_CODE_COUNT_IMPL 17 | #define QUICHE_CODE_COUNT_N QUICHE_CODE_COUNT_N_IMPL 18 | 19 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_FLAG_UTILS_H_ 20 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_header_policy.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_HEADER_POLICY_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_HEADER_POLICY_H_ 7 | 8 | #include "platform/quiche_platform_impl/quiche_header_policy_impl.h" 9 | #include "absl/strings/string_view.h" 10 | 11 | namespace quiche { 12 | 13 | // Invoke some platform-specific action based on header key. 14 | inline void QuicheHandleHeaderPolicy(absl::string_view key) { 15 | QuicheHandleHeaderPolicyImpl(key); 16 | } 17 | 18 | } // namespace quiche 19 | 20 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_HEADER_POLICY_H_ 21 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_iovec.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_IOVEC_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_IOVEC_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_iovec_impl.h" 12 | 13 | // The impl header has to export struct iovec, or a POSIX-compatible polyfill. 14 | // Below, we mostly assert that what we have is appropriate. 15 | static_assert(std::is_standard_layout::value, 16 | "iovec has to be a standard-layout struct"); 17 | 18 | static_assert(offsetof(struct iovec, iov_base) < sizeof(struct iovec), 19 | "iovec has to have iov_base"); 20 | static_assert(offsetof(struct iovec, iov_len) < sizeof(struct iovec), 21 | "iovec has to have iov_len"); 22 | 23 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_IOVEC_H_ 24 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_lower_case_string.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_LOWER_CASE_STRING_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_LOWER_CASE_STRING_H_ 7 | 8 | #include "platform/quiche_platform_impl/quiche_lower_case_string_impl.h" 9 | 10 | namespace quiche { 11 | 12 | using QuicheLowerCaseString = QuicheLowerCaseStringImpl; 13 | 14 | } // namespace quiche 15 | 16 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_LOWER_CASE_STRING_H_ 17 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_lower_case_string_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/common/platform/api/quiche_lower_case_string.h" 6 | 7 | #include "absl/strings/string_view.h" 8 | #include "gquiche/common/platform/api/quiche_test.h" 9 | 10 | namespace quiche::test { 11 | namespace { 12 | 13 | TEST(QuicheLowerCaseString, Basic) { 14 | QuicheLowerCaseString empty(""); 15 | EXPECT_EQ("", empty.get()); 16 | 17 | QuicheLowerCaseString from_lower_case("foo"); 18 | EXPECT_EQ("foo", from_lower_case.get()); 19 | 20 | QuicheLowerCaseString from_mixed_case("BaR"); 21 | EXPECT_EQ("bar", from_mixed_case.get()); 22 | 23 | const absl::string_view kData = "FooBar"; 24 | QuicheLowerCaseString from_string_view(kData); 25 | EXPECT_EQ("foobar", from_string_view.get()); 26 | } 27 | 28 | } // namespace 29 | } // namespace quiche::test 30 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_mutex.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/common/platform/api/quiche_mutex.h" 6 | 7 | namespace quiche { 8 | 9 | void QuicheMutex::WriterLock() { impl_.WriterLock(); } 10 | 11 | void QuicheMutex::WriterUnlock() { impl_.WriterUnlock(); } 12 | 13 | void QuicheMutex::ReaderLock() { impl_.ReaderLock(); } 14 | 15 | void QuicheMutex::ReaderUnlock() { impl_.ReaderUnlock(); } 16 | 17 | void QuicheMutex::AssertReaderHeld() const { impl_.AssertReaderHeld(); } 18 | 19 | QuicheReaderMutexLock::QuicheReaderMutexLock(QuicheMutex* lock) : lock_(lock) { 20 | lock->ReaderLock(); 21 | } 22 | 23 | QuicheReaderMutexLock::~QuicheReaderMutexLock() { lock_->ReaderUnlock(); } 24 | 25 | QuicheWriterMutexLock::QuicheWriterMutexLock(QuicheMutex* lock) : lock_(lock) { 26 | lock->WriterLock(); 27 | } 28 | 29 | QuicheWriterMutexLock::~QuicheWriterMutexLock() { lock_->WriterUnlock(); } 30 | 31 | } // namespace quiche 32 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_stream_buffer_allocator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_STREAM_BUFFER_ALLOCATOR_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_STREAM_BUFFER_ALLOCATOR_H_ 7 | 8 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h" 9 | 10 | namespace quiche { 11 | 12 | using QuicheStreamBufferAllocator = QuicheStreamBufferAllocatorImpl; 13 | 14 | } 15 | 16 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_STREAM_BUFFER_ALLOCATOR_H_ 17 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_system_event_loop.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_SYSTEM_EVENT_LOOP_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_SYSTEM_EVENT_LOOP_H_ 7 | 8 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_system_event_loop_impl.h" 9 | 10 | namespace quiche { 11 | 12 | inline void QuicheRunSystemEventLoopIteration() { 13 | QuicheRunSystemEventLoopIterationImpl(); 14 | } 15 | 16 | using QuicheSystemEventLoop = QuicheSystemEventLoopImpl; 17 | 18 | } // namespace quiche 19 | 20 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_SYSTEM_EVENT_LOOP_H_ 21 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_test_loopback.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/common/platform/api/quiche_test_loopback.h" 6 | 7 | namespace quiche { 8 | 9 | quic::IpAddressFamily AddressFamilyUnderTest() { 10 | return AddressFamilyUnderTestImpl(); 11 | } 12 | 13 | quic::QuicIpAddress TestLoopback4() { return TestLoopback4Impl(); } 14 | 15 | quic::QuicIpAddress TestLoopback6() { return TestLoopback6Impl(); } 16 | 17 | quic::QuicIpAddress TestLoopback() { return TestLoopbackImpl(); } 18 | 19 | quic::QuicIpAddress TestLoopback(int index) { return TestLoopbackImpl(index); } 20 | 21 | } // namespace quiche 22 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_testvalue.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_TESTVALUE_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_TESTVALUE_H_ 7 | 8 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_testvalue_impl.h" 9 | #include "absl/strings/string_view.h" 10 | 11 | namespace quiche { 12 | 13 | // Interface allowing injection of test-specific code in production codepaths. 14 | // |label| is an arbitrary value identifying the location, and |var| is a 15 | // pointer to the value to be modified. 16 | // 17 | // Note that this method does nothing in Chromium. 18 | template 19 | void AdjustTestValue(absl::string_view label, T* var) { 20 | AdjustTestValueImpl(label, var); 21 | } 22 | 23 | } // namespace quiche 24 | 25 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_TESTVALUE_H_ 26 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/quiche_thread.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_THREAD_H_ 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_THREAD_H_ 7 | 8 | #include 9 | 10 | #include "platform/quiche_platform_impl/quiche_thread_impl.h" 11 | #include "gquiche/common/platform/api/quiche_export.h" 12 | 13 | namespace quiche { 14 | 15 | // A class representing a thread of execution in QUIC. 16 | class QUICHE_EXPORT_PRIVATE QuicheThread : public QuicheThreadImpl { 17 | public: 18 | QuicheThread(const std::string& string) : QuicheThreadImpl(string) {} 19 | QuicheThread(const QuicheThread&) = delete; 20 | QuicheThread& operator=(const QuicheThread&) = delete; 21 | 22 | // Impl defines a virtual void Run() method which subclasses 23 | // must implement. 24 | }; 25 | 26 | } // namespace quiche 27 | 28 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_THREAD_H_ 29 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/testdir/README.md: -------------------------------------------------------------------------------- 1 | This directory is used in the QUICHE filesystem API tests. 2 | -------------------------------------------------------------------------------- /gquiche/common/platform/api/testdir/a/b/c/d/e: -------------------------------------------------------------------------------- 1 | Test file for deeply nested folders. -------------------------------------------------------------------------------- /gquiche/common/platform/api/testdir/a/subdir/testfile: -------------------------------------------------------------------------------- 1 | Test for a file with the same name as the other file. -------------------------------------------------------------------------------- /gquiche/common/platform/api/testdir/a/z: -------------------------------------------------------------------------------- 1 | Test for a file in a subdirectory. -------------------------------------------------------------------------------- /gquiche/common/platform/api/testdir/testfile: -------------------------------------------------------------------------------- 1 | This is a test file. -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_bug_tracker_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_BUG_TRACKER_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_BUG_TRACKER_IMPL_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_logging.h" 9 | 10 | #define QUICHE_BUG_IMPL(b) QUICHE_LOG(DFATAL) << #b ": " 11 | #define QUICHE_BUG_IF_IMPL(b, condition) \ 12 | QUICHE_LOG_IF(DFATAL, condition) << #b ": " 13 | #define QUICHE_PEER_BUG_IMPL(b) QUICHE_LOG(DFATAL) 14 | #define QUICHE_PEER_BUG_IF_IMPL(b, condition) QUICHE_LOG_IF(DFATAL, condition) 15 | 16 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_BUG_TRACKER_IMPL_H_ 17 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_containers_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ 7 | 8 | #include "absl/container/btree_set.h" 9 | 10 | namespace quiche { 11 | 12 | template 13 | using QuicheSmallOrderedSetImpl = absl::btree_set; 14 | 15 | } // namespace quiche 16 | 17 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ 18 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_event_loop_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EVENT_LOOP_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EVENT_LOOP_IMPL_H_ 7 | 8 | #include 9 | 10 | namespace quic { 11 | class QuicEventLoopFactory; 12 | } 13 | 14 | namespace quiche { 15 | 16 | inline quic::QuicEventLoopFactory* GetOverrideForDefaultEventLoopImpl() { 17 | return nullptr; 18 | } 19 | 20 | inline std::vector 21 | GetExtraEventLoopImplementationsImpl() { 22 | return {}; 23 | } 24 | 25 | } // namespace quiche 26 | 27 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EVENT_LOOP_IMPL_H_ 28 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_expect_bug_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPECT_BUG_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPECT_BUG_IMPL_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_test.h" 9 | 10 | #define EXPECT_QUICHE_BUG_IMPL(statement, regex) \ 11 | EXPECT_QUICHE_DEBUG_DEATH(statement, regex) 12 | #define EXPECT_QUICHE_PEER_BUG_IMPL(statement, regex) \ 13 | EXPECT_QUICHE_DEBUG_DEATH(statement, regex) 14 | 15 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPECT_BUG_IMPL_H_ 16 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_export_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPORT_IMPL_H_ 2 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPORT_IMPL_H_ 3 | 4 | #include "absl/base/attributes.h" 5 | 6 | // These macros are documented in: quiche/quic/platform/api/quic_export.h 7 | 8 | #if defined(_WIN32) 9 | #define QUICHE_EXPORT_IMPL __declspec(dllexport) 10 | #elif ABSL_HAVE_ATTRIBUTE(visibility) 11 | #define QUICHE_EXPORT_IMPL __attribute__((visibility("default"))) 12 | #else 13 | #define QUICHE_EXPORT_IMPL 14 | #endif 15 | 16 | #define QUICHE_EXPORT_PRIVATE_IMPL QUICHE_EXPORT_IMPL 17 | #define QUICHE_NO_EXPORT_IMPL QUICHE_EXPORT_IMPL 18 | 19 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPORT_IMPL_H_ 20 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_file_utils_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_FILE_UTILS_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_FILE_UTILS_IMPL_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "absl/strings/string_view.h" 12 | #include "absl/types/optional.h" 13 | 14 | namespace quiche { 15 | 16 | std::string JoinPathImpl(absl::string_view a, absl::string_view b); 17 | 18 | absl::optional ReadFileContentsImpl(absl::string_view file); 19 | 20 | bool EnumerateDirectoryImpl(absl::string_view path, 21 | std::vector& directories, 22 | std::vector& files); 23 | 24 | } // namespace quiche 25 | 26 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_FILE_UTILS_IMPL_H_ 27 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_header_policy_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_HEADER_POLICY_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_HEADER_POLICY_IMPL_H_ 7 | 8 | #include "absl/strings/string_view.h" 9 | 10 | namespace quiche { 11 | 12 | inline void QuicheHandleHeaderPolicyImpl(absl::string_view /*key*/) {} 13 | 14 | } // namespace quiche 15 | 16 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_HEADER_POLICY_IMPL_H_ 17 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_iovec_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_IOVEC_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_IOVEC_IMPL_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_export.h" 9 | 10 | #if defined(_WIN32) 11 | 12 | // See 13 | struct QUICHE_EXPORT_PRIVATE iovec { 14 | void* iov_base; 15 | size_t iov_len; 16 | }; 17 | 18 | #else 19 | 20 | #include // IWYU pragma: export 21 | 22 | #endif // defined(_WIN32) 23 | 24 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_IOVEC_IMPL_H_ 25 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_lower_case_string_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_LOWER_CASE_STRING_IMPL_H_ 2 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_LOWER_CASE_STRING_IMPL_H_ 3 | 4 | #include 5 | 6 | #include "absl/strings/ascii.h" 7 | #include "absl/strings/string_view.h" 8 | #include "gquiche/common/platform/api/quiche_export.h" 9 | 10 | namespace quiche { 11 | 12 | class QUICHE_EXPORT_PRIVATE QuicheLowerCaseStringImpl { 13 | public: 14 | QuicheLowerCaseStringImpl(absl::string_view str) 15 | : str_(absl::AsciiStrToLower(str)) {} 16 | 17 | const std::string& get() const { return str_; } 18 | 19 | private: 20 | std::string str_; 21 | }; 22 | 23 | } // namespace quiche 24 | 25 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_LOWER_CASE_STRING_IMPL_H_ 26 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_mutex_impl.cc: -------------------------------------------------------------------------------- 1 | #include "gquiche/common/platform/default/quiche_platform_impl/quiche_mutex_impl.h" 2 | 3 | namespace quiche { 4 | 5 | void QuicheLockImpl::WriterLock() { mu_.WriterLock(); } 6 | 7 | void QuicheLockImpl::WriterUnlock() { mu_.WriterUnlock(); } 8 | 9 | void QuicheLockImpl::ReaderLock() { mu_.ReaderLock(); } 10 | 11 | void QuicheLockImpl::ReaderUnlock() { mu_.ReaderUnlock(); } 12 | 13 | void QuicheLockImpl::AssertReaderHeld() const { mu_.AssertReaderHeld(); } 14 | 15 | } // namespace quiche 16 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_prefetch_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_PREFETCH_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_PREFETCH_IMPL_H_ 7 | 8 | #if defined(_MSC_VER) 9 | #include 10 | #endif 11 | 12 | namespace quiche { 13 | 14 | inline void QuichePrefetchT0Impl(const void* addr) { 15 | #if !defined(DISABLE_BUILTIN_PREFETCH) 16 | #if defined(__GNUC__) || (defined(_M_ARM64) && defined(__clang__)) 17 | __builtin_prefetch(addr, 0, 3); 18 | #elif defined(_MSC_VER) 19 | _mm_prefetch(reinterpret_cast(addr), _MM_HINT_T0); 20 | #else 21 | (void*)addr; 22 | #endif 23 | #endif // !defined(DISABLE_BUILTIN_PREFETCH) 24 | } 25 | 26 | } // namespace quiche 27 | 28 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_PREFETCH_IMPL_H_ 29 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_stack_trace_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_ 7 | 8 | #include 9 | 10 | namespace quiche { 11 | 12 | std::string QuicheStackTraceImpl(); 13 | bool QuicheShouldRunStackTraceTestImpl(); 14 | 15 | } // namespace quiche 16 | 17 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_ 18 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_STREAM_BUFFER_ALLOCATOR_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_STREAM_BUFFER_ALLOCATOR_IMPL_H_ 7 | 8 | #include "gquiche/common/simple_buffer_allocator.h" 9 | 10 | namespace quiche { 11 | 12 | using QuicheStreamBufferAllocatorImpl = quiche::SimpleBufferAllocator; 13 | 14 | } // namespace quiche 15 | 16 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_STREAM_BUFFER_ALLOCATOR_IMPL_H_ 17 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_system_event_loop_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_SYSTEM_EVENT_LOOP_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_SYSTEM_EVENT_LOOP_IMPL_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_export.h" 9 | #include "gquiche/common/platform/api/quiche_logging.h" 10 | 11 | namespace quiche { 12 | 13 | inline void QuicheRunSystemEventLoopIterationImpl() {} 14 | 15 | class QUICHE_EXPORT_PRIVATE QuicheSystemEventLoopImpl { 16 | public: 17 | QuicheSystemEventLoopImpl(std::string context_name) { 18 | QUICHE_LOG(INFO) << "Starting event loop for " << context_name; 19 | } 20 | }; 21 | 22 | } // namespace quiche 23 | 24 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_SYSTEM_EVENT_LOOP_IMPL_H_ 25 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "platform/quiche_platform_impl/quiche_test_loopback_impl.h" 6 | 7 | namespace quiche { 8 | 9 | quic::IpAddressFamily AddressFamilyUnderTestImpl() { 10 | return quic::IpAddressFamily::IP_V4; 11 | } 12 | 13 | quic::QuicIpAddress TestLoopback4Impl() { 14 | return quic::QuicIpAddress::Loopback4(); 15 | } 16 | 17 | quic::QuicIpAddress TestLoopback6Impl() { 18 | return quic::QuicIpAddress::Loopback6(); 19 | } 20 | 21 | quic::QuicIpAddress TestLoopbackImpl() { 22 | return quic::QuicIpAddress::Loopback4(); 23 | } 24 | 25 | quic::QuicIpAddress TestLoopbackImpl(int index) { 26 | const char kLocalhostIPv4[] = {127, 0, 0, static_cast(index)}; 27 | quic::QuicIpAddress address; 28 | address.FromPackedString(kLocalhostIPv4, 4); 29 | return address; 30 | } 31 | 32 | } // namespace quiche 33 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_testvalue_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TESTVALUE_IMPL_H_ 2 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TESTVALUE_IMPL_H_ 3 | 4 | #include "absl/strings/string_view.h" 5 | 6 | namespace quiche { 7 | 8 | template 9 | void AdjustTestValueImpl(absl::string_view /*label*/, T* /*var*/) {} 10 | 11 | } // namespace quiche 12 | 13 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TESTVALUE_IMPL_H_ 14 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_thread_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_THREAD_IMPL_H_ 2 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_THREAD_IMPL_H_ 3 | 4 | #include 5 | #include // NOLINT: only used outside of google3 6 | 7 | #include "absl/types/optional.h" 8 | #include "gquiche/common/platform/api/quiche_export.h" 9 | 10 | class QUICHE_NO_EXPORT QuicheThreadImpl { 11 | public: 12 | QuicheThreadImpl(const std::string&) {} 13 | virtual ~QuicheThreadImpl() {} 14 | 15 | virtual void Run() = 0; 16 | 17 | void Start() { 18 | thread_.emplace([this]() { Run(); }); 19 | } 20 | void Join() { thread_->join(); } 21 | 22 | private: 23 | absl::optional thread_; 24 | }; 25 | 26 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_THREAD_IMPL_H_ 27 | -------------------------------------------------------------------------------- /gquiche/common/platform/default/quiche_platform_impl/quiche_time_utils_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TIME_UTILS_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TIME_UTILS_IMPL_H_ 7 | 8 | #include 9 | 10 | #include "absl/types/optional.h" 11 | 12 | namespace quiche { 13 | 14 | absl::optional QuicheUtcDateTimeToUnixSecondsImpl(int year, int month, 15 | int day, int hour, 16 | int minute, 17 | int second); 18 | 19 | } // namespace quiche 20 | 21 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TIME_UTILS_IMPL_H_ 22 | -------------------------------------------------------------------------------- /gquiche/common/quiche_ip_address_family.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_QUICHE_IP_ADDRESS_FAMILY_H_ 6 | #define QUICHE_COMMON_QUICHE_IP_ADDRESS_FAMILY_H_ 7 | 8 | namespace quiche { 9 | 10 | // IP address family type used in QUIC. This hides platform dependant IP address 11 | // family types. 12 | enum class IpAddressFamily { 13 | IP_V4, 14 | IP_V6, 15 | IP_UNSPEC, 16 | }; 17 | 18 | int ToPlatformAddressFamily(IpAddressFamily family); 19 | IpAddressFamily FromPlatformAddressFamily(int family); 20 | 21 | } // namespace quiche 22 | 23 | #endif // QUICHE_COMMON_QUICHE_IP_ADDRESS_FAMILY_H_ 24 | -------------------------------------------------------------------------------- /gquiche/common/quiche_protocol_flags_list.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // NOLINT(build/header_guard) 6 | // This file intentionally does not have header guards, it's intended to be 7 | // included multiple times, each time with a different definition of 8 | // QUICHE_PROTOCOL_FLAG. 9 | 10 | #if defined(QUICHE_PROTOCOL_FLAG) 11 | 12 | QUICHE_PROTOCOL_FLAG(bool, quiche_oghttp2_debug_trace, false, 13 | "If true, emits trace logs for HTTP/2 events.") 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /gquiche/common/simple_buffer_allocator.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/common/simple_buffer_allocator.h" 6 | 7 | namespace quiche { 8 | 9 | char* SimpleBufferAllocator::New(size_t size) { return new char[size]; } 10 | 11 | char* SimpleBufferAllocator::New(size_t size, bool /* flag_enable */) { 12 | return New(size); 13 | } 14 | 15 | void SimpleBufferAllocator::Delete(char* buffer) { delete[] buffer; } 16 | 17 | } // namespace quiche 18 | -------------------------------------------------------------------------------- /gquiche/common/structured_headers_fuzzer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "absl/strings/string_view.h" 6 | #include "gquiche/common/structured_headers.h" 7 | 8 | namespace quiche { 9 | namespace structured_headers { 10 | 11 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 12 | absl::string_view input(reinterpret_cast(data), size); 13 | ParseItem(input); 14 | ParseListOfLists(input); 15 | ParseList(input); 16 | ParseDictionary(input); 17 | ParseParameterisedList(input); 18 | return 0; 19 | } 20 | 21 | } // namespace structured_headers 22 | } // namespace quiche 23 | -------------------------------------------------------------------------------- /gquiche/common/test_tools/quiche_test_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_TEST_TOOLS_QUICHE_TEST_UTILS_H_ 6 | #define QUICHE_COMMON_TEST_TOOLS_QUICHE_TEST_UTILS_H_ 7 | 8 | #include 9 | 10 | #include "absl/strings/string_view.h" 11 | #include "gquiche/common/platform/api/quiche_iovec.h" 12 | 13 | namespace quiche { 14 | namespace test { 15 | 16 | void CompareCharArraysWithHexError(const std::string& description, 17 | const char* actual, const int actual_len, 18 | const char* expected, 19 | const int expected_len); 20 | 21 | // Create iovec that points to that data that `str` points to. 22 | iovec MakeIOVector(absl::string_view str); 23 | 24 | } // namespace test 25 | } // namespace quiche 26 | 27 | #endif // QUICHE_COMMON_TEST_TOOLS_QUICHE_TEST_UTILS_H_ 28 | -------------------------------------------------------------------------------- /gquiche/epoll_server/platform/api/epoll_address_test_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_ADDRESS_TEST_UTILS_H_ 6 | #define QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_ADDRESS_TEST_UTILS_H_ 7 | 8 | #include "platform/quiche_platform_impl/epoll_address_test_utils_impl.h" 9 | 10 | namespace epoll_server { 11 | 12 | inline int AddressFamilyUnderTest() { return AddressFamilyUnderTestImpl(); } 13 | 14 | } // namespace epoll_server 15 | 16 | #endif // QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_ADDRESS_TEST_UTILS_H_ 17 | -------------------------------------------------------------------------------- /gquiche/epoll_server/platform/api/epoll_bug.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_BUG_H_ 6 | #define QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_BUG_H_ 7 | 8 | #include "platform/epoll_platform_impl/epoll_bug_impl.h" 9 | 10 | #define EPOLL_BUG EPOLL_BUG_IMPL 11 | 12 | #endif // QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_BUG_H_ 13 | -------------------------------------------------------------------------------- /gquiche/epoll_server/platform/api/epoll_expect_bug.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_EXPECT_BUG_H_ 6 | #define QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_EXPECT_BUG_H_ 7 | 8 | #include "platform/quiche_platform_impl/epoll_expect_bug_impl.h" 9 | 10 | #define EXPECT_EPOLL_BUG EXPECT_EPOLL_BUG_IMPL 11 | 12 | #endif // QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_EXPECT_BUG_H_ 13 | -------------------------------------------------------------------------------- /gquiche/epoll_server/platform/api/epoll_logging.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_LOGGING_H_ 6 | #define QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_LOGGING_H_ 7 | 8 | #include "platform/epoll_platform_impl/epoll_logging_impl.h" 9 | 10 | namespace epoll_server { 11 | 12 | #define EPOLL_LOG(severity) EPOLL_LOG_IMPL(severity) 13 | #define EPOLL_VLOG(verbosity) EPOLL_VLOG_IMPL(verbosity) 14 | #define EPOLL_DVLOG(verbosity) EPOLL_DVLOG_IMPL(verbosity) 15 | #define EPOLL_PLOG(severity) EPOLL_PLOG_IMPL(severity) 16 | 17 | } // namespace epoll_server 18 | 19 | #endif // QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_LOGGING_H_ 20 | -------------------------------------------------------------------------------- /gquiche/epoll_server/platform/api/epoll_test.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_TEST_H_ 6 | #define QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_TEST_H_ 7 | 8 | #include "platform/quiche_platform_impl/epoll_test_impl.h" 9 | #define EpollTest EpollTestImpl 10 | 11 | #endif // QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_TEST_H_ 12 | -------------------------------------------------------------------------------- /gquiche/epoll_server/platform/api/epoll_thread.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_THREAD_H_ 6 | #define QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_THREAD_H_ 7 | 8 | #include 9 | 10 | #include "platform/quiche_platform_impl/epoll_thread_impl.h" 11 | 12 | namespace epoll_server { 13 | 14 | // A class representing a thread of execution in QUIC. 15 | class EpollThread : public EpollThreadImpl { 16 | public: 17 | EpollThread(const std::string& string) : EpollThreadImpl(string) {} 18 | EpollThread(const EpollThread&) = delete; 19 | EpollThread& operator=(const EpollThread&) = delete; 20 | 21 | // Impl defines a virtual void Run() method which subclasses 22 | // must implement. 23 | }; 24 | 25 | } // namespace epoll_server 26 | 27 | #endif // QUICHE_EPOLL_SERVER_PLATFORM_API_EPOLL_THREAD_H_ 28 | -------------------------------------------------------------------------------- /gquiche/http2/adapter/http2_session.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_HTTP2_ADAPTER_HTTP2_SESSION_H_ 2 | #define QUICHE_HTTP2_ADAPTER_HTTP2_SESSION_H_ 3 | 4 | #include 5 | 6 | #include "absl/strings/string_view.h" 7 | #include "gquiche/http2/adapter/http2_protocol.h" 8 | #include "gquiche/common/platform/api/quiche_export.h" 9 | 10 | namespace http2 { 11 | namespace adapter { 12 | 13 | struct QUICHE_EXPORT_PRIVATE Http2SessionCallbacks {}; 14 | 15 | // A class to represent the state of a single HTTP/2 connection. 16 | class QUICHE_EXPORT_PRIVATE Http2Session { 17 | public: 18 | Http2Session() = default; 19 | virtual ~Http2Session() {} 20 | 21 | virtual int64_t ProcessBytes(absl::string_view bytes) = 0; 22 | 23 | virtual int Consume(Http2StreamId stream_id, size_t num_bytes) = 0; 24 | 25 | virtual bool want_read() const = 0; 26 | virtual bool want_write() const = 0; 27 | virtual int GetRemoteWindowSize() const = 0; 28 | }; 29 | 30 | } // namespace adapter 31 | } // namespace http2 32 | 33 | #endif // QUICHE_HTTP2_ADAPTER_HTTP2_SESSION_H_ 34 | -------------------------------------------------------------------------------- /gquiche/http2/adapter/nghttp2.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_HTTP2_ADAPTER_NGHTTP2_H_ 2 | #define QUICHE_HTTP2_ADAPTER_NGHTTP2_H_ 3 | 4 | #include 5 | 6 | // Required to build on Windows. 7 | using ssize_t = ptrdiff_t; 8 | 9 | #include "nghttp2/nghttp2.h" 10 | 11 | #endif // QUICHE_HTTP2_ADAPTER_NGHTTP2_H_ 12 | -------------------------------------------------------------------------------- /gquiche/http2/adapter/noop_header_validator.cc: -------------------------------------------------------------------------------- 1 | #include "gquiche/http2/adapter/noop_header_validator.h" 2 | 3 | #include "absl/strings/escaping.h" 4 | #include "gquiche/common/platform/api/quiche_logging.h" 5 | 6 | namespace http2 { 7 | namespace adapter { 8 | 9 | HeaderValidatorBase::HeaderStatus NoopHeaderValidator::ValidateSingleHeader( 10 | absl::string_view key, absl::string_view value) { 11 | if (key == ":status") { 12 | status_ = std::string(value); 13 | } 14 | return HEADER_OK; 15 | } 16 | 17 | bool NoopHeaderValidator::FinishHeaderBlock(HeaderType /* type */) { 18 | return true; 19 | } 20 | 21 | } // namespace adapter 22 | } // namespace http2 23 | -------------------------------------------------------------------------------- /gquiche/http2/adapter/noop_header_validator.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_HTTP2_ADAPTER_NOOP_HEADER_VALIDATOR_H_ 2 | #define QUICHE_HTTP2_ADAPTER_NOOP_HEADER_VALIDATOR_H_ 3 | 4 | #include "absl/strings/string_view.h" 5 | #include "gquiche/http2/adapter/header_validator_base.h" 6 | #include "gquiche/common/platform/api/quiche_export.h" 7 | 8 | namespace http2 { 9 | namespace adapter { 10 | 11 | // A validator that does not actually perform any validation. 12 | class QUICHE_EXPORT_PRIVATE NoopHeaderValidator : public HeaderValidatorBase { 13 | public: 14 | NoopHeaderValidator() = default; 15 | 16 | HeaderStatus ValidateSingleHeader(absl::string_view key, 17 | absl::string_view value) override; 18 | 19 | bool FinishHeaderBlock(HeaderType type) override; 20 | }; 21 | 22 | } // namespace adapter 23 | } // namespace http2 24 | 25 | #endif // QUICHE_HTTP2_ADAPTER_NOOP_HEADER_VALIDATOR_H_ 26 | -------------------------------------------------------------------------------- /gquiche/http2/adapter/oghttp2_util.cc: -------------------------------------------------------------------------------- 1 | #include "gquiche/http2/adapter/oghttp2_util.h" 2 | 3 | namespace http2 { 4 | namespace adapter { 5 | 6 | spdy::Http2HeaderBlock ToHeaderBlock(absl::Span headers) { 7 | spdy::Http2HeaderBlock block; 8 | for (const Header& header : headers) { 9 | absl::string_view name = GetStringView(header.first).first; 10 | absl::string_view value = GetStringView(header.second).first; 11 | block.AppendValueOrAddHeader(name, value); 12 | } 13 | return block; 14 | } 15 | 16 | } // namespace adapter 17 | } // namespace http2 18 | -------------------------------------------------------------------------------- /gquiche/http2/adapter/oghttp2_util.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_HTTP2_ADAPTER_OGHTTP2_UTIL_H_ 2 | #define QUICHE_HTTP2_ADAPTER_OGHTTP2_UTIL_H_ 3 | 4 | #include "absl/types/span.h" 5 | #include "gquiche/http2/adapter/http2_protocol.h" 6 | #include "gquiche/common/platform/api/quiche_export.h" 7 | #include "gquiche/spdy/core/http2_header_block.h" 8 | 9 | namespace http2 { 10 | namespace adapter { 11 | 12 | QUICHE_EXPORT_PRIVATE spdy::Http2HeaderBlock ToHeaderBlock( 13 | absl::Span headers); 14 | 15 | } // namespace adapter 16 | } // namespace http2 17 | 18 | #endif // QUICHE_HTTP2_ADAPTER_OGHTTP2_UTIL_H_ 19 | -------------------------------------------------------------------------------- /gquiche/http2/decoder/decode_status.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/http2/decoder/decode_status.h" 6 | 7 | #include "gquiche/common/platform/api/quiche_bug_tracker.h" 8 | #include "gquiche/common/platform/api/quiche_logging.h" 9 | 10 | namespace http2 { 11 | 12 | std::ostream& operator<<(std::ostream& out, DecodeStatus v) { 13 | switch (v) { 14 | case DecodeStatus::kDecodeDone: 15 | return out << "DecodeDone"; 16 | case DecodeStatus::kDecodeInProgress: 17 | return out << "DecodeInProgress"; 18 | case DecodeStatus::kDecodeError: 19 | return out << "DecodeError"; 20 | } 21 | // Since the value doesn't come over the wire, only a programming bug should 22 | // result in reaching this point. 23 | int unknown = static_cast(v); 24 | QUICHE_BUG(http2_bug_147_1) << "Unknown DecodeStatus " << unknown; 25 | return out << "DecodeStatus(" << unknown << ")"; 26 | } 27 | 28 | } // namespace http2 29 | -------------------------------------------------------------------------------- /gquiche/http2/decoder/http2_frame_decoder_listener.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/http2/decoder/http2_frame_decoder_listener.h" 6 | 7 | namespace http2 { 8 | 9 | bool Http2FrameDecoderNoOpListener::OnFrameHeader( 10 | const Http2FrameHeader& /*header*/) { 11 | return true; 12 | } 13 | 14 | } // namespace http2 15 | -------------------------------------------------------------------------------- /gquiche/http2/test_tools/http2_structure_decoder_test_util.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/http2/test_tools/http2_structure_decoder_test_util.h" 6 | 7 | #include 8 | 9 | namespace http2 { 10 | namespace test { 11 | 12 | // static 13 | void Http2StructureDecoderPeer::Randomize(Http2StructureDecoder* p, 14 | Http2Random* rng) { 15 | p->offset_ = rng->Rand32(); 16 | for (size_t i = 0; i < sizeof p->buffer_; ++i) { 17 | p->buffer_[i] = rng->Rand8(); 18 | } 19 | } 20 | 21 | } // namespace test 22 | } // namespace http2 23 | -------------------------------------------------------------------------------- /gquiche/http2/test_tools/http2_structure_decoder_test_util.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_HTTP2_TEST_TOOLS_HTTP2_STRUCTURE_DECODER_TEST_UTIL_H_ 6 | #define QUICHE_HTTP2_TEST_TOOLS_HTTP2_STRUCTURE_DECODER_TEST_UTIL_H_ 7 | 8 | #include "gquiche/http2/decoder/http2_structure_decoder.h" 9 | #include "gquiche/http2/test_tools/http2_random.h" 10 | #include "gquiche/common/platform/api/quiche_export.h" 11 | 12 | namespace http2 { 13 | namespace test { 14 | 15 | class QUICHE_NO_EXPORT Http2StructureDecoderPeer { 16 | public: 17 | // Overwrite the Http2StructureDecoder instance with random values. 18 | static void Randomize(Http2StructureDecoder* p, Http2Random* rng); 19 | }; 20 | 21 | } // namespace test 22 | } // namespace http2 23 | 24 | #endif // QUICHE_HTTP2_TEST_TOOLS_HTTP2_STRUCTURE_DECODER_TEST_UTIL_H_ 25 | -------------------------------------------------------------------------------- /gquiche/http2/test_tools/random_util.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_HTTP2_TEST_TOOLS_RANDOM_UTIL_H_ 6 | #define QUICHE_HTTP2_TEST_TOOLS_RANDOM_UTIL_H_ 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include "gquiche/http2/test_tools/http2_random.h" 13 | 14 | namespace http2 { 15 | namespace test { 16 | 17 | // Generate a string with the allowed character set for HTTP/2 / HPACK header 18 | // names. 19 | std::string GenerateHttp2HeaderName(size_t len, Http2Random* rng); 20 | 21 | // Generate a string with the web-safe string character set of specified len. 22 | std::string GenerateWebSafeString(size_t len, Http2Random* rng); 23 | 24 | // Generate a string with the web-safe string character set of length [lo, hi). 25 | std::string GenerateWebSafeString(size_t lo, size_t hi, Http2Random* rng); 26 | 27 | } // namespace test 28 | } // namespace http2 29 | 30 | #endif // QUICHE_HTTP2_TEST_TOOLS_RANDOM_UTIL_H_ 31 | -------------------------------------------------------------------------------- /gquiche/quic/core/batch_writer/quic_sendmmsg_batch_writer_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/batch_writer/quic_sendmmsg_batch_writer.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | namespace { 10 | 11 | // Add tests here. 12 | 13 | } // namespace 14 | } // namespace test 15 | } // namespace quic 16 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/aes_128_gcm_12_decrypter.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/crypto/aes_128_gcm_12_decrypter.h" 6 | 7 | #include "openssl/aead.h" 8 | #include "openssl/tls1.h" 9 | 10 | namespace quic { 11 | 12 | namespace { 13 | 14 | const size_t kKeySize = 16; 15 | const size_t kNonceSize = 12; 16 | 17 | } // namespace 18 | 19 | Aes128Gcm12Decrypter::Aes128Gcm12Decrypter() 20 | : AesBaseDecrypter(EVP_aead_aes_128_gcm, kKeySize, kAuthTagSize, kNonceSize, 21 | /* use_ietf_nonce_construction */ false) { 22 | static_assert(kKeySize <= kMaxKeySize, "key size too big"); 23 | static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big"); 24 | } 25 | 26 | Aes128Gcm12Decrypter::~Aes128Gcm12Decrypter() {} 27 | 28 | uint32_t Aes128Gcm12Decrypter::cipher_id() const { 29 | return TLS1_CK_AES_128_GCM_SHA256; 30 | } 31 | 32 | } // namespace quic 33 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/aes_128_gcm_12_encrypter.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/crypto/aes_128_gcm_12_encrypter.h" 6 | 7 | #include "openssl/evp.h" 8 | 9 | namespace quic { 10 | 11 | namespace { 12 | 13 | const size_t kKeySize = 16; 14 | const size_t kNonceSize = 12; 15 | 16 | } // namespace 17 | 18 | Aes128Gcm12Encrypter::Aes128Gcm12Encrypter() 19 | : AesBaseEncrypter(EVP_aead_aes_128_gcm, kKeySize, kAuthTagSize, kNonceSize, 20 | /* use_ietf_nonce_construction */ false) { 21 | static_assert(kKeySize <= kMaxKeySize, "key size too big"); 22 | static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big"); 23 | } 24 | 25 | Aes128Gcm12Encrypter::~Aes128Gcm12Encrypter() {} 26 | 27 | } // namespace quic 28 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/aes_128_gcm_encrypter.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/crypto/aes_128_gcm_encrypter.h" 6 | 7 | #include "openssl/evp.h" 8 | 9 | namespace quic { 10 | 11 | namespace { 12 | 13 | const size_t kKeySize = 16; 14 | const size_t kNonceSize = 12; 15 | 16 | } // namespace 17 | 18 | Aes128GcmEncrypter::Aes128GcmEncrypter() 19 | : AesBaseEncrypter(EVP_aead_aes_128_gcm, kKeySize, kAuthTagSize, kNonceSize, 20 | /* use_ietf_nonce_construction */ true) { 21 | static_assert(kKeySize <= kMaxKeySize, "key size too big"); 22 | static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big"); 23 | } 24 | 25 | Aes128GcmEncrypter::~Aes128GcmEncrypter() {} 26 | 27 | } // namespace quic 28 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/aes_256_gcm_encrypter.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/crypto/aes_256_gcm_encrypter.h" 6 | 7 | #include "openssl/evp.h" 8 | 9 | namespace quic { 10 | 11 | namespace { 12 | 13 | const size_t kKeySize = 32; 14 | const size_t kNonceSize = 12; 15 | 16 | } // namespace 17 | 18 | Aes256GcmEncrypter::Aes256GcmEncrypter() 19 | : AesBaseEncrypter(EVP_aead_aes_256_gcm, kKeySize, kAuthTagSize, kNonceSize, 20 | /* use_ietf_nonce_construction */ true) { 21 | static_assert(kKeySize <= kMaxKeySize, "key size too big"); 22 | static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big"); 23 | } 24 | 25 | Aes256GcmEncrypter::~Aes256GcmEncrypter() {} 26 | 27 | } // namespace quic 28 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/certificate_view_der_fuzzer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | #include "gquiche/quic/core/crypto/certificate_view.h" 8 | 9 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 10 | std::string input(reinterpret_cast(data), size); 11 | 12 | std::unique_ptr view = 13 | quic::CertificateView::ParseSingleCertificate(input); 14 | if (view != nullptr) { 15 | view->GetHumanReadableSubject(); 16 | } 17 | quic::CertificatePrivateKey::LoadFromDer(input); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/certificate_view_pem_fuzzer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | #include 7 | 8 | #include "gquiche/quic/core/crypto/certificate_view.h" 9 | 10 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 11 | std::string input(reinterpret_cast(data), size); 12 | std::stringstream stream(input); 13 | 14 | quic::CertificateView::LoadPemFromStream(&stream); 15 | stream.seekg(0); 16 | quic::CertificatePrivateKey::LoadPemFromStream(&stream); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/chacha_base_decrypter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_DECRYPTER_H_ 6 | #define QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_DECRYPTER_H_ 7 | 8 | #include 9 | 10 | #include "absl/strings/string_view.h" 11 | #include "gquiche/quic/core/crypto/aead_base_decrypter.h" 12 | #include "gquiche/quic/platform/api/quic_export.h" 13 | 14 | namespace quic { 15 | 16 | class QUIC_EXPORT_PRIVATE ChaChaBaseDecrypter : public AeadBaseDecrypter { 17 | public: 18 | using AeadBaseDecrypter::AeadBaseDecrypter; 19 | 20 | bool SetHeaderProtectionKey(absl::string_view key) override; 21 | std::string GenerateHeaderProtectionMask( 22 | QuicDataReader* sample_reader) override; 23 | 24 | private: 25 | // The key used for packet number encryption. 26 | unsigned char pne_key_[kMaxKeySize]; 27 | }; 28 | 29 | } // namespace quic 30 | 31 | #endif // QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_DECRYPTER_H_ 32 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/chacha_base_encrypter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_ENCRYPTER_H_ 6 | #define QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_ENCRYPTER_H_ 7 | 8 | #include 9 | 10 | #include "absl/strings/string_view.h" 11 | #include "gquiche/quic/core/crypto/aead_base_encrypter.h" 12 | #include "gquiche/quic/platform/api/quic_export.h" 13 | 14 | namespace quic { 15 | 16 | class QUIC_EXPORT_PRIVATE ChaChaBaseEncrypter : public AeadBaseEncrypter { 17 | public: 18 | using AeadBaseEncrypter::AeadBaseEncrypter; 19 | 20 | bool SetHeaderProtectionKey(absl::string_view key) override; 21 | std::string GenerateHeaderProtectionMask(absl::string_view sample) override; 22 | 23 | private: 24 | // The key used for packet number encryption. 25 | unsigned char pne_key_[kMaxKeySize]; 26 | }; 27 | 28 | } // namespace quic 29 | 30 | #endif // QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_ENCRYPTER_H_ 31 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/quic_crypter.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/crypto/quic_crypter.h" 6 | 7 | #include "absl/strings/string_view.h" 8 | 9 | namespace quic { 10 | 11 | bool QuicCrypter::SetNoncePrefixOrIV(const ParsedQuicVersion& version, 12 | absl::string_view nonce_prefix_or_iv) { 13 | if (version.UsesInitialObfuscators()) { 14 | return SetIV(nonce_prefix_or_iv); 15 | } 16 | return SetNoncePrefix(nonce_prefix_or_iv); 17 | } 18 | 19 | } // namespace quic 20 | -------------------------------------------------------------------------------- /gquiche/quic/core/crypto/quic_crypto_proof.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/crypto/quic_crypto_proof.h" 6 | 7 | namespace quic { 8 | 9 | QuicCryptoProof::QuicCryptoProof() 10 | : send_expect_ct_header(false), cert_matched_sni(false) {} 11 | 12 | } // namespace quic 13 | -------------------------------------------------------------------------------- /gquiche/quic/core/frames/quic_handshake_done_frame.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/frames/quic_handshake_done_frame.h" 6 | 7 | namespace quic { 8 | 9 | QuicHandshakeDoneFrame::QuicHandshakeDoneFrame() 10 | : QuicInlinedFrame(HANDSHAKE_DONE_FRAME) {} 11 | 12 | QuicHandshakeDoneFrame::QuicHandshakeDoneFrame( 13 | QuicControlFrameId control_frame_id) 14 | : QuicInlinedFrame(HANDSHAKE_DONE_FRAME), 15 | control_frame_id(control_frame_id) {} 16 | 17 | std::ostream& operator<<(std::ostream& os, 18 | const QuicHandshakeDoneFrame& handshake_done_frame) { 19 | os << "{ control_frame_id: " << handshake_done_frame.control_frame_id 20 | << " }\n"; 21 | return os; 22 | } 23 | 24 | } // namespace quic 25 | -------------------------------------------------------------------------------- /gquiche/quic/core/frames/quic_mtu_discovery_frame.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_FRAMES_QUIC_MTU_DISCOVERY_FRAME_H_ 6 | #define QUICHE_QUIC_CORE_FRAMES_QUIC_MTU_DISCOVERY_FRAME_H_ 7 | 8 | #include "gquiche/quic/core/frames/quic_inlined_frame.h" 9 | #include "gquiche/quic/core/quic_types.h" 10 | #include "gquiche/quic/platform/api/quic_export.h" 11 | 12 | namespace quic { 13 | 14 | // A path MTU discovery frame contains no payload and is serialized as a ping 15 | // frame. 16 | struct QUIC_EXPORT_PRIVATE QuicMtuDiscoveryFrame 17 | : public QuicInlinedFrame { 18 | QuicMtuDiscoveryFrame() : QuicInlinedFrame(MTU_DISCOVERY_FRAME) {} 19 | 20 | QuicFrameType type; 21 | }; 22 | 23 | } // namespace quic 24 | 25 | #endif // QUICHE_QUIC_CORE_FRAMES_QUIC_MTU_DISCOVERY_FRAME_H_ 26 | -------------------------------------------------------------------------------- /gquiche/quic/core/frames/quic_new_token_frame.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/frames/quic_new_token_frame.h" 6 | 7 | #include "absl/strings/escaping.h" 8 | #include "gquiche/quic/platform/api/quic_logging.h" 9 | 10 | namespace quic { 11 | 12 | QuicNewTokenFrame::QuicNewTokenFrame(QuicControlFrameId control_frame_id, 13 | absl::string_view token) 14 | : control_frame_id(control_frame_id), 15 | token(std::string(token.data(), token.length())) {} 16 | 17 | std::ostream& operator<<(std::ostream& os, const QuicNewTokenFrame& s) { 18 | os << "{ control_frame_id: " << s.control_frame_id 19 | << ", token: " << absl::BytesToHexString(s.token) << " }\n"; 20 | return os; 21 | } 22 | 23 | } // namespace quic 24 | -------------------------------------------------------------------------------- /gquiche/quic/core/frames/quic_padding_frame.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/frames/quic_padding_frame.h" 6 | 7 | namespace quic { 8 | 9 | std::ostream& operator<<(std::ostream& os, 10 | const QuicPaddingFrame& padding_frame) { 11 | os << "{ num_padding_bytes: " << padding_frame.num_padding_bytes << " }\n"; 12 | return os; 13 | } 14 | 15 | } // namespace quic 16 | -------------------------------------------------------------------------------- /gquiche/quic/core/frames/quic_ping_frame.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/frames/quic_ping_frame.h" 6 | 7 | namespace quic { 8 | 9 | QuicPingFrame::QuicPingFrame() : QuicInlinedFrame(PING_FRAME) {} 10 | 11 | QuicPingFrame::QuicPingFrame(QuicControlFrameId control_frame_id) 12 | : QuicInlinedFrame(PING_FRAME), control_frame_id(control_frame_id) {} 13 | 14 | std::ostream& operator<<(std::ostream& os, const QuicPingFrame& ping_frame) { 15 | os << "{ control_frame_id: " << ping_frame.control_frame_id << " }\n"; 16 | return os; 17 | } 18 | 19 | } // namespace quic 20 | -------------------------------------------------------------------------------- /gquiche/quic/core/frames/quic_retire_connection_id_frame.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/frames/quic_retire_connection_id_frame.h" 6 | 7 | namespace quic { 8 | 9 | QuicRetireConnectionIdFrame::QuicRetireConnectionIdFrame( 10 | QuicControlFrameId control_frame_id, 11 | QuicConnectionIdSequenceNumber sequence_number) 12 | : control_frame_id(control_frame_id), sequence_number(sequence_number) {} 13 | 14 | std::ostream& operator<<(std::ostream& os, 15 | const QuicRetireConnectionIdFrame& frame) { 16 | os << "{ control_frame_id: " << frame.control_frame_id 17 | << ", sequence_number: " << frame.sequence_number << " }\n"; 18 | return os; 19 | } 20 | 21 | } // namespace quic 22 | -------------------------------------------------------------------------------- /gquiche/quic/core/frames/quic_stop_waiting_frame.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/frames/quic_stop_waiting_frame.h" 6 | 7 | #include "gquiche/quic/core/quic_constants.h" 8 | 9 | namespace quic { 10 | 11 | QuicStopWaitingFrame::QuicStopWaitingFrame() 12 | : QuicInlinedFrame(STOP_WAITING_FRAME) {} 13 | 14 | std::ostream& operator<<(std::ostream& os, 15 | const QuicStopWaitingFrame& sent_info) { 16 | os << "{ least_unacked: " << sent_info.least_unacked << " }\n"; 17 | return os; 18 | } 19 | 20 | } // namespace quic 21 | -------------------------------------------------------------------------------- /gquiche/quic/core/io/quic_default_event_loop.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_IO_QUIC_DEFAULT_EVENT_LOOP_H_ 6 | #define QUICHE_QUIC_CORE_IO_QUIC_DEFAULT_EVENT_LOOP_H_ 7 | 8 | #include 9 | 10 | #include "gquiche/quic/core/io/quic_event_loop.h" 11 | 12 | namespace quic { 13 | 14 | // Returns the default implementation of QuicheEventLoop. The embedders can 15 | // override this using the platform API. The factory pointer returned is an 16 | // unowned static variable. 17 | QUICHE_NO_EXPORT QuicEventLoopFactory* GetDefaultEventLoop(); 18 | 19 | // Returns the factory objects for all event loops. This is particularly useful 20 | // for the unit tests. The factory pointers returned are unowned static 21 | // variables. 22 | QUICHE_NO_EXPORT std::vector GetAllSupportedEventLoops(); 23 | 24 | } // namespace quic 25 | 26 | #endif // QUICHE_QUIC_CORE_IO_QUIC_DEFAULT_EVENT_LOOP_H_ 27 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/zl/quiche/quiche") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/zl/quiche/quiche") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/QuicCoreProto.dir/cached_network_parameters.pb.cc.o" 3 | "CMakeFiles/QuicCoreProto.dir/cached_network_parameters.pb.cc.o.d" 4 | "CMakeFiles/QuicCoreProto.dir/crypto_server_config.pb.cc.o" 5 | "CMakeFiles/QuicCoreProto.dir/crypto_server_config.pb.cc.o.d" 6 | "CMakeFiles/QuicCoreProto.dir/source_address_token.pb.cc.o" 7 | "CMakeFiles/QuicCoreProto.dir/source_address_token.pb.cc.o.d" 8 | "cached_network_parameters.pb.cc" 9 | "cached_network_parameters.pb.h" 10 | "crypto_server_config.pb.cc" 11 | "crypto_server_config.pb.h" 12 | "libQuicCoreProto.a" 13 | "libQuicCoreProto.pdb" 14 | "source_address_token.pb.cc" 15 | "source_address_token.pb.h" 16 | ) 17 | 18 | # Per-language clean rules from dependency scanning. 19 | foreach(lang CXX) 20 | include(CMakeFiles/QuicCoreProto.dir/cmake_clean_${lang}.cmake OPTIONAL) 21 | endforeach() 22 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/cmake_clean_target.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "libQuicCoreProto.a" 3 | ) 4 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/compiler_depend.make: -------------------------------------------------------------------------------- 1 | # Empty compiler generated dependencies file for QuicCoreProto. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/compiler_depend.ts: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Timestamp file for compiler generated dependencies management for QuicCoreProto. 3 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for QuicCoreProto. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_DEFINES = 6 | 7 | CXX_INCLUDES = -I/home/zl/quiche/quiche/third_party/fmt/include -I/home/zl/quiche/quiche/third_party/spdlog/include -I/home/zl/quiche/quiche/third_party/abseil-cpp -I/home/zl/quiche/quiche/third_party/boringssl/include -I/home/zl/quiche/quiche/third_party/rapidjson/include -I/home/zl/quiche/quiche -I/home/zl/quiche/quiche/quiche -I/home/zl/quiche/quiche/googleurl -I/home/zl/quiche/quiche/gquiche/quic/core/proto 8 | 9 | CXX_FLAGS = -Wno-error=unused-result -O3 -DNDEBUG 10 | 11 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/ar qc libQuicCoreProto.a CMakeFiles/QuicCoreProto.dir/cached_network_parameters.pb.cc.o CMakeFiles/QuicCoreProto.dir/crypto_server_config.pb.cc.o CMakeFiles/QuicCoreProto.dir/source_address_token.pb.cc.o 2 | /usr/bin/ranlib libQuicCoreProto.a 3 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/QuicCoreProto.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 2 | CMAKE_PROGRESS_2 = 3 | CMAKE_PROGRESS_3 = 4 | CMAKE_PROGRESS_4 = 5 | CMAKE_PROGRESS_5 = 6 | CMAKE_PROGRESS_6 = 7 | CMAKE_PROGRESS_7 = 8 | 9 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/cached_network_parameters_proto.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_PROTO_CACHED_NETWORK_PARAMETERS_PROTO_H_ 6 | #define QUICHE_QUIC_CORE_PROTO_CACHED_NETWORK_PARAMETERS_PROTO_H_ 7 | 8 | #pragma GCC diagnostic push 9 | #pragma GCC diagnostic ignored "-Wall" 10 | 11 | #include "gquiche/quic/core/proto/cached_network_parameters.pb.h" 12 | 13 | #pragma GCC diagnostic pop 14 | 15 | #endif // QUICHE_QUIC_CORE_PROTO_CACHED_NETWORK_PARAMETERS_PROTO_H_ 16 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/crypto_server_config_proto.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_PROTO_CRYPTO_SERVER_CONFIG_PROTO_H_ 6 | #define QUICHE_QUIC_CORE_PROTO_CRYPTO_SERVER_CONFIG_PROTO_H_ 7 | 8 | #pragma GCC diagnostic push 9 | #pragma GCC diagnostic ignored "-Wall" 10 | 11 | #include "gquiche/quic/core/proto/crypto_server_config.pb.h" 12 | 13 | #pragma GCC diagnostic pop 14 | 15 | #endif // QUICHE_QUIC_CORE_PROTO_CRYPTO_SERVER_CONFIG_PROTO_H_ 16 | -------------------------------------------------------------------------------- /gquiche/quic/core/proto/source_address_token_proto.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_PROTO_SOURCE_ADDRESS_TOKEN_PROTO_H_ 6 | #define QUICHE_QUIC_CORE_PROTO_SOURCE_ADDRESS_TOKEN_PROTO_H_ 7 | 8 | #pragma GCC diagnostic push 9 | #pragma GCC diagnostic ignored "-Wall" 10 | 11 | #include "gquiche/quic/core/proto/source_address_token.pb.h" 12 | 13 | #pragma GCC diagnostic pop 14 | 15 | #endif // QUICHE_QUIC_CORE_PROTO_SOURCE_ADDRESS_TOKEN_PROTO_H_ 16 | -------------------------------------------------------------------------------- /gquiche/quic/core/qpack/qpack_stream_receiver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_RECEIVER_H_ 6 | #define QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_RECEIVER_H_ 7 | 8 | #include "absl/strings/string_view.h" 9 | #include "gquiche/quic/platform/api/quic_export.h" 10 | 11 | namespace quic { 12 | 13 | // This interface decodes QPACK data that are received on a QpackReceiveStream. 14 | class QUIC_EXPORT_PRIVATE QpackStreamReceiver { 15 | public: 16 | virtual ~QpackStreamReceiver() = default; 17 | 18 | // Decode data. 19 | virtual void Decode(absl::string_view data) = 0; 20 | }; 21 | 22 | } // namespace quic 23 | 24 | #endif // QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_RECEIVER_H_ 25 | -------------------------------------------------------------------------------- /gquiche/quic/core/qpack/qpack_stream_sender_delegate.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_SENDER_DELEGATE_H_ 6 | #define QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_SENDER_DELEGATE_H_ 7 | 8 | #include "absl/strings/string_view.h" 9 | #include "gquiche/quic/platform/api/quic_export.h" 10 | 11 | namespace quic { 12 | 13 | // This interface writes encoder/decoder data to peer. 14 | class QUIC_EXPORT_PRIVATE QpackStreamSenderDelegate { 15 | public: 16 | virtual ~QpackStreamSenderDelegate() = default; 17 | 18 | // Write data on the unidirectional stream. 19 | virtual void WriteStreamData(absl::string_view data) = 0; 20 | 21 | // Return the number of bytes buffered due to underlying stream being blocked. 22 | virtual uint64_t NumBytesBuffered() const = 0; 23 | }; 24 | 25 | } // namespace quic 26 | 27 | #endif // QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_SENDER_DELEGATE_H_ 28 | -------------------------------------------------------------------------------- /gquiche/quic/core/quic_ack_listener_interface.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/quic_ack_listener_interface.h" 6 | 7 | namespace quic { 8 | 9 | QuicAckListenerInterface::~QuicAckListenerInterface() {} 10 | 11 | } // namespace quic 12 | -------------------------------------------------------------------------------- /gquiche/quic/core/quic_blocked_writer_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // This is an interface for all objects that want to be notified that 6 | // the underlying UDP socket is available for writing (not write blocked 7 | // anymore). 8 | 9 | #ifndef QUICHE_QUIC_CORE_QUIC_BLOCKED_WRITER_INTERFACE_H_ 10 | #define QUICHE_QUIC_CORE_QUIC_BLOCKED_WRITER_INTERFACE_H_ 11 | 12 | #include "gquiche/quic/platform/api/quic_export.h" 13 | 14 | namespace quic { 15 | 16 | class QUIC_EXPORT_PRIVATE QuicBlockedWriterInterface { 17 | public: 18 | virtual ~QuicBlockedWriterInterface() {} 19 | 20 | // Called by the PacketWriter when the underlying socket becomes writable 21 | // so that the BlockedWriter can go ahead and try writing. 22 | virtual void OnBlockedWriterCanWrite() = 0; 23 | 24 | virtual bool IsWriterBlocked() const = 0; 25 | }; 26 | 27 | } // namespace quic 28 | 29 | #endif // QUICHE_QUIC_CORE_QUIC_BLOCKED_WRITER_INTERFACE_H_ 30 | -------------------------------------------------------------------------------- /gquiche/quic/core/quic_constants.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/quic_constants.h" 6 | 7 | namespace quic { 8 | 9 | const char* const kFinalOffsetHeaderKey = ":final-offset"; 10 | 11 | const char* const kEPIDGoogleFrontEnd = "GFE"; 12 | const char* const kEPIDGoogleFrontEnd0 = "GFE0"; 13 | 14 | QuicPacketNumber MaxRandomInitialPacketNumber() { 15 | static const QuicPacketNumber kMaxRandomInitialPacketNumber = 16 | QuicPacketNumber(0x7fffffff); 17 | return kMaxRandomInitialPacketNumber; 18 | } 19 | 20 | QuicPacketNumber FirstSendingPacketNumber() { 21 | static const QuicPacketNumber kFirstSendingPacketNumber = QuicPacketNumber(1); 22 | return kFirstSendingPacketNumber; 23 | } 24 | 25 | } // namespace quic 26 | -------------------------------------------------------------------------------- /gquiche/quic/core/quic_default_clock.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/core/quic_default_clock.h" 6 | 7 | #include "absl/time/clock.h" 8 | 9 | namespace quic { 10 | 11 | QuicDefaultClock* QuicDefaultClock::Get() { 12 | static QuicDefaultClock* clock = new QuicDefaultClock(); 13 | return clock; 14 | } 15 | 16 | QuicTime QuicDefaultClock::ApproximateNow() const { return Now(); } 17 | 18 | QuicTime QuicDefaultClock::Now() const { 19 | return CreateTimeFromMicroseconds(absl::GetCurrentTimeNanos() / 1000); 20 | } 21 | 22 | QuicWallTime QuicDefaultClock::WallNow() const { 23 | return QuicWallTime::FromUNIXMicroseconds(absl::GetCurrentTimeNanos() / 1000); 24 | } 25 | 26 | QuicTime QuicDefaultClock::ConvertWallTimeToQuicTime( 27 | const QuicWallTime& walltime) const { 28 | return CreateTimeFromMicroseconds(walltime.ToUNIXMicroseconds()); 29 | } 30 | 31 | } // namespace quic 32 | -------------------------------------------------------------------------------- /gquiche/quic/core/quic_process_packet_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_CORE_QUIC_PROCESS_PACKET_INTERFACE_H_ 6 | #define QUICHE_QUIC_CORE_QUIC_PROCESS_PACKET_INTERFACE_H_ 7 | 8 | #include "gquiche/quic/core/quic_packets.h" 9 | #include "gquiche/quic/platform/api/quic_socket_address.h" 10 | 11 | namespace quic { 12 | 13 | // A class to process each incoming packet. 14 | class QUIC_NO_EXPORT ProcessPacketInterface { 15 | public: 16 | virtual ~ProcessPacketInterface() {} 17 | virtual void ProcessPacket(const QuicSocketAddress& self_address, 18 | const QuicSocketAddress& peer_address, 19 | const QuicReceivedPacket& packet) = 0; 20 | }; 21 | 22 | } // namespace quic 23 | 24 | #endif // QUICHE_QUIC_CORE_QUIC_PROCESS_PACKET_INTERFACE_H_ 25 | -------------------------------------------------------------------------------- /gquiche/quic/masque/README.md: -------------------------------------------------------------------------------- 1 | # MASQUE 2 | 3 | The files in this directory implement MASQUE as described in 4 | . 5 | -------------------------------------------------------------------------------- /gquiche/quic/platform/README.md: -------------------------------------------------------------------------------- 1 | # QUIC platform 2 | 3 | This platform/ directory exists in order to allow QUIC code to be built on 4 | numerous platforms. It contains two subdirectories: 5 | 6 | - api/ contains platform independent class definitions for fundamental data 7 | structures (e.g., IPAddress, SocketAddress, etc.). 8 | - impl/ contains platform specific implementations of these data structures. 9 | The content of files in impl/ will vary depending on the platform. 10 | 11 | Code in the parent quic/ directory should not depend on any platform specific 12 | code, other than that found in impl/. 13 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_bug_tracker.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_BUG_TRACKER_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_BUG_TRACKER_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_bug_tracker.h" 9 | 10 | #define QUIC_BUG QUICHE_BUG 11 | #define QUIC_BUG_IF QUICHE_BUG_IF 12 | #define QUIC_PEER_BUG QUICHE_PEER_BUG 13 | #define QUIC_PEER_BUG_IF QUICHE_PEER_BUG_IF 14 | 15 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_BUG_TRACKER_H_ 16 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_epoll.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_EPOLL_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_EPOLL_H_ 7 | 8 | #include "platform/quic_platform_impl/quic_epoll_impl.h" 9 | 10 | namespace quic { 11 | 12 | using QuicEpollServer = QuicEpollServerImpl; 13 | using QuicEpollEvent = QuicEpollEventImpl; 14 | using QuicEpollAlarmBase = QuicEpollAlarmBaseImpl; 15 | using QuicEpollCallbackInterface = QuicEpollCallbackInterfaceImpl; 16 | 17 | } // namespace quic 18 | 19 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_EPOLL_H_ 20 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_expect_bug.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_EXPECT_BUG_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_EXPECT_BUG_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_expect_bug.h" 9 | 10 | #define EXPECT_QUIC_BUG EXPECT_QUICHE_BUG 11 | #define EXPECT_QUIC_PEER_BUG(statement, regex) \ 12 | EXPECT_QUICHE_PEER_BUG(statement, regex) 13 | 14 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_EXPECT_BUG_H_ 15 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_export.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_EXPORT_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_EXPORT_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_export.h" 9 | 10 | // QUIC_EXPORT is not meant to be used. 11 | #define QUIC_EXPORT QUICHE_EXPORT 12 | 13 | // QUIC_EXPORT_PRIVATE is meant for QUIC functionality that is built in Chromium 14 | // as part of //net, and not fully contained in headers. 15 | #define QUIC_EXPORT_PRIVATE QUICHE_EXPORT_PRIVATE 16 | 17 | // QUIC_NO_EXPORT is meant for QUIC functionality that is either fully defined 18 | // in a header, or is built in Chromium as part of tests or tools. 19 | #define QUIC_NO_EXPORT QUICHE_NO_EXPORT 20 | 21 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_EXPORT_H_ 22 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_flag_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_FLAG_UTILS_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_FLAG_UTILS_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_flag_utils.h" 9 | 10 | #define QUIC_RELOADABLE_FLAG_COUNT QUICHE_RELOADABLE_FLAG_COUNT 11 | #define QUIC_RELOADABLE_FLAG_COUNT_N QUICHE_RELOADABLE_FLAG_COUNT_N 12 | 13 | #define QUIC_RESTART_FLAG_COUNT QUICHE_RESTART_FLAG_COUNT 14 | #define QUIC_RESTART_FLAG_COUNT_N QUICHE_RESTART_FLAG_COUNT_N 15 | 16 | #define QUIC_CODE_COUNT QUICHE_CODE_COUNT 17 | #define QUIC_CODE_COUNT_N QUICHE_CODE_COUNT_N 18 | 19 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_FLAG_UTILS_H_ 20 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_flags.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_FLAGS_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_FLAGS_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "gquiche/common/platform/api/quiche_flags.h" 12 | 13 | #define GetQuicReloadableFlag(flag) GetQuicheReloadableFlag(quic, flag) 14 | #define SetQuicReloadableFlag(flag, value) \ 15 | SetQuicheReloadableFlag(quic, flag, value) 16 | #define GetQuicRestartFlag(flag) GetQuicheRestartFlag(quic, flag) 17 | #define SetQuicRestartFlag(flag, value) SetQuicheRestartFlag(quic, flag, value) 18 | #define GetQuicFlag(flag) GetQuicheFlag(flag) 19 | #define SetQuicFlag(flag, value) SetQuicheFlag(flag, value) 20 | 21 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_FLAGS_H_ 22 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_hostname_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_HOSTNAME_UTILS_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_HOSTNAME_UTILS_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_hostname_utils.h" 9 | 10 | namespace quic { 11 | 12 | using QuicHostnameUtils = quiche::QuicheHostnameUtils; 13 | 14 | } // namespace quic 15 | 16 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_HOSTNAME_UTILS_H_ 17 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_ip_address.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ 7 | 8 | #include "gquiche/common/quiche_ip_address.h" 9 | 10 | namespace quic { 11 | 12 | using QuicIpAddress = ::quiche::QuicheIpAddress; 13 | 14 | } // namespace quic 15 | 16 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ 17 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_ip_address_family.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_FAMILY_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_FAMILY_H_ 7 | 8 | #include "gquiche/common/quiche_ip_address_family.h" 9 | 10 | namespace quic { 11 | 12 | using IpAddressFamily = ::quiche::IpAddressFamily; 13 | 14 | } // namespace quic 15 | 16 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_FAMILY_H_ 17 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_stack_trace.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_STACK_TRACE_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_STACK_TRACE_H_ 7 | 8 | #include 9 | 10 | #include "gquiche/common/platform/api/quiche_stack_trace.h" 11 | 12 | namespace quic { 13 | 14 | inline std::string QuicStackTrace() { return quiche::QuicheStackTrace(); } 15 | 16 | } // namespace quic 17 | 18 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_STACK_TRACE_H_ 19 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_test.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_ 7 | 8 | #include "gquiche/quic/platform/api/quic_logging.h" 9 | #include "gquiche/common/platform/api/quiche_test.h" 10 | 11 | namespace quic::test { 12 | 13 | using QuicFlagSaver = quiche::test::QuicheFlagSaver; 14 | 15 | // Defines the base classes to be used in QUIC tests. 16 | using QuicTest = quiche::test::QuicheTest; 17 | template 18 | using QuicTestWithParam = quiche::test::QuicheTestWithParam; 19 | 20 | } // namespace quic::test 21 | 22 | #define QUIC_TEST_DISABLED_IN_CHROME(name) QUICHE_TEST_DISABLED_IN_CHROME(name) 23 | 24 | #define QUIC_SLOW_TEST(test) QUICHE_SLOW_TEST(test) 25 | 26 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_ 27 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_test_output.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TEST_OUTPUT_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_OUTPUT_H_ 7 | 8 | #include "absl/strings/string_view.h" 9 | #include "gquiche/common/platform/api/quiche_test_output.h" 10 | 11 | namespace quic { 12 | 13 | inline void QuicSaveTestOutput(absl::string_view filename, 14 | absl::string_view data) { 15 | quiche::QuicheSaveTestOutput(filename, data); 16 | } 17 | 18 | inline bool QuicLoadTestOutput(absl::string_view filename, std::string* data) { 19 | return quiche::QuicheLoadTestOutput(filename, data); 20 | } 21 | 22 | inline void QuicRecordTrace(absl::string_view identifier, 23 | absl::string_view data) { 24 | quiche::QuicheRecordTrace(identifier, data); 25 | } 26 | 27 | } // namespace quic 28 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_TEST_OUTPUT_H_ 29 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_testvalue.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // TODO(b/178613777): Remove this file. 6 | 7 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TESTVALUE_H_ 8 | #define QUICHE_QUIC_PLATFORM_API_QUIC_TESTVALUE_H_ 9 | 10 | #include "absl/strings/string_view.h" 11 | #include "gquiche/common/platform/api/quiche_testvalue.h" 12 | 13 | namespace quic { 14 | 15 | template 16 | void AdjustTestValue(absl::string_view label, T* var) { 17 | quiche::AdjustTestValue(label, var); 18 | } 19 | 20 | } // namespace quic 21 | 22 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_TESTVALUE_H_ 23 | -------------------------------------------------------------------------------- /gquiche/quic/platform/api/quic_thread.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_THREAD_H_ 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_THREAD_H_ 7 | 8 | #include "gquiche/common/platform/api/quiche_thread.h" 9 | 10 | namespace quic { 11 | 12 | using QuicThread = quiche::QuicheThread; 13 | 14 | } // namespace quic 15 | 16 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_THREAD_H_ 17 | -------------------------------------------------------------------------------- /gquiche/quic/proto_test/SpdyFramerVisitor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aazhuliang/GQUIC_043_decrypt/fbcaa66f1eb5d79ab49afc6ea3eaf9cd67107fc5/gquiche/quic/proto_test/SpdyFramerVisitor.h -------------------------------------------------------------------------------- /gquiche/quic/proto_test/client_session.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aazhuliang/GQUIC_043_decrypt/fbcaa66f1eb5d79ab49afc6ea3eaf9cd67107fc5/gquiche/quic/proto_test/client_session.cc -------------------------------------------------------------------------------- /gquiche/quic/proto_test/client_session.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "session.h" 3 | #include 4 | #include "hand_shake_visitor.h" 5 | namespace ProtoTest 6 | { 7 | class ClientSession : public Session 8 | { 9 | public: 10 | ClientSession() : Session(quic::Perspective::IS_CLIENT) 11 | { 12 | current_state_ = Session::State::RECV_REJ; 13 | client_session_ = this; 14 | }; 15 | ~ClientSession() override; 16 | void OnHandshakeMessage(const quic::CryptoHandshakeMessage& message) override; 17 | bool OnCryptoFrame(const quic::QuicStreamFrame& frame) override; 18 | private: 19 | 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /gquiche/quic/proto_test/hand_shake_visitor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_visitor.h" 4 | #include "gquiche/quic/core/crypto/crypto_framer.h" 5 | 6 | namespace ProtoTest 7 | { 8 | class HandShakeVisitor : public ProtoTest::QuicPacketPrinter, 9 | public quic::CryptoFramerVisitorInterface 10 | { 11 | public: 12 | HandShakeVisitor(QuicFramer* framer, Session* session) : QuicPacketPrinter(framer, session), crypto_framer_() 13 | { 14 | crypto_framer_.set_visitor(this); 15 | }; 16 | ~HandShakeVisitor() override {}; 17 | bool OnStreamFrame(const QuicStreamFrame& frame) override; 18 | bool OnHandshakeData(absl::string_view data); 19 | virtual bool OnPacketHeader(const quic::QuicPacketHeader& /*header*/) override; 20 | // CryptoFramerVisitorInterface implementation. 21 | void OnError(CryptoFramer* framer) override; 22 | void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; 23 | 24 | private: 25 | quic::CryptoFramer crypto_framer_; 26 | }; 27 | 28 | } -------------------------------------------------------------------------------- /gquiche/quic/proto_test/pcap_reader.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aazhuliang/GQUIC_043_decrypt/fbcaa66f1eb5d79ab49afc6ea3eaf9cd67107fc5/gquiche/quic/proto_test/pcap_reader.cc -------------------------------------------------------------------------------- /gquiche/quic/proto_test/server_session.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "session.h" 3 | #include 4 | 5 | 6 | 7 | 8 | namespace ProtoTest 9 | { 10 | class ServerSession : public Session 11 | { 12 | public: 13 | ServerSession() ; 14 | ~ServerSession() override; 15 | void OnHandshakeMessage(const quic::CryptoHandshakeMessage& message) override; 16 | bool OnCryptoFrame(const quic::QuicStreamFrame& frame) override; 17 | 18 | private: 19 | 20 | }; 21 | } -------------------------------------------------------------------------------- /gquiche/quic/proto_test/session.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aazhuliang/GQUIC_043_decrypt/fbcaa66f1eb5d79ab49afc6ea3eaf9cd67107fc5/gquiche/quic/proto_test/session.cc -------------------------------------------------------------------------------- /gquiche/quic/qbone/bonnet/icmp_reachable_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_BONNET_ICMP_REACHABLE_INTERFACE_H_ 6 | #define QUICHE_QUIC_QBONE_BONNET_ICMP_REACHABLE_INTERFACE_H_ 7 | 8 | namespace quic { 9 | 10 | class IcmpReachableInterface { 11 | public: 12 | IcmpReachableInterface() = default; 13 | virtual ~IcmpReachableInterface() = default; 14 | 15 | IcmpReachableInterface(const IcmpReachableInterface&) = delete; 16 | IcmpReachableInterface& operator=(const IcmpReachableInterface&) = delete; 17 | 18 | IcmpReachableInterface(IcmpReachableInterface&&) = delete; 19 | IcmpReachableInterface& operator=(IcmpReachableInterface&&) = delete; 20 | 21 | // Initializes this reachability probe. 22 | virtual bool Init() = 0; 23 | }; 24 | 25 | } // namespace quic 26 | 27 | #endif // QUICHE_QUIC_QBONE_BONNET_ICMP_REACHABLE_INTERFACE_H_ 28 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/bonnet/mock_icmp_reachable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_BONNET_MOCK_ICMP_REACHABLE_H_ 6 | #define QUICHE_QUIC_QBONE_BONNET_MOCK_ICMP_REACHABLE_H_ 7 | 8 | #include "gquiche/quic/platform/api/quic_test.h" 9 | #include "gquiche/quic/qbone/bonnet/icmp_reachable_interface.h" 10 | 11 | namespace quic { 12 | 13 | class MockIcmpReachable : public IcmpReachableInterface { 14 | public: 15 | MOCK_METHOD(bool, Init, (), (override)); 16 | }; 17 | 18 | } // namespace quic 19 | 20 | #endif // QUICHE_QUIC_QBONE_BONNET_MOCK_ICMP_REACHABLE_H_ 21 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/bonnet/mock_tun_device.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_BONNET_MOCK_TUN_DEVICE_H_ 6 | #define QUICHE_QUIC_QBONE_BONNET_MOCK_TUN_DEVICE_H_ 7 | 8 | #include "gquiche/quic/platform/api/quic_test.h" 9 | #include "gquiche/quic/qbone/bonnet/tun_device_interface.h" 10 | 11 | namespace quic { 12 | 13 | class MockTunDevice : public TunDeviceInterface { 14 | public: 15 | MOCK_METHOD(bool, Init, (), (override)); 16 | 17 | MOCK_METHOD(bool, Up, (), (override)); 18 | 19 | MOCK_METHOD(bool, Down, (), (override)); 20 | 21 | MOCK_METHOD(void, CloseDevice, (), (override)); 22 | 23 | MOCK_METHOD(int, GetFileDescriptor, (), (const, override)); 24 | }; 25 | 26 | } // namespace quic 27 | 28 | #endif // QUICHE_QUIC_QBONE_BONNET_MOCK_TUN_DEVICE_H_ 29 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/bonnet/mock_tun_device_controller.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_BONNET_MOCK_TUN_DEVICE_CONTROLLER_H_ 6 | #define QUICHE_QUIC_QBONE_BONNET_MOCK_TUN_DEVICE_CONTROLLER_H_ 7 | 8 | #include "gquiche/quic/platform/api/quic_test.h" 9 | #include "gquiche/quic/qbone/bonnet/tun_device_controller.h" 10 | 11 | namespace quic { 12 | 13 | class MockTunDeviceController : public TunDeviceController { 14 | public: 15 | MockTunDeviceController() : TunDeviceController("", true, nullptr) {} 16 | 17 | MOCK_METHOD(bool, UpdateAddress, (const IpRange&), (override)); 18 | 19 | MOCK_METHOD(bool, UpdateRoutes, (const IpRange&, const std::vector&), 20 | (override)); 21 | 22 | MOCK_METHOD(QuicIpAddress, current_address, (), (override)); 23 | }; 24 | 25 | } // namespace quic 26 | 27 | #endif // QUICHE_QUIC_QBONE_BONNET_MOCK_TUN_DEVICE_CONTROLLER_H_ 28 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/bonnet/qbone_tunnel_info.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_BONNET_QBONE_TUNNEL_INFO_H_ 6 | #define QUICHE_QUIC_QBONE_BONNET_QBONE_TUNNEL_INFO_H_ 7 | 8 | #include "gquiche/quic/platform/api/quic_ip_address.h" 9 | #include "gquiche/quic/qbone/platform/netlink_interface.h" 10 | 11 | namespace quic { 12 | 13 | class QboneTunnelInfo { 14 | public: 15 | QboneTunnelInfo(std::string ifname, NetlinkInterface* netlink) 16 | : ifname_(std::move(ifname)), netlink_(netlink) {} 17 | 18 | // Returns the current QBONE tunnel address. Callers must use IsInitialized() 19 | // to ensure the returned address is valid. 20 | QuicIpAddress GetAddress(); 21 | 22 | private: 23 | const std::string ifname_; 24 | NetlinkInterface* netlink_; 25 | }; 26 | 27 | } // namespace quic 28 | 29 | #endif // QUICHE_QUIC_QBONE_BONNET_QBONE_TUNNEL_INFO_H_ 30 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/bonnet/qbone_tunnel_silo.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/qbone/bonnet/qbone_tunnel_silo.h" 6 | 7 | namespace quic { 8 | 9 | void QboneTunnelSilo::Run() { 10 | while (ShouldRun()) { 11 | tunnel_->WaitForEvents(); 12 | } 13 | 14 | QUIC_LOG(INFO) << "Tunnel has disconnected in state: " 15 | << tunnel_->StateToString(tunnel_->Disconnect()); 16 | } 17 | 18 | void QboneTunnelSilo::Quit() { 19 | QUIC_LOG(INFO) << "Quit called on QboneTunnelSilo"; 20 | quitting_.Notify(); 21 | tunnel_->Wake(); 22 | } 23 | 24 | bool QboneTunnelSilo::ShouldRun() { 25 | bool post_init_shutdown_ready = 26 | only_setup_tun_ && 27 | tunnel_->state() == quic::QboneTunnelInterface::STARTED; 28 | return !quitting_.HasBeenNotified() && !post_init_shutdown_ready; 29 | } 30 | 31 | } // namespace quic 32 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/mock_qbone_client.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_MOCK_QBONE_CLIENT_H_ 6 | #define QUICHE_QUIC_QBONE_MOCK_QBONE_CLIENT_H_ 7 | 8 | #include "absl/strings/string_view.h" 9 | #include "gquiche/quic/platform/api/quic_test.h" 10 | #include "gquiche/quic/qbone/qbone_client_interface.h" 11 | 12 | namespace quic { 13 | 14 | class MockQboneClient : public QboneClientInterface { 15 | public: 16 | MOCK_METHOD(void, ProcessPacketFromNetwork, (absl::string_view packet), 17 | (override)); 18 | }; 19 | 20 | } // namespace quic 21 | 22 | #endif // QUICHE_QUIC_QBONE_MOCK_QBONE_CLIENT_H_ 23 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/platform/icmp_packet.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_ 6 | #define QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "absl/strings/string_view.h" 14 | #include "gquiche/quic/platform/api/quic_ip_address.h" 15 | 16 | namespace quic { 17 | 18 | // Creates an ICMPv6 packet, returning a packed string representation of the 19 | // packet to |cb|. The resulting packet is given to a callback because it's 20 | // stack allocated inside CreateIcmpPacket. 21 | void CreateIcmpPacket(in6_addr src, in6_addr dst, const icmp6_hdr& icmp_header, 22 | absl::string_view body, 23 | const std::function& cb); 24 | 25 | } // namespace quic 26 | 27 | #endif // QUICHE_QUIC_QBONE_PLATFORM_ICMP_PACKET_H_ 28 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/platform/tcp_packet.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_PLATFORM_TCP_PACKET_H_ 6 | #define QUICHE_QUIC_QBONE_PLATFORM_TCP_PACKET_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "absl/strings/string_view.h" 14 | #include "gquiche/quic/platform/api/quic_ip_address.h" 15 | 16 | namespace quic { 17 | 18 | // Creates an TCPv6 RST packet, returning a packed string representation of the 19 | // packet to |cb|. 20 | void CreateTcpResetPacket(absl::string_view original_packet, 21 | const std::function& cb); 22 | 23 | } // namespace quic 24 | 25 | #endif // QUICHE_QUIC_QBONE_PLATFORM_TCP_PACKET_H_ 26 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/qbone_client_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_QBONE_CLIENT_INTERFACE_H_ 6 | #define QUICHE_QUIC_QBONE_QBONE_CLIENT_INTERFACE_H_ 7 | 8 | #include 9 | 10 | #include "absl/strings/string_view.h" 11 | 12 | namespace quic { 13 | 14 | // An interface that includes methods to interact with a QBONE client. 15 | class QboneClientInterface { 16 | public: 17 | virtual ~QboneClientInterface() {} 18 | // Accepts a given packet from the network and sends the packet down to the 19 | // QBONE connection. 20 | virtual void ProcessPacketFromNetwork(absl::string_view packet) = 0; 21 | }; 22 | 23 | } // namespace quic 24 | 25 | #endif // QUICHE_QUIC_QBONE_QBONE_CLIENT_INTERFACE_H_ 26 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/qbone_control.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | option optimize_for = LITE_RUNTIME; 4 | 5 | package quic; 6 | 7 | message QboneServerRequest { 8 | extensions 1000 to max; 9 | }; 10 | 11 | message QboneClientRequest { 12 | extensions 1000 to max; 13 | }; 14 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/qbone_control_placeholder.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | option optimize_for = LITE_RUNTIME; 4 | 5 | package quic; 6 | 7 | import "quiche/quic/qbone/qbone_control.proto"; 8 | 9 | // These provide fields for QboneServerRequest and QboneClientRequest that are 10 | // used to test the control channel. Once the control channel actually has real 11 | // data to pass they can be removed. 12 | // TODO(b/62139999): Remove this file in favor of testing actual configuration. 13 | 14 | extend QboneServerRequest { 15 | optional string server_placeholder = 179838467; 16 | } 17 | 18 | extend QboneClientRequest { 19 | optional string client_placeholder = 179838467; 20 | } 21 | -------------------------------------------------------------------------------- /gquiche/quic/qbone/qbone_packet_writer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_QBONE_QBONE_PACKET_WRITER_H_ 6 | #define QUICHE_QUIC_QBONE_QBONE_PACKET_WRITER_H_ 7 | 8 | #include 9 | 10 | namespace quic { 11 | 12 | // QbonePacketWriter expects only one function to be defined, 13 | // WritePacketToNetwork, which is called when a packet is received via QUIC 14 | // and should be sent out on the network. This is the complete packet, 15 | // and not just a fragment. 16 | class QbonePacketWriter { 17 | public: 18 | virtual ~QbonePacketWriter() {} 19 | virtual void WritePacketToNetwork(const char* packet, size_t size) = 0; 20 | }; 21 | 22 | } // namespace quic 23 | 24 | #endif // QUICHE_QUIC_QBONE_QBONE_PACKET_WRITER_H_ 25 | -------------------------------------------------------------------------------- /gquiche/quic/quic_transport/README.md: -------------------------------------------------------------------------------- 1 | # QuicTransport 2 | 3 | The files in this directory implement QuicTransport protocol as described in 4 | . 5 | 6 | Design doc: 7 | https://docs.google.com/document/d/1UgviRBnZkMUq4OKcsAJvIQFX6UCXeCbOtX_wMgwD_es/edit# 8 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/fuzzing/README.md: -------------------------------------------------------------------------------- 1 | This directory contains several fuzz tests for QUIC code: 2 | 3 | - quic_framer_fuzzer: A test for CryptoFramer::ParseMessage and 4 | QuicFramer::ProcessPacket using random packet data. 5 | - quic_framer_process_data_packet_fuzzer: A test for QuicFramer::ProcessPacket 6 | where the packet has a valid public header, is decryptable, and contains 7 | random QUIC payload. 8 | 9 | To build and run the fuzz tests, using quic_framer_fuzzer as an example: 10 | 11 | ```sh 12 | $ blaze build --config=asan-fuzzer //gfe/quic/test_tools/fuzzing/... 13 | $ CORPUS_DIR=`mktemp -d` && echo ${CORPUS_DIR} 14 | $ ./blaze-bin/gfe/quic/test_tools/fuzzing/quic_framer_fuzzer ${CORPUS_DIR} -use_counters=0 15 | ``` 16 | 17 | By default this fuzzes with 64 byte chunks, to test the framer with more 18 | realistic size input, try 1350 (max payload size of a QUIC packet): 19 | 20 | ```sh 21 | $ ./blaze-bin/gfe/quic/test_tools/fuzzing/quic_framer_fuzzer ${CORPUS_DIR} -use_counters=0 -max_len=1350 22 | ``` 23 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/limited_mtu_test_writer.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/limited_mtu_test_writer.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | LimitedMtuTestWriter::LimitedMtuTestWriter(QuicByteCount mtu) : mtu_(mtu) {} 11 | 12 | LimitedMtuTestWriter::~LimitedMtuTestWriter() = default; 13 | 14 | WriteResult LimitedMtuTestWriter::WritePacket( 15 | const char* buffer, size_t buf_len, const QuicIpAddress& self_address, 16 | const QuicSocketAddress& peer_address, PerPacketOptions* options) { 17 | if (buf_len > mtu_) { 18 | // Drop the packet. 19 | return WriteResult(WRITE_STATUS_OK, buf_len); 20 | } 21 | 22 | return QuicPacketWriterWrapper::WritePacket(buffer, buf_len, self_address, 23 | peer_address, options); 24 | } 25 | 26 | } // namespace test 27 | } // namespace quic 28 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/mock_clock.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/mock_clock.h" 6 | 7 | namespace quic { 8 | 9 | MockClock::MockClock() : now_(QuicTime::Zero()) {} 10 | 11 | MockClock::~MockClock() {} 12 | 13 | void MockClock::AdvanceTime(QuicTime::Delta delta) { now_ = now_ + delta; } 14 | 15 | void MockClock::Reset() { now_ = QuicTime::Zero(); } 16 | 17 | QuicTime MockClock::Now() const { return now_; } 18 | 19 | QuicTime MockClock::ApproximateNow() const { return now_; } 20 | 21 | QuicWallTime MockClock::WallNow() const { 22 | return QuicWallTime::FromUNIXSeconds((now_ - QuicTime::Zero()).ToSeconds()); 23 | } 24 | 25 | } // namespace quic 26 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/mock_quic_client_promised_info.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/mock_quic_client_promised_info.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | MockQuicClientPromisedInfo::MockQuicClientPromisedInfo( 11 | QuicSpdyClientSessionBase* session, QuicStreamId id, std::string url) 12 | : QuicClientPromisedInfo(session, id, url) {} 13 | 14 | MockQuicClientPromisedInfo::~MockQuicClientPromisedInfo() {} 15 | 16 | } // namespace test 17 | } // namespace quic 18 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/mock_quic_session_visitor.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/mock_quic_session_visitor.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | MockQuicSessionVisitor::MockQuicSessionVisitor() = default; 11 | 12 | MockQuicSessionVisitor::~MockQuicSessionVisitor() = default; 13 | 14 | MockQuicCryptoServerStreamHelper::MockQuicCryptoServerStreamHelper() = default; 15 | 16 | MockQuicCryptoServerStreamHelper::~MockQuicCryptoServerStreamHelper() = default; 17 | 18 | } // namespace test 19 | } // namespace quic 20 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/mock_quic_spdy_client_stream.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/mock_quic_spdy_client_stream.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | MockQuicSpdyClientStream::MockQuicSpdyClientStream( 11 | QuicStreamId id, QuicSpdyClientSession* session, StreamType type) 12 | : QuicSpdyClientStream(id, session, type) {} 13 | 14 | MockQuicSpdyClientStream::~MockQuicSpdyClientStream() {} 15 | 16 | } // namespace test 17 | } // namespace quic 18 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/mock_random.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/mock_random.h" 6 | 7 | #include 8 | 9 | namespace quic { 10 | namespace test { 11 | 12 | MockRandom::MockRandom() : base_(0xDEADBEEF), increment_(0) {} 13 | 14 | MockRandom::MockRandom(uint32_t base) : base_(base), increment_(0) {} 15 | 16 | void MockRandom::RandBytes(void* data, size_t len) { 17 | memset(data, increment_ + static_cast('r'), len); 18 | } 19 | 20 | uint64_t MockRandom::RandUint64() { return base_ + increment_; } 21 | 22 | void MockRandom::InsecureRandBytes(void* data, size_t len) { 23 | RandBytes(data, len); 24 | } 25 | 26 | uint64_t MockRandom::InsecureRandUint64() { return RandUint64(); } 27 | 28 | void MockRandom::ChangeValue() { increment_++; } 29 | 30 | void MockRandom::ResetBase(uint32_t base) { 31 | base_ = base; 32 | increment_ = 0; 33 | } 34 | 35 | } // namespace test 36 | } // namespace quic 37 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/qpack/qpack_encoder_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/qpack/qpack_encoder_peer.h" 6 | 7 | #include "gquiche/quic/core/qpack/qpack_encoder.h" 8 | 9 | namespace quic { 10 | namespace test { 11 | 12 | // static 13 | QpackEncoderHeaderTable* QpackEncoderPeer::header_table(QpackEncoder* encoder) { 14 | return &encoder->header_table_; 15 | } 16 | 17 | // static 18 | uint64_t QpackEncoderPeer::maximum_blocked_streams( 19 | const QpackEncoder* encoder) { 20 | return encoder->maximum_blocked_streams_; 21 | } 22 | 23 | // static 24 | uint64_t QpackEncoderPeer::smallest_blocking_index( 25 | const QpackEncoder* encoder) { 26 | return encoder->blocking_manager_.smallest_blocking_index(); 27 | } 28 | 29 | } // namespace test 30 | } // namespace quic 31 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/qpack/qpack_encoder_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QPACK_QPACK_ENCODER_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QPACK_QPACK_ENCODER_PEER_H_ 7 | 8 | #include 9 | 10 | namespace quic { 11 | 12 | class QpackEncoder; 13 | class QpackEncoderHeaderTable; 14 | 15 | namespace test { 16 | 17 | class QpackEncoderPeer { 18 | public: 19 | QpackEncoderPeer() = delete; 20 | 21 | static QpackEncoderHeaderTable* header_table(QpackEncoder* encoder); 22 | static uint64_t maximum_blocked_streams(const QpackEncoder* encoder); 23 | static uint64_t smallest_blocking_index(const QpackEncoder* encoder); 24 | }; 25 | 26 | } // namespace test 27 | 28 | } // namespace quic 29 | 30 | #endif // QUICHE_QUIC_TEST_TOOLS_QPACK_QPACK_ENCODER_PEER_H_ 31 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/qpack/qpack_test_utils.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/qpack/qpack_test_utils.h" 6 | 7 | #include 8 | 9 | #include "gquiche/quic/platform/api/quic_bug_tracker.h" 10 | 11 | namespace quic { 12 | namespace test { 13 | 14 | FragmentSizeGenerator FragmentModeToFragmentSizeGenerator( 15 | FragmentMode fragment_mode) { 16 | switch (fragment_mode) { 17 | case FragmentMode::kSingleChunk: 18 | return []() { return std::numeric_limits::max(); }; 19 | case FragmentMode::kOctetByOctet: 20 | return []() { return 1; }; 21 | } 22 | QUIC_BUG(quic_bug_10259_1) 23 | << "Unknown FragmentMode " << static_cast(fragment_mode); 24 | return []() { return 0; }; 25 | } 26 | 27 | } // namespace test 28 | } // namespace quic 29 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_buffered_packet_store_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/quic_buffered_packet_store_peer.h" 6 | 7 | #include "gquiche/quic/core/quic_buffered_packet_store.h" 8 | 9 | namespace quic { 10 | namespace test { 11 | 12 | // static 13 | QuicAlarm* QuicBufferedPacketStorePeer::expiration_alarm( 14 | QuicBufferedPacketStore* store) { 15 | return store->expiration_alarm_.get(); 16 | } 17 | 18 | // static 19 | void QuicBufferedPacketStorePeer::set_clock(QuicBufferedPacketStore* store, 20 | const QuicClock* clock) { 21 | store->clock_ = clock; 22 | } 23 | 24 | } // namespace test 25 | } // namespace quic 26 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_buffered_packet_store_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_BUFFERED_PACKET_STORE_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_BUFFERED_PACKET_STORE_PEER_H_ 7 | 8 | #include 9 | 10 | #include "gquiche/quic/core/quic_alarm.h" 11 | #include "gquiche/quic/core/quic_clock.h" 12 | 13 | namespace quic { 14 | 15 | class QuicBufferedPacketStore; 16 | 17 | namespace test { 18 | 19 | class QuicBufferedPacketStorePeer { 20 | public: 21 | QuicBufferedPacketStorePeer() = delete; 22 | 23 | static QuicAlarm* expiration_alarm(QuicBufferedPacketStore* store); 24 | 25 | static void set_clock(QuicBufferedPacketStore* store, const QuicClock* clock); 26 | }; 27 | 28 | } // namespace test 29 | 30 | } // namespace quic 31 | 32 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_BUFFERED_PACKET_STORE_PEER_H_ 33 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_client_promised_info_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/quic_client_promised_info_peer.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | // static 11 | QuicAlarm* QuicClientPromisedInfoPeer::GetAlarm( 12 | QuicClientPromisedInfo* promised_stream) { 13 | return promised_stream->cleanup_alarm_.get(); 14 | } 15 | 16 | } // namespace test 17 | } // namespace quic 18 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_client_promised_info_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_CLIENT_PROMISED_INFO_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_CLIENT_PROMISED_INFO_PEER_H_ 7 | 8 | #include "gquiche/quic/core/http/quic_client_promised_info.h" 9 | 10 | namespace quic { 11 | namespace test { 12 | 13 | class QuicClientPromisedInfoPeer { 14 | public: 15 | QuicClientPromisedInfoPeer() = delete; 16 | 17 | static QuicAlarm* GetAlarm(QuicClientPromisedInfo* promised_stream); 18 | }; 19 | } // namespace test 20 | } // namespace quic 21 | 22 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_CLIENT_PROMISED_INFO_PEER_H_ 23 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_coalesced_packet_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/quic_coalesced_packet_peer.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | // static 11 | void QuicCoalescedPacketPeer::SetMaxPacketLength( 12 | QuicCoalescedPacket& coalesced_packet, QuicPacketLength length) { 13 | coalesced_packet.max_packet_length_ = length; 14 | } 15 | 16 | // static 17 | std::string* QuicCoalescedPacketPeer::GetMutableEncryptedBuffer( 18 | QuicCoalescedPacket& coalesced_packet, EncryptionLevel encryption_level) { 19 | return &coalesced_packet.encrypted_buffers_[encryption_level]; 20 | } 21 | 22 | } // namespace test 23 | } // namespace quic 24 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_coalesced_packet_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_COALESCED_PACKET_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_COALESCED_PACKET_PEER_H_ 7 | 8 | #include "gquiche/quic/core/quic_coalesced_packet.h" 9 | #include "gquiche/quic/core/quic_types.h" 10 | 11 | namespace quic { 12 | namespace test { 13 | 14 | class QuicCoalescedPacketPeer { 15 | public: 16 | static void SetMaxPacketLength(QuicCoalescedPacket& coalesced_packet, 17 | QuicPacketLength length); 18 | 19 | static std::string* GetMutableEncryptedBuffer( 20 | QuicCoalescedPacket& coalesced_packet, EncryptionLevel encryption_level); 21 | }; 22 | 23 | } // namespace test 24 | } // namespace quic 25 | 26 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_COALESCED_PACKET_PEER_H_ 27 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_connection_id_manager_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_CONNECTION_ID_MANAGER_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_CONNECTION_ID_MANAGER_PEER_H_ 7 | 8 | #include "gquiche/quic/core/quic_connection_id_manager.h" 9 | 10 | namespace quic { 11 | namespace test { 12 | 13 | class QuicConnectionIdManagerPeer { 14 | public: 15 | static QuicAlarm* GetRetirePeerIssuedConnectionIdAlarm( 16 | QuicPeerIssuedConnectionIdManager* manager) { 17 | return manager->retire_connection_id_alarm_.get(); 18 | } 19 | 20 | static QuicAlarm* GetRetireSelfIssuedConnectionIdAlarm( 21 | QuicSelfIssuedConnectionIdManager* manager) { 22 | return manager->retire_connection_id_alarm_.get(); 23 | } 24 | }; 25 | 26 | } // namespace test 27 | } // namespace quic 28 | 29 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_CONNECTION_ID_MANAGER_PEER_H_ 30 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_mock_syscall_wrapper.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/quic_mock_syscall_wrapper.h" 6 | 7 | using testing::_; 8 | using testing::Invoke; 9 | 10 | namespace quic { 11 | namespace test { 12 | 13 | MockQuicSyscallWrapper::MockQuicSyscallWrapper(QuicSyscallWrapper* delegate) { 14 | ON_CALL(*this, Sendmsg(_, _, _)) 15 | .WillByDefault(Invoke(delegate, &QuicSyscallWrapper::Sendmsg)); 16 | 17 | ON_CALL(*this, Sendmmsg(_, _, _, _)) 18 | .WillByDefault(Invoke(delegate, &QuicSyscallWrapper::Sendmmsg)); 19 | } 20 | 21 | } // namespace test 22 | } // namespace quic 23 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_path_validator_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/quic_path_validator_peer.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | // static 10 | QuicAlarm* QuicPathValidatorPeer::retry_timer(QuicPathValidator* validator) { 11 | return validator->retry_timer_.get(); 12 | } 13 | 14 | } // namespace test 15 | } // namespace quic 16 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_path_validator_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_PATH_VALIDATOR_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_PATH_VALIDATOR_PEER_H_ 7 | 8 | #include "gquiche/quic/core/quic_path_validator.h" 9 | 10 | namespace quic { 11 | namespace test { 12 | 13 | class QuicPathValidatorPeer { 14 | public: 15 | static QuicAlarm* retry_timer(QuicPathValidator* validator); 16 | }; 17 | 18 | } // namespace test 19 | } // namespace quic 20 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_PATH_VALIDATOR_PEER_H_ 21 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_server_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/quic_server_peer.h" 6 | 7 | #include "gquiche/quic/core/quic_dispatcher.h" 8 | #include "gquiche/quic/core/quic_packet_reader.h" 9 | #include "gquiche/quic/tools/quic_server.h" 10 | 11 | namespace quic { 12 | namespace test { 13 | 14 | // static 15 | bool QuicServerPeer::SetSmallSocket(QuicServer* server) { 16 | int size = 1024 * 10; 17 | return setsockopt(server->fd_, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) != 18 | -1; 19 | } 20 | 21 | // static 22 | QuicDispatcher* QuicServerPeer::GetDispatcher(QuicServer* server) { 23 | return server->dispatcher_.get(); 24 | } 25 | 26 | // static 27 | void QuicServerPeer::SetReader(QuicServer* server, QuicPacketReader* reader) { 28 | server->packet_reader_.reset(reader); 29 | } 30 | 31 | } // namespace test 32 | } // namespace quic 33 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_server_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_SERVER_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_SERVER_PEER_H_ 7 | 8 | namespace quic { 9 | 10 | class QuicDispatcher; 11 | class QuicServer; 12 | class QuicPacketReader; 13 | 14 | namespace test { 15 | 16 | class QuicServerPeer { 17 | public: 18 | QuicServerPeer() = delete; 19 | 20 | static bool SetSmallSocket(QuicServer* server); 21 | static QuicDispatcher* GetDispatcher(QuicServer* server); 22 | static void SetReader(QuicServer* server, QuicPacketReader* reader); 23 | }; 24 | 25 | } // namespace test 26 | } // namespace quic 27 | 28 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_SERVER_PEER_H_ 29 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_unacked_packet_map_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/quic_unacked_packet_map_peer.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | // static 11 | const QuicStreamFrame& QuicUnackedPacketMapPeer::GetAggregatedStreamFrame( 12 | const QuicUnackedPacketMap& unacked_packets) { 13 | return unacked_packets.aggregated_stream_frame_; 14 | } 15 | 16 | // static 17 | void QuicUnackedPacketMapPeer::SetPerspective( 18 | QuicUnackedPacketMap* unacked_packets, Perspective perspective) { 19 | *const_cast(&unacked_packets->perspective_) = perspective; 20 | } 21 | 22 | // static 23 | size_t QuicUnackedPacketMapPeer::GetCapacity( 24 | const QuicUnackedPacketMap& unacked_packets) { 25 | return unacked_packets.unacked_packets_.capacity(); 26 | } 27 | 28 | } // namespace test 29 | } // namespace quic 30 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/quic_unacked_packet_map_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_UNACKED_PACKET_MAP_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_UNACKED_PACKET_MAP_PEER_H_ 7 | 8 | #include "gquiche/quic/core/quic_unacked_packet_map.h" 9 | 10 | namespace quic { 11 | namespace test { 12 | 13 | class QuicUnackedPacketMapPeer { 14 | public: 15 | static const QuicStreamFrame& GetAggregatedStreamFrame( 16 | const QuicUnackedPacketMap& unacked_packets); 17 | 18 | static void SetPerspective(QuicUnackedPacketMap* unacked_packets, 19 | Perspective perspective); 20 | 21 | static size_t GetCapacity(const QuicUnackedPacketMap& unacked_packets); 22 | }; 23 | 24 | } // namespace test 25 | } // namespace quic 26 | 27 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_UNACKED_PACKET_MAP_PEER_H_ 28 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/rtt_stats_peer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/rtt_stats_peer.h" 6 | 7 | namespace quic { 8 | namespace test { 9 | 10 | // static 11 | void RttStatsPeer::SetSmoothedRtt(RttStats* rtt_stats, QuicTime::Delta rtt_ms) { 12 | rtt_stats->smoothed_rtt_ = rtt_ms; 13 | } 14 | 15 | // static 16 | void RttStatsPeer::SetMinRtt(RttStats* rtt_stats, QuicTime::Delta rtt_ms) { 17 | rtt_stats->min_rtt_ = rtt_ms; 18 | } 19 | 20 | } // namespace test 21 | } // namespace quic 22 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/rtt_stats_peer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_RTT_STATS_PEER_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_RTT_STATS_PEER_H_ 7 | 8 | #include "gquiche/quic/core/congestion_control/rtt_stats.h" 9 | #include "gquiche/quic/core/quic_time.h" 10 | 11 | namespace quic { 12 | namespace test { 13 | 14 | class RttStatsPeer { 15 | public: 16 | RttStatsPeer() = delete; 17 | 18 | static void SetSmoothedRtt(RttStats* rtt_stats, QuicTime::Delta rtt_ms); 19 | 20 | static void SetMinRtt(RttStats* rtt_stats, QuicTime::Delta rtt_ms); 21 | }; 22 | 23 | } // namespace test 24 | } // namespace quic 25 | 26 | #endif // QUICHE_QUIC_TEST_TOOLS_RTT_STATS_PEER_H_ 27 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/send_algorithm_test_result.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | syntax = "proto2"; 6 | 7 | option optimize_for = LITE_RUNTIME; 8 | 9 | package quic; 10 | 11 | message SendAlgorithmTestResult { 12 | optional string test_name = 1; 13 | optional uint64 random_seed = 2; 14 | optional int64 simulated_duration_micros = 3; 15 | } 16 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/simulator/actor.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/simulator/actor.h" 6 | 7 | #include "gquiche/quic/test_tools/simulator/simulator.h" 8 | 9 | namespace quic { 10 | namespace simulator { 11 | 12 | Actor::Actor(Simulator* simulator, std::string name) 13 | : simulator_(simulator), 14 | clock_(simulator->GetClock()), 15 | name_(std::move(name)) { 16 | simulator_->AddActor(this); 17 | } 18 | 19 | Actor::~Actor() { simulator_->RemoveActor(this); } 20 | 21 | void Actor::Schedule(QuicTime next_tick) { 22 | simulator_->Schedule(this, next_tick); 23 | } 24 | 25 | void Actor::Unschedule() { simulator_->Unschedule(this); } 26 | 27 | } // namespace simulator 28 | } // namespace quic 29 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/simulator/port.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/test_tools/simulator/port.h" 6 | 7 | namespace quic { 8 | namespace simulator { 9 | 10 | Packet::Packet() 11 | : source(), destination(), tx_timestamp(QuicTime::Zero()), size(0) {} 12 | 13 | Packet::~Packet() {} 14 | 15 | Packet::Packet(const Packet& packet) = default; 16 | 17 | Endpoint::Endpoint(Simulator* simulator, std::string name) 18 | : Actor(simulator, name) {} 19 | 20 | } // namespace simulator 21 | } // namespace quic 22 | -------------------------------------------------------------------------------- /gquiche/quic/test_tools/web_transport_resets_backend.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_WEB_TRANSPORT_RESETS_BACKEND_H_ 6 | #define QUICHE_QUIC_TEST_TOOLS_WEB_TRANSPORT_RESETS_BACKEND_H_ 7 | 8 | #include "gquiche/quic/test_tools/quic_test_backend.h" 9 | #include "gquiche/spdy/core/http2_header_block.h" 10 | 11 | namespace quic { 12 | namespace test { 13 | 14 | // A backend for testing RESET_STREAM/STOP_SENDING behavior. Provides 15 | // bidirectional echo streams; whenever one of those receives RESET_STREAM or 16 | // STOP_SENDING, a log message is sent as a unidirectional stream. 17 | QuicSimpleServerBackend::WebTransportResponse WebTransportResetsBackend( 18 | const spdy::Http2HeaderBlock& request_headers, 19 | WebTransportSession* session); 20 | 21 | } // namespace test 22 | } // namespace quic 23 | 24 | #endif // QUICHE_QUIC_TEST_TOOLS_WEB_TRANSPORT_RESETS_BACKEND_H_ 25 | -------------------------------------------------------------------------------- /gquiche/quic/tools/quic_backend_response.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/tools/quic_backend_response.h" 6 | 7 | namespace quic { 8 | 9 | QuicBackendResponse::ServerPushInfo::ServerPushInfo( 10 | QuicUrl request_url, spdy::Http2HeaderBlock headers, 11 | spdy::SpdyPriority priority, std::string body) 12 | : request_url(request_url), 13 | headers(std::move(headers)), 14 | priority(priority), 15 | body(body) {} 16 | 17 | QuicBackendResponse::ServerPushInfo::ServerPushInfo(const ServerPushInfo& other) 18 | : request_url(other.request_url), 19 | headers(other.headers.Clone()), 20 | priority(other.priority), 21 | body(other.body) {} 22 | 23 | QuicBackendResponse::QuicBackendResponse() 24 | : response_type_(REGULAR_RESPONSE), delay_(QuicTime::Delta::Zero()) {} 25 | 26 | QuicBackendResponse::~QuicBackendResponse() = default; 27 | 28 | } // namespace quic 29 | -------------------------------------------------------------------------------- /gquiche/quic/tools/quic_server_factory.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/tools/quic_server_factory.h" 6 | 7 | #include 8 | 9 | #include "gquiche/quic/tools/quic_server.h" 10 | 11 | namespace quic { 12 | 13 | std::unique_ptr QuicServerFactory::CreateServer( 14 | quic::QuicSimpleServerBackend* backend, 15 | std::unique_ptr proof_source, 16 | const quic::ParsedQuicVersionVector& supported_versions) { 17 | return std::make_unique(std::move(proof_source), backend, 18 | supported_versions); 19 | } 20 | 21 | } // namespace quic 22 | -------------------------------------------------------------------------------- /gquiche/quic/tools/quic_server_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TOOLS_QUIC_SERVER_FACTORY_H_ 6 | #define QUICHE_QUIC_TOOLS_QUIC_SERVER_FACTORY_H_ 7 | 8 | #include "gquiche/quic/tools/quic_toy_server.h" 9 | 10 | namespace quic { 11 | 12 | // Factory creating QuicServer instances. 13 | class QuicServerFactory : public QuicToyServer::ServerFactory { 14 | public: 15 | std::unique_ptr CreateServer( 16 | QuicSimpleServerBackend* backend, 17 | std::unique_ptr proof_source, 18 | const quic::ParsedQuicVersionVector& supported_versions) override; 19 | }; 20 | 21 | } // namespace quic 22 | 23 | #endif // QUICHE_QUIC_TOOLS_QUIC_SERVER_FACTORY_H_ 24 | -------------------------------------------------------------------------------- /gquiche/quic/tools/quic_simple_client_stream.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/tools/quic_simple_client_stream.h" 6 | 7 | namespace quic { 8 | 9 | void QuicSimpleClientStream::OnBodyAvailable() { 10 | if (!drop_response_body_) { 11 | QuicSpdyClientStream::OnBodyAvailable(); 12 | return; 13 | } 14 | 15 | while (HasBytesToRead()) { 16 | struct iovec iov; 17 | if (GetReadableRegions(&iov, 1) == 0) { 18 | break; 19 | } 20 | MarkConsumed(iov.iov_len); 21 | } 22 | if (sequencer()->IsClosed()) { 23 | OnFinRead(); 24 | } else { 25 | sequencer()->SetUnblocked(); 26 | } 27 | } 28 | 29 | } // namespace quic 30 | -------------------------------------------------------------------------------- /gquiche/quic/tools/quic_simple_client_stream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CLIENT_STREAM_H_ 6 | #define QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CLIENT_STREAM_H_ 7 | 8 | #include "gquiche/quic/core/http/quic_spdy_client_stream.h" 9 | 10 | namespace quic { 11 | 12 | class QuicSimpleClientStream : public QuicSpdyClientStream { 13 | public: 14 | QuicSimpleClientStream(QuicStreamId id, QuicSpdyClientSession* session, 15 | StreamType type, bool drop_response_body) 16 | : QuicSpdyClientStream(id, session, type), 17 | drop_response_body_(drop_response_body) {} 18 | void OnBodyAvailable() override; 19 | 20 | private: 21 | const bool drop_response_body_; 22 | }; 23 | 24 | } // namespace quic 25 | 26 | #endif // QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CLIENT_STREAM_H_ 27 | -------------------------------------------------------------------------------- /gquiche/quic/tools/quic_simple_crypto_server_stream_helper.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/quic/tools/quic_simple_crypto_server_stream_helper.h" 6 | 7 | #include "gquiche/quic/core/quic_utils.h" 8 | 9 | namespace quic { 10 | 11 | QuicSimpleCryptoServerStreamHelper::QuicSimpleCryptoServerStreamHelper() = 12 | default; 13 | 14 | QuicSimpleCryptoServerStreamHelper::~QuicSimpleCryptoServerStreamHelper() = 15 | default; 16 | 17 | bool QuicSimpleCryptoServerStreamHelper::CanAcceptClientHello( 18 | const CryptoHandshakeMessage& /*message*/, 19 | const QuicSocketAddress& /*client_address*/, 20 | const QuicSocketAddress& /*peer_address*/, 21 | const QuicSocketAddress& /*self_address*/, 22 | std::string* /*error_details*/) const { 23 | return true; 24 | } 25 | 26 | } // namespace quic 27 | -------------------------------------------------------------------------------- /gquiche/quic/tools/quic_spdy_server_base.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // A toy server, which connects to a specified port and sends QUIC 6 | // requests to that endpoint. 7 | 8 | #ifndef QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_ 9 | #define QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_ 10 | 11 | #include "gquiche/quic/platform/api/quic_socket_address.h" 12 | 13 | namespace quic { 14 | 15 | // Base class for service instances to be used with QuicToyServer. 16 | class QuicSpdyServerBase { 17 | public: 18 | virtual ~QuicSpdyServerBase() = default; 19 | 20 | // Creates a UDP socket and listens on |address|. Returns true on success 21 | // and false otherwise. 22 | virtual bool CreateUDPSocketAndListen(const QuicSocketAddress& address) = 0; 23 | 24 | // Handles incoming requests. Does not return. 25 | virtual void HandleEventsForever() = 0; 26 | }; 27 | 28 | } // namespace quic 29 | 30 | #endif // QUICHE_QUIC_TOOLS_QUIC_SPDY_SERVER_BASE_H_ 31 | -------------------------------------------------------------------------------- /gquiche/spdy/core/array_output_buffer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/spdy/core/array_output_buffer.h" 6 | 7 | namespace spdy { 8 | 9 | void ArrayOutputBuffer::Next(char** data, int* size) { 10 | *data = current_; 11 | *size = capacity_ > 0 ? capacity_ : 0; 12 | } 13 | 14 | void ArrayOutputBuffer::AdvanceWritePtr(int64_t count) { 15 | current_ += count; 16 | capacity_ -= count; 17 | } 18 | 19 | uint64_t ArrayOutputBuffer::BytesFree() const { return capacity_; } 20 | 21 | } // namespace spdy 22 | -------------------------------------------------------------------------------- /gquiche/spdy/core/header_byte_listener_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_SPDY_CORE_HEADER_BYTE_LISTENER_INTERFACE_H_ 2 | #define QUICHE_SPDY_CORE_HEADER_BYTE_LISTENER_INTERFACE_H_ 3 | 4 | #include 5 | 6 | #include "gquiche/common/platform/api/quiche_export.h" 7 | 8 | namespace spdy { 9 | 10 | // Listens for the receipt of uncompressed header bytes. 11 | class QUICHE_EXPORT_PRIVATE HeaderByteListenerInterface { 12 | public: 13 | virtual ~HeaderByteListenerInterface() {} 14 | 15 | // Called when a header block has been parsed, with the number of uncompressed 16 | // header bytes parsed from the header block. 17 | virtual void OnHeaderBytesReceived(size_t uncompressed_header_bytes) = 0; 18 | }; 19 | 20 | } // namespace spdy 21 | 22 | #endif // QUICHE_SPDY_CORE_HEADER_BYTE_LISTENER_INTERFACE_H_ 23 | -------------------------------------------------------------------------------- /gquiche/spdy/core/hpack/hpack_entry.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/spdy/core/hpack/hpack_entry.h" 6 | 7 | #include "absl/strings/str_cat.h" 8 | 9 | namespace spdy { 10 | 11 | HpackEntry::HpackEntry(std::string name, std::string value) 12 | : name_(std::move(name)), value_(std::move(value)) {} 13 | 14 | // static 15 | size_t HpackEntry::Size(absl::string_view name, absl::string_view value) { 16 | return name.size() + value.size() + kHpackEntrySizeOverhead; 17 | } 18 | size_t HpackEntry::Size() const { return Size(name(), value()); } 19 | 20 | std::string HpackEntry::GetDebugString() const { 21 | return absl::StrCat("{ name: \"", name_, "\", value: \"", value_, "\" }"); 22 | } 23 | 24 | } // namespace spdy 25 | -------------------------------------------------------------------------------- /gquiche/spdy/core/spdy_bitmasks.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_SPDY_CORE_SPDY_BITMASKS_H_ 6 | #define QUICHE_SPDY_CORE_SPDY_BITMASKS_H_ 7 | 8 | namespace spdy { 9 | 10 | // StreamId mask from the SpdyHeader 11 | const unsigned int kStreamIdMask = 0x7fffffff; 12 | 13 | // Mask the lower 24 bits. 14 | const unsigned int kLengthMask = 0xffffff; 15 | 16 | } // namespace spdy 17 | 18 | #endif // QUICHE_SPDY_CORE_SPDY_BITMASKS_H_ 19 | -------------------------------------------------------------------------------- /gquiche/spdy/core/spdy_no_op_visitor.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/spdy/core/spdy_no_op_visitor.h" 6 | 7 | #include 8 | 9 | namespace spdy { 10 | 11 | SpdyNoOpVisitor::SpdyNoOpVisitor() { 12 | static_assert(std::is_abstract::value == false, 13 | "Need to update SpdyNoOpVisitor."); 14 | } 15 | SpdyNoOpVisitor::~SpdyNoOpVisitor() = default; 16 | 17 | SpdyHeadersHandlerInterface* SpdyNoOpVisitor::OnHeaderFrameStart( 18 | SpdyStreamId /*stream_id*/) { 19 | return this; 20 | } 21 | 22 | bool SpdyNoOpVisitor::OnUnknownFrame(SpdyStreamId /*stream_id*/, 23 | uint8_t /*frame_type*/) { 24 | return true; 25 | } 26 | 27 | } // namespace spdy 28 | -------------------------------------------------------------------------------- /gquiche/spdy/test_tools/mock_spdy_framer_visitor.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "gquiche/spdy/test_tools/mock_spdy_framer_visitor.h" 6 | 7 | namespace spdy { 8 | 9 | namespace test { 10 | 11 | MockSpdyFramerVisitor::MockSpdyFramerVisitor() { DelegateHeaderHandling(); } 12 | 13 | MockSpdyFramerVisitor::~MockSpdyFramerVisitor() = default; 14 | 15 | } // namespace test 16 | 17 | } // namespace spdy 18 | -------------------------------------------------------------------------------- /platform/epoll_platform_impl/epoll_bug_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "platform/epoll_platform_impl/epoll_logging_impl.h" 4 | 5 | #define EPOLL_BUG_IMPL(bug_id) EPOLL_LOG_IMPL(DFATAL) 6 | #define EPOLL_BUG_V2_IMPL(bug_id) EPOLL_LOG_IMPL(DFATAL) 7 | -------------------------------------------------------------------------------- /platform/epoll_platform_impl/epoll_export_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gquiche/quic/platform/api/quic_export.h" 4 | 5 | #define EPOLL_EXPORT QUIC_EXPORT 6 | #define EPOLL_EXPORT_PRIVATE QUIC_EXPORT_PRIVATE 7 | -------------------------------------------------------------------------------- /platform/epoll_platform_impl/epoll_logging_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gquiche/common/platform/api/quiche_logging.h" 4 | 5 | #define EPOLL_QUICHE_LOG_INFO QUICHE_VLOG(1) 6 | #define EPOLL_QUICHE_LOG_WARNING QUICHE_DLOG(WARNING) 7 | #define EPOLL_QUICHE_LOG_ERROR QUICHE_DLOG(ERROR) 8 | #define EPOLL_QUICHE_LOG_FATAL QUICHE_LOG(FATAL) 9 | #define EPOLL_QUICHE_LOG_DFATAL QUICHE_LOG(DFATAL) 10 | 11 | #define EPOLL_LOG_IMPL(severity) EPOLL_QUICHE_LOG_##severity 12 | #define EPOLL_VLOG_IMPL(verbose_level) QUICHE_VLOG(verbose_level) 13 | #define EPOLL_DVLOG_IMPL(verbose_level) QUICHE_DVLOG(verbose_level) 14 | #define EPOLL_PLOG_IMPL(severity) QUICHE_DVLOG(1) 15 | -------------------------------------------------------------------------------- /platform/epoll_platform_impl/epoll_ptr_util_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace epoll_server { 6 | 7 | template 8 | std::unique_ptr EpollMakeUniqueImpl(Args&&... args) { 9 | return std::make_unique(std::forward(args)...); 10 | } 11 | 12 | } // namespace epoll_server -------------------------------------------------------------------------------- /platform/epoll_platform_impl/epoll_time_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace epoll_server { 6 | 7 | inline int64_t WallTimeNowInUsecImpl() { 8 | return std::chrono::duration_cast 9 | (std::chrono::system_clock::now().time_since_epoch()).count(); 10 | } 11 | 12 | } // namespace epoll_server 13 | 14 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_arraysize_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "absl/base/macros.h" 4 | 5 | // NOLINT(namespace-quiche) 6 | 7 | // This file is part of the QUICHE platform implementation, and is not to be 8 | // consumed or referenced directly by other QUICHE code. It serves purely as a 9 | // porting layer for QUICHE. 10 | 11 | #define HTTP2_ARRAYSIZE_IMPL(x) ABSL_ARRAYSIZE(x) 12 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_bug_tracker_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | // 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | 11 | #define HTTP2_BUG_IMPL(x) std::cout 12 | #define HTTP2_BUG_IF_IMPL 13 | 14 | // V2 macros are the same as all the HTTP2_BUG flavor above, but they take a 15 | // bug_id parameter. 16 | #define HTTP2_BUG_V2_IMPL 17 | #define HTTP2_BUG_IF_V2_IMPL 18 | 19 | #define FLAGS_http2_always_log_bugs_for_tests_IMPL true 20 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_containers_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "platform/quiche_platform_impl/quiche_containers_impl.h" 4 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_estimate_memory_usage_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "platform/quiche_platform_impl/quiche_estimate_memory_usage_impl.h" 4 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_flag_utils_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gquiche/common/platform/api/quiche_flag_utils.h" 4 | 5 | #define HTTP2_RELOADABLE_FLAG_COUNT_IMPL 6 | #define HTTP2_RELOADABLE_FLAG_COUNT_N_IMPL(x,y,z) 7 | 8 | #define HTTP2_RESTART_FLAG_COUNT_IMPL 9 | #define HTTP2_RESTART_FLAG_COUNT_N_IMPL 10 | 11 | #define HTTP2_CODE_COUNT_IMPL 12 | 13 | #define HTTP2_CODE_COUNT_N_IMPL(x,y,z) 14 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_flags_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include "gquiche/common/platform/api/quiche_flags.h" 10 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_logging_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | // 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include "gquiche/common/platform/api/quiche_logging.h" 10 | -------------------------------------------------------------------------------- /platform/http2_platform_impl/http2_macros_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | 11 | #include "platform/quiche_platform_impl/quiche_logging_impl.h" 12 | 13 | #include "absl/base/macros.h" 14 | 15 | #define HTTP2_FALLTHROUGH_IMPL ABSL_FALLTHROUGH_INTENDED 16 | #define HTTP2_DIE_IF_NULL_IMPL(ptr) dieIfNull(ptr) 17 | #define HTTP2_UNREACHABLE_IMPL() QUICHE_DCHECK(false) 18 | 19 | namespace http2 { 20 | 21 | template inline T dieIfNull(T&& ptr) { 22 | QUICHE_CHECK((ptr) != nullptr); 23 | return std::forward(ptr); 24 | } 25 | 26 | } // namespace http2 27 | -------------------------------------------------------------------------------- /platform/mem_slice_buffer.cc: -------------------------------------------------------------------------------- 1 | // NOLINT(namespace-quic) 2 | 3 | // This file is part of the QUICHE platform implementation, and is not to be 4 | // consumed or referenced directly by other QUICHE code. It serves purely as a 5 | // porting layer for QUICHE. 6 | 7 | #include "platform/mem_slice_buffer.h" 8 | 9 | #include 10 | 11 | #include "absl/strings/ascii.h" 12 | #include "absl/strings/numbers.h" 13 | 14 | namespace quic { 15 | 16 | MemSliceBuffer::MemSliceBuffer(char* data, size_t size) 17 | : owned_(false), 18 | data_(data), 19 | size_(size) 20 | { 21 | if (data_ == nullptr && size_ > 0) { 22 | owned_ = true; 23 | data_ = new char[size_]; 24 | } 25 | } 26 | 27 | MemSliceBuffer::~MemSliceBuffer() 28 | { 29 | if (data_) { 30 | delete [] data_; 31 | } 32 | data_ = nullptr; 33 | } 34 | 35 | } // namespace quic 36 | -------------------------------------------------------------------------------- /platform/mem_slice_buffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quic) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace quic { 15 | 16 | class MemSliceBuffer { 17 | public: 18 | MemSliceBuffer(char* data, size_t size); 19 | 20 | char* data() const { return data_; } 21 | 22 | size_t size() const { return size_; } 23 | 24 | virtual ~MemSliceBuffer(); 25 | 26 | private: 27 | bool owned_; 28 | char* data_; 29 | size_t size_; 30 | 31 | }; 32 | 33 | using MemSliceBufferSharedPtr = std::shared_ptr; 34 | using MemSliceBuffersVec = std::vector; 35 | 36 | } // namespace quic 37 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_bug_tracker_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "platform/quiche_platform_impl/quiche_bug_tracker_impl.h" 4 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_cert_utils_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quic) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include "openssl/base.h" 10 | #include "platform/quiche_platform_impl/quiche_text_utils_impl.h" 11 | 12 | namespace quic { 13 | 14 | class QuicCertUtilsImpl { 15 | public: 16 | static bool ExtractSubjectNameFromDERCert(quiche::QuicheStringPiece cert, 17 | quiche::QuicheStringPiece* subject_out); 18 | 19 | private: 20 | static bool SeekToSubject(quiche::QuicheStringPiece cert, CBS* tbs_certificate); 21 | }; 22 | 23 | } // namespace quic 24 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_default_proof_providers_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "gquiche/quic/core/crypto/proof_source.h" 6 | #include "gquiche/quic/core/crypto/proof_verifier.h" 7 | 8 | namespace quic { 9 | 10 | std::unique_ptr CreateDefaultProofVerifierImpl( 11 | const std::string& host); 12 | std::unique_ptr CreateDefaultProofSourceImpl(); 13 | 14 | } // namespace quic 15 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_epoll_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quic) 4 | // 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other Envoy code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include "gquiche/epoll_server/simple_epoll_server.h" 10 | 11 | namespace quic { 12 | 13 | using QuicEpollServerImpl = epoll_server::SimpleEpollServer; 14 | using QuicEpollEventImpl = epoll_server::EpollEvent; 15 | using QuicEpollAlarmBaseImpl = epoll_server::EpollAlarm; 16 | using QuicEpollCallbackInterfaceImpl = epoll_server::EpollCallbackInterface; 17 | 18 | } // namespace quic 19 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_error_code_wrappers_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | 11 | // ErrorCode from chromium/net/base/net_error_list.h::NET_ERROR(MSG_TOO_BIG, -142) 12 | #define QUIC_EMSGSIZE_IMPL -142 13 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_expect_bug_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #define EXPECT_QUIC_BUG_IMPL 10 | #define EXPECT_QUIC_PEER_BUG_IMPL(statement, regex) 11 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_file_utils_impl.cc: -------------------------------------------------------------------------------- 1 | // NOLINT(namespace-quiche) 2 | 3 | // This file is part of the QUICHE platform implementation, and is not to be 4 | // consumed or referenced directly by other QUICHE code. It serves purely as a 5 | // porting layer for QUICHE. 6 | 7 | #include "platform/quic_platform_impl/quic_file_utils_impl.h" 8 | 9 | #include "absl/strings/str_cat.h" 10 | 11 | namespace quic { 12 | namespace { 13 | 14 | void depthFirstTraverseDirectory(const std::string& dirname, std::vector& files) { 15 | } 16 | 17 | } // namespace 18 | 19 | // Traverses the directory |dirname| and returns all of the files it contains. 20 | std::vector ReadFileContentsImpl(const std::string& dirname) { 21 | std::vector files; 22 | depthFirstTraverseDirectory(dirname, files); 23 | return files; 24 | } 25 | 26 | // Reads the contents of |filename| as a string into |contents|. 27 | void ReadFileContentsImpl(quiche::QuicheStringPiece filename, std::string* contents) { 28 | } 29 | 30 | } // namespace quic 31 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_file_utils_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | 11 | #include "platform/quiche_platform_impl/quiche_text_utils_impl.h" 12 | 13 | namespace quic { 14 | 15 | /** 16 | * Traverses the directory |dirname| and returns all of the files it contains. 17 | * @param dirname full path without trailing '/'. 18 | */ 19 | std::vector ReadFileContentsImpl(const std::string& dirname); 20 | 21 | /** 22 | * Reads the contents of |filename| as a string into |contents|. 23 | * @param filename the full path to the file. 24 | * @param contents output location of the file content. 25 | */ 26 | void ReadFileContentsImpl(quiche::QuicheStringPiece filename, std::string* contents); 27 | 28 | } // namespace quic 29 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_iovec_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include "platform/platform.h" 10 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_map_util_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | // 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | 11 | namespace quic { 12 | 13 | template 14 | bool QuicContainsKeyImpl(const Collection& collection, const Key& key) { 15 | return collection.find(key) != collection.end(); 16 | } 17 | 18 | template 19 | bool QuicContainsValueImpl(const Collection& collection, const Value& value) { 20 | return std::find(collection.begin(), collection.end(), value) != collection.end(); 21 | } 22 | 23 | } // namespace quic 24 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_prefetch_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | namespace quic { 10 | 11 | #if defined(__GNUC__) 12 | // See __builtin_prefetch in: 13 | // https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html. 14 | inline void QuicPrefetchT0Impl(const void* addr) { __builtin_prefetch(addr, 0, 3); } 15 | #else 16 | inline void QuicPrefetchT0Impl(const void*) {} 17 | #endif 18 | 19 | } // namespace quic 20 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_sleep_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOTE(wub): These macros are currently NOOP because they are supposed to be 4 | // used by client-side stats. They should be implemented when QUIC client code 5 | // is used by QUICHE to connect to backends. 6 | 7 | namespace quic { 8 | 9 | inline void QuicSleepImpl(QuicTime::Delta duration) { 10 | // TODO add sleep func here 11 | assert(0); 12 | } 13 | 14 | } // namespace quic 15 | 16 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_stack_trace_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | // 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | #include 11 | 12 | namespace quic { 13 | 14 | inline std::string QuicStackTraceImpl() { 15 | 16 | // TODO implement 17 | return ""; 18 | } 19 | 20 | } // namespace quic 21 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_stream_buffer_allocator_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include "gquiche/quic/core/quic_simple_buffer_allocator.h" 10 | 11 | namespace quic { 12 | 13 | // Implements the interface required by 14 | // https://quiche.googlesource.com/quiche/+/refs/heads/master/quic/platform/api/quic_stream_buffer_allocator.h 15 | // with the default implementation provided by QUICHE. 16 | using QuicStreamBufferAllocatorImpl = SimpleBufferAllocator; 17 | 18 | } // namespace quic 19 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_system_event_loop_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | inline void QuicRunSystemEventLoopIterationImpl() { 6 | } 7 | 8 | class QuicSystemEventLoopImpl { 9 | public: 10 | QuicSystemEventLoopImpl(std::string context_name) {} 11 | }; 12 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_test_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOTE(wub): These macros are currently NOOP because they are supposed to be 4 | // used by client-side stats. They should be implemented when QUIC client code 5 | // is used by QUICHE to connect to backends. 6 | 7 | 8 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_testvalue_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "platform/quiche_platform_impl/quiche_text_utils_impl.h" 4 | 5 | namespace quic { 6 | 7 | template 8 | void AdjustTestValueImpl(quiche::QuicheStringPiece label, T* var) {} 9 | 10 | } // namespace quic 11 | -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_thread_impl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aazhuliang/GQUIC_043_decrypt/fbcaa66f1eb5d79ab49afc6ea3eaf9cd67107fc5/platform/quic_platform_impl/quic_thread_impl.h -------------------------------------------------------------------------------- /platform/quic_platform_impl/quic_udp_socket_platform_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include 10 | 11 | namespace quic { 12 | 13 | const size_t kCmsgSpaceForGooglePacketHeaderImpl = 0; 14 | 15 | // NOLINTNEXTLINE(readability-identifier-naming) 16 | inline bool GetGooglePacketHeadersFromControlMessageImpl(struct ::cmsghdr* /*cmsg*/, 17 | char** /*packet_headers*/, 18 | size_t* /*packet_headers_len*/) { 19 | return false; 20 | } 21 | 22 | inline void SetGoogleSocketOptionsImpl(int fd) {} 23 | 24 | } // namespace quic 25 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quic_mutex_impl.cc: -------------------------------------------------------------------------------- 1 | #include "platform/quiche_platform_impl/quic_mutex_impl.h" 2 | 3 | namespace quic { 4 | 5 | void QuicLockImpl::WriterLock() { 6 | mu_.WriterLock(); 7 | } 8 | 9 | void QuicLockImpl::WriterUnlock() { 10 | mu_.WriterUnlock(); 11 | } 12 | 13 | void QuicLockImpl::ReaderLock() { 14 | mu_.ReaderLock(); 15 | } 16 | 17 | void QuicLockImpl::ReaderUnlock() { 18 | mu_.ReaderUnlock(); 19 | } 20 | 21 | void QuicLockImpl::AssertReaderHeld() const { 22 | mu_.AssertReaderHeld(); 23 | } 24 | 25 | } // namespace quic 26 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quic_testvalue_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUIC_TESTVALUE_IMPL_H_ 2 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUIC_TESTVALUE_IMPL_H_ 3 | 4 | #include "absl/strings/string_view.h" 5 | 6 | namespace quic { 7 | 8 | template 9 | void AdjustTestValueImpl(absl::string_view /*label*/, T* /*var*/) {} 10 | 11 | } // namespace quic 12 | 13 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUIC_TESTVALUE_IMPL_H_ 14 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quiche_bug_tracker_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // NOLINT(namespace-quiche) 4 | // 5 | // This file is part of the QUICHE platform implementation, and is not to be 6 | // consumed or referenced directly by other QUICHE code. It serves purely as a 7 | // porting layer for QUICHE. 8 | 9 | #include "gquiche/quic/platform/api/quic_logging.h" 10 | 11 | #define QUICHE_BUG_IMPL(bug_id) QUIC_LOG(DFATAL) 12 | #define QUICHE_BUG_IF_IMPL(bug_id, condition) QUIC_LOG_IF(DFATAL, condition) 13 | #define QUICHE_PEER_BUG_IMPL(bug_id) QUIC_LOG(ERROR) 14 | #define QUICHE_PEER_BUG_IF_IMPL(bug_id, condition) QUIC_LOG_IF(ERROR, condition) 15 | #define QUICHE_BUG_V2_IMPL(bug_id) QUIC_LOG(DFATAL) 16 | #define QUICHE_BUG_IF_V2_IMPL(bug_id, condition) QUIC_LOG_IF(DFATAL, condition) 17 | #define QUICHE_PEER_BUG_V2_IMPL(bug_id) QUIC_LOG(ERROR) 18 | #define QUICHE_PEER_BUG_IF_V2_IMPL(bug_id, condition) QUIC_LOG_IF(ERROR, condition) 19 | 20 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quiche_containers_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ 7 | 8 | #include 9 | 10 | namespace quiche { 11 | 12 | // Represents a double-ended queue which may be backed by a list or a flat 13 | // circular buffer. 14 | // 15 | // DOES NOT GUARANTEE POINTER OR ITERATOR STABILITY! 16 | template 17 | using QuicheDequeImpl = std::deque; 18 | 19 | } // namespace quiche 20 | 21 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ 22 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quiche_estimate_memory_usage_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_ESTIMATE_MEMORY_USAGE_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_ESTIMATE_MEMORY_USAGE_IMPL_H_ 7 | 8 | #include 9 | 10 | namespace quiche { 11 | 12 | // No-op implementation. 13 | template 14 | size_t QuicheEstimateMemoryUsageImpl(const T& /*object*/) { 15 | return 0; 16 | } 17 | 18 | } // namespace quiche 19 | 20 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_ESTIMATE_MEMORY_USAGE_IMPL_H_ 21 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quiche_export_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPORT_IMPL_H_ 2 | #define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPORT_IMPL_H_ 3 | 4 | // These macros are documented in: quic/platform/api/quic_export.h 5 | 6 | #define QUICHE_EXPORT_IMPL 7 | #define QUICHE_EXPORT_PRIVATE_IMPL 8 | #define QUICHE_NO_EXPORT_IMPL 9 | 10 | #endif // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_EXPORT_IMPL_H_ 11 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quiche_optional_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "absl/types/optional.h" 4 | 5 | // NOLINT(namespace-quiche) 6 | 7 | // This file is part of the QUICHE platform implementation, and is not to be 8 | // consumed or referenced directly by other QUICHE code. It serves purely as a 9 | // porting layer for QUICHE. 10 | 11 | namespace quiche { 12 | 13 | template using QuicheOptionalImpl = absl::optional; 14 | 15 | #define QUICHE_NULLOPT_IMPL absl::nullopt 16 | 17 | } // namespace quiche 18 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quiche_string_piece_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "platform/quiche_platform_impl/quiche_logging_impl.h" 4 | 5 | #include "absl/hash/hash.h" 6 | #include "absl/strings/string_view.h" 7 | 8 | // NOLINT(namespace-quiche) 9 | 10 | // This file is part of the QUICHE platform implementation, and is not to be 11 | // consumed or referenced directly by other QUICHE code. It serves purely as a 12 | // porting layer for QUICHE. 13 | 14 | namespace quiche { 15 | 16 | using QuicheStringPieceImpl = absl::string_view; 17 | 18 | using QuicheStringPieceHashImpl = absl::Hash; 19 | 20 | inline size_t QuicheHashStringPairImpl(QuicheStringPieceImpl a, QuicheStringPieceImpl b) { 21 | return absl::Hash()(a) ^ absl::Hash()(b); 22 | } 23 | 24 | } // namespace quiche 25 | -------------------------------------------------------------------------------- /platform/quiche_platform_impl/quiche_time_utils_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef QUICHE_COMMON_PLATFORM_IMPL_QUICHE_TIME_UTILS_IMPL_H_ 6 | #define QUICHE_COMMON_PLATFORM_IMPL_QUICHE_TIME_UTILS_IMPL_H_ 7 | 8 | #include 9 | 10 | #include "absl/types/optional.h" 11 | 12 | namespace quiche { 13 | 14 | absl::optional QuicheUtcDateTimeToUnixSecondsImpl(int year, 15 | int month, 16 | int day, 17 | int hour, 18 | int minute, 19 | int second); 20 | 21 | } // namespace quiche 22 | 23 | #endif // QUICHE_COMMON_PLATFORM_IMPL_QUICHE_TIME_UTILS_IMPL_H_ 24 | -------------------------------------------------------------------------------- /platform/string_utils.h: -------------------------------------------------------------------------------- 1 | // NOLINT(namespace-quiche) 2 | // 3 | // This file is part of the QUICHE platform implementation, and is not to be 4 | // consumed or referenced directly by other QUICHE code. It serves purely as a 5 | // porting layer for QUICHE. 6 | 7 | #include 8 | #include 9 | 10 | #include "absl/strings/string_view.h" 11 | 12 | namespace quiche { 13 | 14 | // NOLINTNEXTLINE(readability-identifier-naming) 15 | std::string HexDump(absl::string_view data); 16 | 17 | // '0' => 0, '1' => 1, 'a' or 'A' => 10, etc. 18 | // NOLINTNEXTLINE(readability-identifier-naming) 19 | char HexDigitToInt(char c); 20 | 21 | // Turns a 8-byte hex string into a uint32 in host byte order. 22 | // e.g. "12345678" => 0x12345678 23 | // NOLINTNEXTLINE(readability-identifier-naming) 24 | bool HexDecodeToUInt32(absl::string_view data, uint32_t* out); 25 | 26 | } // namespace quiche 27 | -------------------------------------------------------------------------------- /utils/leaf.cnf: -------------------------------------------------------------------------------- 1 | SUBJECT_NAME = req_dn 2 | KEY_SIZE = 2048 3 | [req] 4 | default_bits = ${ENV::KEY_SIZE} 5 | default_md = sha256 6 | string_mask = utf8only 7 | prompt = no 8 | encrypt_key = no 9 | distinguished_name = ${ENV::SUBJECT_NAME} 10 | req_extensions = req_extensions 11 | [req_dn] 12 | C = US 13 | ST = California 14 | L = Mountain View 15 | O = QUIC Server 16 | CN = 127.0.0.1 17 | [req_extensions] 18 | subjectAltName = @other_hosts 19 | [other_hosts] 20 | DNS.1 = www.example.org 21 | DNS.2 = mail.example.org 22 | DNS.3 = mail.example.com 23 | IP.1 = 127.0.0.1 --------------------------------------------------------------------------------