Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / grpc / deps / grpc / src / core / ext / transport / chttp2 / transport / chttp2_transport.h
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_trace_http2_stream_state;
31 extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount;
32 extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser;
33
34 extern bool g_flow_control_enabled;
35
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);
39
40 grpc_core::RefCountedPtr<grpc_core::channelz::SocketNode>
41 grpc_chttp2_transport_get_socket_node(grpc_transport* transport);
42
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);
50
51 #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */