3 * Copyright 2015 gRPC authors.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H
20 #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H
22 #include <grpc/support/port_platform.h>
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"
29 extern grpc_core::TraceFlag grpc_http_trace;
30 extern grpc_core::TraceFlag grpc_trace_http2_stream_state;
31 extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount;
32 extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser;
34 extern bool g_flow_control_enabled;
36 grpc_transport* grpc_create_chttp2_transport(
37 const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client,
38 grpc_resource_user* resource_user = nullptr);
40 grpc_core::RefCountedPtr<grpc_core::channelz::SocketNode>
41 grpc_chttp2_transport_get_socket_node(grpc_transport* transport);
43 /// Takes ownership of \a read_buffer, which (if non-NULL) contains
44 /// leftover bytes previously read from the endpoint (e.g., by handshakers).
45 /// If non-null, \a notify_on_receive_settings will be scheduled when
46 /// HTTP/2 settings are received from the peer.
47 void grpc_chttp2_transport_start_reading(
48 grpc_transport* transport, grpc_slice_buffer* read_buffer,
49 grpc_closure* notify_on_receive_settings);
51 #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */