1 /* 2 * 3 * Copyright 2015 gRPC authors. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H 20 #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H 21 22 #include <grpc/support/port_platform.h> 23 24 #include "src/core/lib/channel/channelz.h" 25 #include "src/core/lib/debug/trace.h" 26 #include "src/core/lib/iomgr/endpoint.h" 27 #include "src/core/lib/transport/transport.h" 28 29 extern grpc_core::TraceFlag grpc_http_trace; 30 extern grpc_core::TraceFlag grpc_keepalive_trace; 31 extern grpc_core::TraceFlag grpc_trace_http2_stream_state; 32 extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount; 33 extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser; 34 35 extern bool g_flow_control_enabled; 36 37 grpc_transport* grpc_create_chttp2_transport( 38 const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client, 39 grpc_resource_user* resource_user = nullptr); 40 41 grpc_core::RefCountedPtr<grpc_core::channelz::SocketNode> 42 grpc_chttp2_transport_get_socket_node(grpc_transport* transport); 43 44 /// Takes ownership of \a read_buffer, which (if non-NULL) contains 45 /// leftover bytes previously read from the endpoint (e.g., by handshakers). 46 /// If non-null, \a notify_on_receive_settings will be scheduled when 47 /// HTTP/2 settings are received from the peer. 48 void grpc_chttp2_transport_start_reading( 49 grpc_transport* transport, grpc_slice_buffer* read_buffer, 50 grpc_closure* notify_on_receive_settings); 51 52 #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */ 53