Skip to content

Commit

Permalink
move parse_address and sockaddr_utils out of iomgr directory (grpc#26077
Browse files Browse the repository at this point in the history
)

* move parse_address and sockaddr_utils out of iomgr directory

* clang-format

* fix python

* fix for import

* fix build file for import
  • Loading branch information
markdroth authored Apr 30, 2021
1 parent 8023753 commit 4c40ee3
Show file tree
Hide file tree
Showing 87 changed files with 214 additions and 188 deletions.
8 changes: 4 additions & 4 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,8 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_base_c",
srcs = [
"src/core/lib/address_utils/parse_address.cc",
"src/core/lib/address_utils/sockaddr_utils.cc",
"src/core/lib/avl/avl.cc",
"src/core/lib/backoff/backoff.cc",
"src/core/lib/channel/channel_args.cc",
Expand Down Expand Up @@ -823,7 +825,6 @@ grpc_cc_library(
"src/core/lib/iomgr/is_epollexclusive_available.cc",
"src/core/lib/iomgr/load_file.cc",
"src/core/lib/iomgr/lockfree_event.cc",
"src/core/lib/iomgr/parse_address.cc",
"src/core/lib/iomgr/polling_entity.cc",
"src/core/lib/iomgr/pollset.cc",
"src/core/lib/iomgr/pollset_custom.cc",
Expand All @@ -837,7 +838,6 @@ grpc_cc_library(
"src/core/lib/iomgr/resolve_address_posix.cc",
"src/core/lib/iomgr/resolve_address_windows.cc",
"src/core/lib/iomgr/resource_quota.cc",
"src/core/lib/iomgr/sockaddr_utils.cc",
"src/core/lib/iomgr/socket_factory_posix.cc",
"src/core/lib/iomgr/socket_mutator.cc",
"src/core/lib/iomgr/socket_utils_common_posix.cc",
Expand Down Expand Up @@ -920,6 +920,8 @@ grpc_cc_library(
"src/core/lib/uri/uri_parser.cc",
],
hdrs = [
"src/core/lib/address_utils/parse_address.h",
"src/core/lib/address_utils/sockaddr_utils.h",
"src/core/lib/avl/avl.h",
"src/core/lib/backoff/backoff.h",
"src/core/lib/channel/channel_args.h",
Expand Down Expand Up @@ -979,7 +981,6 @@ grpc_cc_library(
"src/core/lib/iomgr/load_file.h",
"src/core/lib/iomgr/lockfree_event.h",
"src/core/lib/iomgr/nameser.h",
"src/core/lib/iomgr/parse_address.h",
"src/core/lib/iomgr/polling_entity.h",
"src/core/lib/iomgr/pollset.h",
"src/core/lib/iomgr/pollset_custom.h",
Expand All @@ -996,7 +997,6 @@ grpc_cc_library(
"src/core/lib/iomgr/sockaddr.h",
"src/core/lib/iomgr/sockaddr_custom.h",
"src/core/lib/iomgr/sockaddr_posix.h",
"src/core/lib/iomgr/sockaddr_utils.h",
"src/core/lib/iomgr/sockaddr_windows.h",
"src/core/lib/iomgr/socket_factory_posix.h",
"src/core/lib/iomgr/socket_mutator.h",
Expand Down
8 changes: 4 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ config("grpc_config") {
"src/core/ext/xds/xds_http_filters.cc",
"src/core/ext/xds/xds_http_filters.h",
"src/core/ext/xds/xds_server_config_fetcher.cc",
"src/core/lib/address_utils/parse_address.cc",
"src/core/lib/address_utils/parse_address.h",
"src/core/lib/address_utils/sockaddr_utils.cc",
"src/core/lib/address_utils/sockaddr_utils.h",
"src/core/lib/avl/avl.cc",
"src/core/lib/avl/avl.h",
"src/core/lib/backoff/backoff.cc",
Expand Down Expand Up @@ -945,8 +949,6 @@ config("grpc_config") {
"src/core/lib/iomgr/lockfree_event.cc",
"src/core/lib/iomgr/lockfree_event.h",
"src/core/lib/iomgr/nameser.h",
"src/core/lib/iomgr/parse_address.cc",
"src/core/lib/iomgr/parse_address.h",
"src/core/lib/iomgr/polling_entity.cc",
"src/core/lib/iomgr/polling_entity.h",
"src/core/lib/iomgr/pollset.cc",
Expand Down Expand Up @@ -976,8 +978,6 @@ config("grpc_config") {
"src/core/lib/iomgr/sockaddr.h",
"src/core/lib/iomgr/sockaddr_custom.h",
"src/core/lib/iomgr/sockaddr_posix.h",
"src/core/lib/iomgr/sockaddr_utils.cc",
"src/core/lib/iomgr/sockaddr_utils.h",
"src/core/lib/iomgr/sockaddr_windows.h",
"src/core/lib/iomgr/socket_factory_posix.cc",
"src/core/lib/iomgr/socket_factory_posix.h",
Expand Down
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,8 @@ add_library(grpc
src/core/ext/xds/xds_http_fault_filter.cc
src/core/ext/xds/xds_http_filters.cc
src/core/ext/xds/xds_server_config_fetcher.cc
src/core/lib/address_utils/parse_address.cc
src/core/lib/address_utils/sockaddr_utils.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
Expand Down Expand Up @@ -1854,7 +1856,6 @@ add_library(grpc
src/core/lib/iomgr/is_epollexclusive_available.cc
src/core/lib/iomgr/load_file.cc
src/core/lib/iomgr/lockfree_event.cc
src/core/lib/iomgr/parse_address.cc
src/core/lib/iomgr/polling_entity.cc
src/core/lib/iomgr/pollset.cc
src/core/lib/iomgr/pollset_custom.cc
Expand All @@ -1868,7 +1869,6 @@ add_library(grpc
src/core/lib/iomgr/resolve_address_posix.cc
src/core/lib/iomgr/resolve_address_windows.cc
src/core/lib/iomgr/resource_quota.cc
src/core/lib/iomgr/sockaddr_utils.cc
src/core/lib/iomgr/socket_factory_posix.cc
src/core/lib/iomgr/socket_mutator.cc
src/core/lib/iomgr/socket_utils_common_posix.cc
Expand Down Expand Up @@ -2406,6 +2406,8 @@ add_library(grpc_unsecure
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/lib/address_utils/parse_address.cc
src/core/lib/address_utils/sockaddr_utils.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
Expand Down Expand Up @@ -2474,7 +2476,6 @@ add_library(grpc_unsecure
src/core/lib/iomgr/is_epollexclusive_available.cc
src/core/lib/iomgr/load_file.cc
src/core/lib/iomgr/lockfree_event.cc
src/core/lib/iomgr/parse_address.cc
src/core/lib/iomgr/polling_entity.cc
src/core/lib/iomgr/pollset.cc
src/core/lib/iomgr/pollset_custom.cc
Expand All @@ -2488,7 +2489,6 @@ add_library(grpc_unsecure
src/core/lib/iomgr/resolve_address_posix.cc
src/core/lib/iomgr/resolve_address_windows.cc
src/core/lib/iomgr/resource_quota.cc
src/core/lib/iomgr/sockaddr_utils.cc
src/core/lib/iomgr/socket_factory_posix.cc
src/core/lib/iomgr/socket_mutator.cc
src/core/lib/iomgr/socket_utils_common_posix.cc
Expand Down Expand Up @@ -6371,7 +6371,7 @@ endif()
if(gRPC_BUILD_TESTS)

add_executable(parse_address_test
test/core/iomgr/parse_address_test.cc
test/core/address_utils/parse_address_test.cc
)

target_include_directories(parse_address_test
Expand Down Expand Up @@ -6399,7 +6399,7 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)

add_executable(parse_address_with_named_scope_id_test
test/core/iomgr/parse_address_with_named_scope_id_test.cc
test/core/address_utils/parse_address_with_named_scope_id_test.cc
)

target_include_directories(parse_address_with_named_scope_id_test
Expand Down Expand Up @@ -13630,7 +13630,7 @@ endif()
if(gRPC_BUILD_TESTS)

add_executable(sockaddr_utils_test
test/core/iomgr/sockaddr_utils_test.cc
test/core/address_utils/sockaddr_utils_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,8 @@ LIBGRPC_SRC = \
src/core/ext/xds/xds_http_fault_filter.cc \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/sockaddr_utils.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
Expand Down Expand Up @@ -1412,7 +1414,6 @@ LIBGRPC_SRC = \
src/core/lib/iomgr/is_epollexclusive_available.cc \
src/core/lib/iomgr/load_file.cc \
src/core/lib/iomgr/lockfree_event.cc \
src/core/lib/iomgr/parse_address.cc \
src/core/lib/iomgr/polling_entity.cc \
src/core/lib/iomgr/pollset.cc \
src/core/lib/iomgr/pollset_custom.cc \
Expand All @@ -1426,7 +1427,6 @@ LIBGRPC_SRC = \
src/core/lib/iomgr/resolve_address_posix.cc \
src/core/lib/iomgr/resolve_address_windows.cc \
src/core/lib/iomgr/resource_quota.cc \
src/core/lib/iomgr/sockaddr_utils.cc \
src/core/lib/iomgr/socket_factory_posix.cc \
src/core/lib/iomgr/socket_mutator.cc \
src/core/lib/iomgr/socket_utils_common_posix.cc \
Expand Down Expand Up @@ -1815,6 +1815,8 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/sockaddr_utils.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
Expand Down Expand Up @@ -1883,7 +1885,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/iomgr/is_epollexclusive_available.cc \
src/core/lib/iomgr/load_file.cc \
src/core/lib/iomgr/lockfree_event.cc \
src/core/lib/iomgr/parse_address.cc \
src/core/lib/iomgr/polling_entity.cc \
src/core/lib/iomgr/pollset.cc \
src/core/lib/iomgr/pollset_custom.cc \
Expand All @@ -1897,7 +1898,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/iomgr/resolve_address_posix.cc \
src/core/lib/iomgr/resolve_address_windows.cc \
src/core/lib/iomgr/resource_quota.cc \
src/core/lib/iomgr/sockaddr_utils.cc \
src/core/lib/iomgr/socket_factory_posix.cc \
src/core/lib/iomgr/socket_mutator.cc \
src/core/lib/iomgr/socket_utils_common_posix.cc \
Expand Down
22 changes: 11 additions & 11 deletions build_autogenerated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ libs:
- src/core/ext/xds/xds_client_stats.h
- src/core/ext/xds/xds_http_fault_filter.h
- src/core/ext/xds/xds_http_filters.h
- src/core/lib/address_utils/parse_address.h
- src/core/lib/address_utils/sockaddr_utils.h
- src/core/lib/avl/avl.h
- src/core/lib/backoff/backoff.h
- src/core/lib/channel/channel_args.h
Expand Down Expand Up @@ -751,7 +753,6 @@ libs:
- src/core/lib/iomgr/load_file.h
- src/core/lib/iomgr/lockfree_event.h
- src/core/lib/iomgr/nameser.h
- src/core/lib/iomgr/parse_address.h
- src/core/lib/iomgr/polling_entity.h
- src/core/lib/iomgr/pollset.h
- src/core/lib/iomgr/pollset_custom.h
Expand All @@ -768,7 +769,6 @@ libs:
- src/core/lib/iomgr/sockaddr.h
- src/core/lib/iomgr/sockaddr_custom.h
- src/core/lib/iomgr/sockaddr_posix.h
- src/core/lib/iomgr/sockaddr_utils.h
- src/core/lib/iomgr/sockaddr_windows.h
- src/core/lib/iomgr/socket_factory_posix.h
- src/core/lib/iomgr/socket_mutator.h
Expand Down Expand Up @@ -1200,6 +1200,8 @@ libs:
- src/core/ext/xds/xds_http_fault_filter.cc
- src/core/ext/xds/xds_http_filters.cc
- src/core/ext/xds/xds_server_config_fetcher.cc
- src/core/lib/address_utils/parse_address.cc
- src/core/lib/address_utils/sockaddr_utils.cc
- src/core/lib/avl/avl.cc
- src/core/lib/backoff/backoff.cc
- src/core/lib/channel/channel_args.cc
Expand Down Expand Up @@ -1269,7 +1271,6 @@ libs:
- src/core/lib/iomgr/is_epollexclusive_available.cc
- src/core/lib/iomgr/load_file.cc
- src/core/lib/iomgr/lockfree_event.cc
- src/core/lib/iomgr/parse_address.cc
- src/core/lib/iomgr/polling_entity.cc
- src/core/lib/iomgr/pollset.cc
- src/core/lib/iomgr/pollset_custom.cc
Expand All @@ -1283,7 +1284,6 @@ libs:
- src/core/lib/iomgr/resolve_address_posix.cc
- src/core/lib/iomgr/resolve_address_windows.cc
- src/core/lib/iomgr/resource_quota.cc
- src/core/lib/iomgr/sockaddr_utils.cc
- src/core/lib/iomgr/socket_factory_posix.cc
- src/core/lib/iomgr/socket_mutator.cc
- src/core/lib/iomgr/socket_utils_common_posix.cc
Expand Down Expand Up @@ -1684,6 +1684,8 @@ libs:
- src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
- src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
- src/core/ext/upb-generated/validate/validate.upb.h
- src/core/lib/address_utils/parse_address.h
- src/core/lib/address_utils/sockaddr_utils.h
- src/core/lib/avl/avl.h
- src/core/lib/backoff/backoff.h
- src/core/lib/channel/channel_args.h
Expand Down Expand Up @@ -1749,7 +1751,6 @@ libs:
- src/core/lib/iomgr/load_file.h
- src/core/lib/iomgr/lockfree_event.h
- src/core/lib/iomgr/nameser.h
- src/core/lib/iomgr/parse_address.h
- src/core/lib/iomgr/polling_entity.h
- src/core/lib/iomgr/pollset.h
- src/core/lib/iomgr/pollset_custom.h
Expand All @@ -1766,7 +1767,6 @@ libs:
- src/core/lib/iomgr/sockaddr.h
- src/core/lib/iomgr/sockaddr_custom.h
- src/core/lib/iomgr/sockaddr_posix.h
- src/core/lib/iomgr/sockaddr_utils.h
- src/core/lib/iomgr/sockaddr_windows.h
- src/core/lib/iomgr/socket_factory_posix.h
- src/core/lib/iomgr/socket_mutator.h
Expand Down Expand Up @@ -1934,6 +1934,8 @@ libs:
- src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
- src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
- src/core/ext/upb-generated/validate/validate.upb.c
- src/core/lib/address_utils/parse_address.cc
- src/core/lib/address_utils/sockaddr_utils.cc
- src/core/lib/avl/avl.cc
- src/core/lib/backoff/backoff.cc
- src/core/lib/channel/channel_args.cc
Expand Down Expand Up @@ -2002,7 +2004,6 @@ libs:
- src/core/lib/iomgr/is_epollexclusive_available.cc
- src/core/lib/iomgr/load_file.cc
- src/core/lib/iomgr/lockfree_event.cc
- src/core/lib/iomgr/parse_address.cc
- src/core/lib/iomgr/polling_entity.cc
- src/core/lib/iomgr/pollset.cc
- src/core/lib/iomgr/pollset_custom.cc
Expand All @@ -2016,7 +2017,6 @@ libs:
- src/core/lib/iomgr/resolve_address_posix.cc
- src/core/lib/iomgr/resolve_address_windows.cc
- src/core/lib/iomgr/resource_quota.cc
- src/core/lib/iomgr/sockaddr_utils.cc
- src/core/lib/iomgr/socket_factory_posix.cc
- src/core/lib/iomgr/socket_mutator.cc
- src/core/lib/iomgr/socket_utils_common_posix.cc
Expand Down Expand Up @@ -3636,15 +3636,15 @@ targets:
language: c
headers: []
src:
- test/core/iomgr/parse_address_test.cc
- test/core/address_utils/parse_address_test.cc
deps:
- grpc_test_util
- name: parse_address_with_named_scope_id_test
build: test
language: c
headers: []
src:
- test/core/iomgr/parse_address_with_named_scope_id_test.cc
- test/core/address_utils/parse_address_with_named_scope_id_test.cc
deps:
- grpc_test_util
platforms:
Expand Down Expand Up @@ -6230,7 +6230,7 @@ targets:
language: c++
headers: []
src:
- test/core/iomgr/sockaddr_utils_test.cc
- test/core/address_utils/sockaddr_utils_test.cc
deps:
- grpc_test_util
- name: ssl_server_fuzzer
Expand Down
5 changes: 3 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/xds/xds_http_fault_filter.cc \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/sockaddr_utils.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
Expand Down Expand Up @@ -463,7 +465,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/iomgr/is_epollexclusive_available.cc \
src/core/lib/iomgr/load_file.cc \
src/core/lib/iomgr/lockfree_event.cc \
src/core/lib/iomgr/parse_address.cc \
src/core/lib/iomgr/polling_entity.cc \
src/core/lib/iomgr/pollset.cc \
src/core/lib/iomgr/pollset_custom.cc \
Expand All @@ -477,7 +478,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/iomgr/resolve_address_posix.cc \
src/core/lib/iomgr/resolve_address_windows.cc \
src/core/lib/iomgr/resource_quota.cc \
src/core/lib/iomgr/sockaddr_utils.cc \
src/core/lib/iomgr/socket_factory_posix.cc \
src/core/lib/iomgr/socket_mutator.cc \
src/core/lib/iomgr/socket_utils_common_posix.cc \
Expand Down Expand Up @@ -1154,6 +1154,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/validate)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/xds/core/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/xds)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/address_utils)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel)
Expand Down
5 changes: 3 additions & 2 deletions config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\xds\\xds_http_fault_filter.cc " +
"src\\core\\ext\\xds\\xds_http_filters.cc " +
"src\\core\\ext\\xds\\xds_server_config_fetcher.cc " +
"src\\core\\lib\\address_utils\\parse_address.cc " +
"src\\core\\lib\\address_utils\\sockaddr_utils.cc " +
"src\\core\\lib\\avl\\avl.cc " +
"src\\core\\lib\\backoff\\backoff.cc " +
"src\\core\\lib\\channel\\channel_args.cc " +
Expand Down Expand Up @@ -429,7 +431,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\iomgr\\is_epollexclusive_available.cc " +
"src\\core\\lib\\iomgr\\load_file.cc " +
"src\\core\\lib\\iomgr\\lockfree_event.cc " +
"src\\core\\lib\\iomgr\\parse_address.cc " +
"src\\core\\lib\\iomgr\\polling_entity.cc " +
"src\\core\\lib\\iomgr\\pollset.cc " +
"src\\core\\lib\\iomgr\\pollset_custom.cc " +
Expand All @@ -443,7 +444,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\iomgr\\resolve_address_posix.cc " +
"src\\core\\lib\\iomgr\\resolve_address_windows.cc " +
"src\\core\\lib\\iomgr\\resource_quota.cc " +
"src\\core\\lib\\iomgr\\sockaddr_utils.cc " +
"src\\core\\lib\\iomgr\\socket_factory_posix.cc " +
"src\\core\\lib\\iomgr\\socket_mutator.cc " +
"src\\core\\lib\\iomgr\\socket_utils_common_posix.cc " +
Expand Down Expand Up @@ -1255,6 +1255,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\core\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\xds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\address_utils");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\backoff");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\channel");
Expand Down
Loading

0 comments on commit 4c40ee3

Please sign in to comment.