Debian Codegraph @

src/core/lib/surface/builtins.cc

raw
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include <grpc/support/port_platform.h>
16
17 #include "src/core/lib/surface/builtins.h"
18
19 #include <limits.h>
20
21 #include "src/core/lib/channel/channel_stack_builder.h"
22 #include "src/core/lib/channel/connected_channel.h"
23 #include "src/core/lib/config/core_configuration.h"
24 #include "src/core/lib/surface/channel_init.h"
25 #include "src/core/lib/surface/channel_stack_type.h"
26 #include "src/core/lib/surface/lame_client.h"
27 #include "src/core/lib/surface/server.h"
28
29 namespace grpc_core {
30
31 void RegisterBuiltins(CoreConfiguration::Builder* builder) {
32 builder->channel_init()->RegisterStage(GRPC_CLIENT_SUBCHANNEL,
33 GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
34 grpc_add_connected_filter);
35 builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL,
36 GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
37 grpc_add_connected_filter);
38 builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL,
39 GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
40 grpc_add_connected_filter);
41 builder->channel_init()->RegisterStage(
42 GRPC_CLIENT_LAME_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
43 [](ChannelStackBuilder* builder) {
44 builder->AppendFilter(&LameClientFilter::kFilter);
45 return true;
46 });
47 builder->channel_init()->RegisterStage(
48 GRPC_SERVER_CHANNEL, INT_MAX, [](ChannelStackBuilder* builder) {
49 builder->PrependFilter(&Server::kServerTopFilter);
50 return true;
51 });
52 }
53
54 } // namespace grpc_core