Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

envoy: move listener manager code back under source #31129

Merged
merged 6 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/mobile-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
image: ${{ needs.env.outputs.build_image_ubuntu }}
steps:
- uses: actions/checkout@v4
- name: Avoid dependencies leaking back in
run: rm source/extensions/listener_managers/listener_manager/listener_manager_impl.h source/common/quic/http_datagram_handler.h
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- name: 'Run tests'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Ensure files don't leak back into the main binary
run: rm source/extensions/listener_managers/listener_manager/listener_manager_impl.h source/server/overload_manager_impl.cc source/common/network/listen_socket_impl.h source/common/network/tcp_listener_impl.h source/server/guarddog_impl.h source/server/watchdog_impl.h source/server/options_impl.cc
run: rm source/common/listener_manager/listener_manager_impl.h source/server/overload_manager_impl.cc source/common/network/listen_socket_impl.h source/common/network/tcp_listener_impl.h source/server/guarddog_impl.h source/server/watchdog_impl.h source/server/options_impl.cc
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- name: 'Build test binary'
Expand Down
2 changes: 1 addition & 1 deletion contrib/dlb/source/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ envoy_cc_contrib_extension(
"//envoy/server:factory_context_interface",
"//envoy/server:filter_config_interface",
"//source/common/common:logger_lib",
"//source/common/listener_manager:active_tcp_listener",
"//source/common/network:connection_balancer_lib",
"//source/common/protobuf:utility_lib",
"//source/extensions/listener_managers/listener_manager:active_tcp_listener",
"@envoy_api//contrib/envoy/extensions/network/connection_balance/dlb/v3alpha:pkg_cc_proto",
] + select({
"//bazel:linux_x86_64": [
Expand Down
2 changes: 1 addition & 1 deletion contrib/dlb/source/connection_balancer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include "envoy/server/filter_config.h"

#include "source/common/api/os_sys_calls_impl.h"
#include "source/common/listener_manager/active_tcp_listener.h"
#include "source/common/network/connection_balancer_impl.h"
#include "source/common/protobuf/protobuf.h"
#include "source/extensions/listener_managers/listener_manager/active_tcp_listener.h"

#include "contrib/envoy/extensions/network/connection_balance/dlb/v3alpha/dlb.pb.h"
#include "contrib/envoy/extensions/network/connection_balance/dlb/v3alpha/dlb.pb.validate.h"
Expand Down
2 changes: 1 addition & 1 deletion mobile/test/common/jni/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ cc_library(
deps = [
":server_envoy_jni_lib",
"//library/common/jni:envoy_jni_lib",
"@envoy//source/extensions/listener_managers/listener_manager:listener_manager_lib",
"@envoy//source/common/listener_manager:listener_manager_lib",
],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_extension",
"envoy_cc_library",
"envoy_extension_package",
"envoy_package",
"envoy_select_enable_http3",
)

licenses(["notice"]) # Apache 2

envoy_extension_package()
envoy_package()

envoy_cc_extension(
envoy_cc_library(
name = "listener_manager_lib",
srcs = [
"listener_impl.cc",
Expand All @@ -20,13 +19,6 @@ envoy_cc_extension(
"listener_impl.h",
"listener_manager_impl.h",
],
# any changes to this should be reviewed by mobile maintainers
# to ensure that listener code doesn't leak back into Envoy Mobile.
extra_visibility = [
"//source/server/admin:__subpackages__",
"//source/server/config_validation:__subpackages__",
"//test:__subpackages__",
],
deps = [
":active_raw_udp_listener_config",
":connection_handler_lib",
Expand Down Expand Up @@ -82,15 +74,13 @@ envoy_cc_extension(
"//source/common/quic:udp_gso_batch_writer_lib",
"//source/extensions/udp_packet_writer/gso:config",
]),
alwayslink = True,
)

envoy_cc_library(
name = "active_raw_udp_listener_config",
srcs = ["active_raw_udp_listener_config.cc"],
hdrs = ["active_raw_udp_listener_config.h"],
visibility = [
"//test:__subpackages__",
],
deps = [
":connection_handler_lib",
"//envoy/registry",
Expand Down Expand Up @@ -155,16 +145,12 @@ envoy_cc_library(
],
)

envoy_cc_extension(
envoy_cc_library(
name = "connection_handler_lib",
srcs = ["connection_handler_impl.cc"],
hdrs = [
"connection_handler_impl.h",
],
# core code.
extra_visibility = [
"//test:__subpackages__",
],
deps = [
"active_tcp_listener",
"//envoy/common:time_interface",
Expand Down Expand Up @@ -244,15 +230,12 @@ envoy_cc_library(
],
)

envoy_cc_extension(
envoy_cc_library(
name = "listener_info_lib",
srcs = ["listener_info_impl.cc"],
hdrs = [
"listener_info_impl.h",
],
extra_visibility = [
"//source/server/admin:__subpackages__",
],
deps = [
"//envoy/network:listener_interface",
"//source/common/config:metadata_lib",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "source/extensions/listener_managers/listener_manager/active_raw_udp_listener_config.h"
#include "source/common/listener_manager/active_raw_udp_listener_config.h"

#include <memory>
#include <string>

#include "source/extensions/listener_managers/listener_manager/connection_handler_impl.h"
#include "source/common/listener_manager/connection_handler_impl.h"
#include "source/server/active_udp_listener.h"

namespace Envoy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/active_stream_listener_base.h"
#include "source/common/listener_manager/active_stream_listener_base.h"

#include "envoy/network/filter.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "source/common/common/linked_object.h"
#include "source/common/formatter/http_specific_formatter.h"
#include "source/extensions/listener_managers/listener_manager/active_tcp_socket.h"
#include "source/common/listener_manager/active_tcp_socket.h"
#include "source/server/active_listener_base.h"

namespace Envoy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/active_tcp_listener.h"
#include "source/common/listener_manager/active_tcp_listener.h"

#include <chrono>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "envoy/stream_info/stream_info.h"

#include "source/common/common/linked_object.h"
#include "source/extensions/listener_managers/listener_manager/active_stream_listener_base.h"
#include "source/extensions/listener_managers/listener_manager/active_tcp_socket.h"
#include "source/common/listener_manager/active_stream_listener_base.h"
#include "source/common/listener_manager/active_tcp_socket.h"
#include "source/server/active_listener_base.h"

namespace Envoy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "source/extensions/listener_managers/listener_manager/active_tcp_socket.h"
#include "source/common/listener_manager/active_tcp_socket.h"

#include "envoy/network/filter.h"

#include "source/common/listener_manager/active_stream_listener_base.h"
#include "source/common/stream_info/stream_info_impl.h"
#include "source/extensions/listener_managers/listener_manager/active_stream_listener_base.h"

namespace Envoy {
namespace Server {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/connection_handler_impl.h"
#include "source/common/listener_manager/connection_handler_impl.h"

#include <chrono>

Expand All @@ -7,11 +7,11 @@

#include "source/common/common/logger.h"
#include "source/common/event/deferred_task.h"
#include "source/common/listener_manager/active_tcp_listener.h"
#include "source/common/network/address_impl.h"
#include "source/common/network/tcp_listener_impl.h"
#include "source/common/network/utility.h"
#include "source/common/runtime/runtime_features.h"
#include "source/extensions/listener_managers/listener_manager/active_tcp_listener.h"
#include "source/server/listener_manager_factory.h"

namespace Envoy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/filter_chain_manager_impl.h"
#include "source/common/listener_manager/filter_chain_manager_impl.h"

#include "envoy/config/listener/v3/listener_components.pb.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

#include "source/common/common/logger.h"
#include "source/common/init/manager_impl.h"
#include "source/common/listener_manager/filter_chain_factory_context_callback.h"
#include "source/common/network/cidr_range.h"
#include "source/common/network/lc_trie.h"
#include "source/extensions/listener_managers/listener_manager/filter_chain_factory_context_callback.h"
#include "source/server/factory_context_impl.h"

#include "absl/container/flat_hash_map.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/lds_api.h"
#include "source/common/listener_manager/lds_api.h"

#include "envoy/admin/v3/config_dump.pb.h"
#include "envoy/config/core/v3/config_source.pb.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/listener_impl.h"
#include "source/common/listener_manager/listener_impl.h"

#include <functional>

Expand All @@ -18,6 +18,9 @@
#include "source/common/api/os_sys_calls_impl.h"
#include "source/common/common/assert.h"
#include "source/common/config/utility.h"
#include "source/common/listener_manager/active_raw_udp_listener_config.h"
#include "source/common/listener_manager/filter_chain_manager_impl.h"
#include "source/common/listener_manager/listener_manager_impl.h"
#include "source/common/network/connection_balancer_impl.h"
#include "source/common/network/resolver_impl.h"
#include "source/common/network/socket_option_factory.h"
Expand All @@ -27,9 +30,6 @@
#include "source/common/network/utility.h"
#include "source/common/protobuf/utility.h"
#include "source/common/runtime/runtime_features.h"
#include "source/extensions/listener_managers/listener_manager/active_raw_udp_listener_config.h"
#include "source/extensions/listener_managers/listener_manager/filter_chain_manager_impl.h"
#include "source/extensions/listener_managers/listener_manager/listener_manager_impl.h"
#include "source/server/configuration_impl.h"
#include "source/server/drain_manager_impl.h"
#include "source/server/transport_socket_config_impl.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#include "source/common/common/logger.h"
#include "source/common/init/manager_impl.h"
#include "source/common/init/target_impl.h"
#include "source/common/listener_manager/filter_chain_manager_impl.h"
#include "source/common/listener_manager/listener_info_impl.h"
#include "source/common/quic/quic_stat_names.h"
#include "source/extensions/listener_managers/listener_manager/filter_chain_manager_impl.h"
#include "source/extensions/listener_managers/listener_manager/listener_info_impl.h"
#include "source/server/transport_socket_config_impl.h"

namespace Envoy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/listener_info_impl.h"
#include "source/common/listener_manager/listener_info_impl.h"

namespace Envoy {
namespace Server {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/extensions/listener_managers/listener_manager/listener_manager_impl.h"
#include "source/common/listener_manager/listener_manager_impl.h"

#include <algorithm>

Expand Down Expand Up @@ -33,7 +33,7 @@
#include "source/server/api_listener_impl.h"
#include "source/server/configuration_impl.h"
#include "source/server/drain_manager_impl.h"
#include "source/extensions/listener_managers/listener_manager/filter_chain_manager_impl.h"
#include "source/common/listener_manager/filter_chain_manager_impl.h"
#include "source/server/transport_socket_config_impl.h"

namespace Envoy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

#include "source/common/config/well_known_names.h"
#include "source/common/filter/config_discovery_impl.h"
#include "source/common/listener_manager/filter_chain_factory_context_callback.h"
#include "source/common/listener_manager/filter_chain_manager_impl.h"
#include "source/common/listener_manager/lds_api.h"
#include "source/common/listener_manager/listener_impl.h"
#include "source/common/quic/quic_stat_names.h"
#include "source/extensions/listener_managers/listener_manager/filter_chain_factory_context_callback.h"
#include "source/extensions/listener_managers/listener_manager/filter_chain_manager_impl.h"
#include "source/extensions/listener_managers/listener_manager/lds_api.h"
#include "source/extensions/listener_managers/listener_manager/listener_impl.h"
#include "source/server/listener_manager_factory.h"

namespace Envoy {
Expand Down
2 changes: 1 addition & 1 deletion source/exe/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ envoy_cc_library(
":main_common_with_all_extensions_lib",
# These are compiled as extensions so Envoy Mobile doesn't have to link them in.
# Envoy requires them.
"//source/extensions/listener_managers/listener_manager:listener_manager_lib",
"//source/common/listener_manager:listener_manager_lib",
"//source/extensions/listener_managers/validation_listener_manager:validation_listener_manager_lib",
"//source/common/version:version_linkstamp",
"//source/server:options_lib",
Expand Down
6 changes: 3 additions & 3 deletions source/extensions/bootstrap/internal_listener/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ envoy_cc_extension(
deps = [
":thread_local_registry",
"//envoy/server:bootstrap_extension_config_interface",
"//source/extensions/listener_managers/listener_manager:listener_manager_lib",
"//source/common/listener_manager:listener_manager_lib",
"@envoy_api//envoy/extensions/bootstrap/internal_listener/v3:pkg_cc_proto",
],
alwayslink = 1,
Expand Down Expand Up @@ -93,12 +93,12 @@ envoy_cc_library(
"//source/common/common:linked_object",
"//source/common/common:non_copyable",
"//source/common/event:deferred_task",
"//source/common/listener_manager:active_stream_listener_base",
"//source/common/listener_manager:active_tcp_listener",
"//source/common/network:connection_lib",
"//source/common/network:listener_filter_buffer_lib",
"//source/common/stats:timespan_lib",
"//source/common/stream_info:stream_info_lib",
"//source/extensions/io_socket/user_space:config",
"//source/extensions/listener_managers/listener_manager:active_stream_listener_base",
"//source/extensions/listener_managers/listener_manager:active_tcp_listener",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include "envoy/network/filter.h"
#include "envoy/stats/scope.h"

#include "source/common/listener_manager/active_stream_listener_base.h"
#include "source/common/network/address_impl.h"
#include "source/common/stats/timespan_impl.h"
#include "source/extensions/io_socket/user_space/io_handle.h"
#include "source/extensions/listener_managers/listener_manager/active_stream_listener_base.h"

namespace Envoy {
namespace Extensions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#include "source/common/common/linked_object.h"
#include "source/common/common/non_copyable.h"
#include "source/common/listener_manager/active_stream_listener_base.h"
#include "source/common/stream_info/stream_info_impl.h"
#include "source/extensions/listener_managers/listener_manager/active_stream_listener_base.h"

#include "spdlog/spdlog.h"

Expand Down
4 changes: 4 additions & 0 deletions source/extensions/common/matcher/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ envoy_cc_extension(
name = "trie_matcher_lib",
srcs = ["trie_matcher.cc"],
hdrs = ["trie_matcher.h"],
extra_visibility = [
"//source/common/listener_manager:__subpackages__",
"//test:__subpackages__",
],
deps = [
"//envoy/matcher:matcher_interface",
"//envoy/network:filter_interface",
Expand Down
3 changes: 3 additions & 0 deletions source/extensions/filters/listener/original_dst/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ envoy_cc_library(
envoy_cc_extension(
name = "config",
srcs = ["config.cc"],
extra_visibility = [
"//test/common/listener_manager:__subpackages__",
],
deps = [
":original_dst_lib",
"//envoy/registry",
Expand Down
3 changes: 3 additions & 0 deletions source/extensions/filters/listener/proxy_protocol/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ envoy_cc_library(
envoy_cc_extension(
name = "config",
srcs = ["config.cc"],
extra_visibility = [
"//test/common/listener_manager:__subpackages__",
],
deps = [
"//envoy/registry",
"//envoy/server:filter_config_interface",
Expand Down
Loading
Loading