/proc/self/cwd/source/extensions/upstreams/tcp/config.h
Line | Count | Source (jump to first uncovered line) |
1 | | #pragma once |
2 | | |
3 | | #include <chrono> |
4 | | #include <cstdint> |
5 | | #include <functional> |
6 | | #include <list> |
7 | | #include <map> |
8 | | #include <string> |
9 | | |
10 | | #include "envoy/config/core/v3/extension.pb.h" |
11 | | #include "envoy/config/core/v3/protocol.pb.h" |
12 | | #include "envoy/extensions/upstreams/tcp/v3/tcp_protocol_options.pb.h" |
13 | | #include "envoy/extensions/upstreams/tcp/v3/tcp_protocol_options.pb.validate.h" |
14 | | #include "envoy/server/filter_config.h" |
15 | | #include "envoy/server/transport_socket_config.h" |
16 | | |
17 | | #include "source/common/common/logger.h" |
18 | | #include "source/common/protobuf/message_validator_impl.h" |
19 | | |
20 | | namespace Envoy { |
21 | | namespace Extensions { |
22 | | namespace Upstreams { |
23 | | namespace Tcp { |
24 | | |
25 | | class ProtocolOptionsConfigImpl : public Upstream::ProtocolOptionsConfig { |
26 | | public: |
27 | | ProtocolOptionsConfigImpl( |
28 | | const envoy::extensions::upstreams::tcp::v3::TcpProtocolOptions& options); |
29 | | |
30 | 0 | absl::optional<std::chrono::milliseconds> idleTimeout() const { return idle_timeout_; } |
31 | | |
32 | | private: |
33 | | absl::optional<std::chrono::milliseconds> idle_timeout_; |
34 | | }; |
35 | | |
36 | | class ProtocolOptionsConfigFactory : public Server::Configuration::ProtocolOptionsFactory { |
37 | | public: |
38 | | Upstream::ProtocolOptionsConfigConstSharedPtr createProtocolOptionsConfig( |
39 | | const Protobuf::Message& config, |
40 | 0 | Server::Configuration::ProtocolOptionsFactoryContext& context) override { |
41 | 0 | const auto& typed_config = MessageUtil::downcastAndValidate< |
42 | 0 | const envoy::extensions::upstreams::tcp::v3::TcpProtocolOptions&>( |
43 | 0 | config, context.messageValidationVisitor()); |
44 | 0 | return std::make_shared<ProtocolOptionsConfigImpl>(typed_config); |
45 | 0 | } |
46 | 110 | std::string category() const override { return "envoy.upstream_options"; } |
47 | 5.67k | std::string name() const override { |
48 | 5.67k | return "envoy.extensions.upstreams.tcp.v3.TcpProtocolOptions"; |
49 | 5.67k | } |
50 | 24 | ProtobufTypes::MessagePtr createEmptyConfigProto() override { |
51 | 24 | return std::make_unique<envoy::extensions::upstreams::tcp::v3::TcpProtocolOptions>(); |
52 | 24 | } |
53 | 0 | ProtobufTypes::MessagePtr createEmptyProtocolOptionsProto() override { |
54 | 0 | return std::make_unique<envoy::extensions::upstreams::tcp::v3::TcpProtocolOptions>(); |
55 | 0 | } |
56 | | }; |
57 | | |
58 | | DECLARE_FACTORY(ProtocolOptionsConfigFactory); |
59 | | |
60 | | } // namespace Tcp |
61 | | } // namespace Upstreams |
62 | | } // namespace Extensions |
63 | | } // namespace Envoy |