From 756a36cdacbe057eada8febf73878c0d06af2cd4 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 8 Jan 2016 15:56:21 -0800 Subject: [PATCH] Srcs and hdrs sanity checks skip third_party --- BUILD | 48 ++--- Makefile | 32 +-- binding.gyp | 8 +- build.yaml | 25 ++- gRPC.podspec | 28 +-- .../lb_policies/load_balancer_api.c | 1 - .../lb_policies/load_balancer_api.h | 6 +- src/core/proto/grpc/lb/v0/load_balancer.pb.c | 118 +++++++++++ src/core/proto/grpc/lb/v0/load_balancer.pb.h | 189 ++++++++++++++++++ src/core/proto/load_balancer.pb.c | 87 -------- src/core/proto/load_balancer.pb.h | 150 -------------- .../lb_policies/proto/load_balancer.pb.c | 87 -------- .../lb_policies/proto/load_balancer.pb.h | 150 -------------- .../grpc/lb/v0}/load_balancer.options | 0 .../grpc/lb/v0}/load_balancer.proto | 0 .../sources_and_headers.json.template | 21 +- test/cpp/grpclb/grpclb_api_test.cc | 13 +- .../codegen/core/gen_load_balancing_proto.sh | 10 +- tools/doxygen/Doxyfile.core.internal | 16 +- tools/run_tests/run_sanity.sh | 1 + tools/run_tests/sources_and_headers.json | 34 +--- vsprojects/vcxproj/grpc/grpc.vcxproj | 22 +- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 53 +++-- .../grpc_unsecure/grpc_unsecure.vcxproj | 22 +- .../grpc_unsecure.vcxproj.filters | 53 +++-- .../grpclb_api_test/grpclb_api_test.vcxproj | 8 +- .../grpclb_api_test.vcxproj.filters | 20 +- 27 files changed, 530 insertions(+), 672 deletions(-) create mode 100644 src/core/proto/grpc/lb/v0/load_balancer.pb.c create mode 100644 src/core/proto/grpc/lb/v0/load_balancer.pb.h delete mode 100644 src/core/proto/load_balancer.pb.c delete mode 100644 src/core/proto/load_balancer.pb.h delete mode 100644 src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c delete mode 100644 src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h rename src/{core/client_config/lb_policies/proto => proto/grpc/lb/v0}/load_balancer.options (100%) rename src/{core/client_config/lb_policies/proto => proto/grpc/lb/v0}/load_balancer.proto (100%) diff --git a/BUILD b/BUILD index 51c40239171..f8fbc70e5ac 100644 --- a/BUILD +++ b/BUILD @@ -227,7 +227,7 @@ cc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -267,13 +267,13 @@ cc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/census/aggregation.h", + "src/core/census/context.h", + "src/core/census/rpc_metric_id.h", "third_party/nanopb/pb.h", "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", - "src/core/census/aggregation.h", - "src/core/census/context.h", - "src/core/census/rpc_metric_id.h", "src/core/httpcli/httpcli_security_connector.c", "src/core/security/base64.c", "src/core/security/client_auth_filter.c", @@ -374,7 +374,7 @@ cc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_reader.c", @@ -422,13 +422,13 @@ cc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", "src/core/census/tracing.c", + "third_party/nanopb/pb_common.c", + "third_party/nanopb/pb_decode.c", + "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/grpc_security.h", @@ -529,7 +529,7 @@ cc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -569,13 +569,13 @@ cc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/census/aggregation.h", + "src/core/census/context.h", + "src/core/census/rpc_metric_id.h", "third_party/nanopb/pb.h", "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", - "src/core/census/aggregation.h", - "src/core/census/context.h", - "src/core/census/rpc_metric_id.h", "src/core/surface/init_unsecure.c", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", @@ -656,7 +656,7 @@ cc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_reader.c", @@ -704,13 +704,13 @@ cc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", "src/core/census/tracing.c", + "third_party/nanopb/pb_common.c", + "third_party/nanopb/pb_decode.c", + "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/byte_buffer.h", @@ -1195,7 +1195,7 @@ objc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_reader.c", @@ -1243,13 +1243,13 @@ objc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", "src/core/census/tracing.c", + "third_party/nanopb/pb_common.c", + "third_party/nanopb/pb_decode.c", + "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/grpc_security.h", @@ -1348,7 +1348,7 @@ objc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -1388,13 +1388,13 @@ objc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/census/aggregation.h", + "src/core/census/context.h", + "src/core/census/rpc_metric_id.h", "third_party/nanopb/pb.h", "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", - "src/core/census/aggregation.h", - "src/core/census/context.h", - "src/core/census/rpc_metric_id.h", ], includes = [ "include", diff --git a/Makefile b/Makefile index 59f2ad1a52c..3995ae52be2 100644 --- a/Makefile +++ b/Makefile @@ -1714,15 +1714,15 @@ $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc: $(Q) echo "$(GRPCXX_UNSECURE_PC_FILE)" | tr , '\n' >$@ ifeq ($(NO_PROTOC),true) -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc: protoc_dep_error -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc: protoc_dep_error else -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc: src/core/client_config/lb_policies/proto/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc: src/proto/grpc/lb/v0/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --cpp_out=$(GENDIR) $< -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc: src/core/client_config/lb_policies/proto/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc: src/proto/grpc/lb/v0/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $< @@ -2420,7 +2420,7 @@ LIBGRPC_SRC = \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ - src/core/proto/load_balancer.pb.c \ + src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_reader.c \ @@ -2468,13 +2468,13 @@ LIBGRPC_SRC = \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ src/core/census/tracing.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ PUBLIC_HEADERS_C += \ include/grpc/grpc_security.h \ @@ -2727,7 +2727,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ - src/core/proto/load_balancer.pb.c \ + src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_reader.c \ @@ -2775,13 +2775,13 @@ LIBGRPC_UNSECURE_SRC = \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ src/core/census/tracing.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ PUBLIC_HEADERS_C += \ include/grpc/byte_buffer.h \ @@ -9596,7 +9596,7 @@ endif GRPCLB_API_TEST_SRC = \ - $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc \ test/cpp/grpclb/grpclb_api_test.cc \ GRPCLB_API_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPCLB_API_TEST_SRC)))) @@ -9628,8 +9628,10 @@ endif endif -$(OBJDIR)/$(CONFIG)/src/core/client_config/lb_policies/proto/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v0/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + deps_grpclb_api_test: $(GRPCLB_API_TEST_OBJS:.o=.dep) ifneq ($(NO_SECURE),true) @@ -9637,7 +9639,7 @@ ifneq ($(NO_DEPS),true) -include $(GRPCLB_API_TEST_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc ifeq ($(NO_SECURE),true) diff --git a/binding.gyp b/binding.gyp index ff130c04a8a..ad747803997 100644 --- a/binding.gyp +++ b/binding.gyp @@ -262,7 +262,7 @@ 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', - 'src/core/proto/load_balancer.pb.c', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_reader.c', @@ -310,13 +310,13 @@ 'src/core/transport/static_metadata.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/operation.c', 'src/core/census/tracing.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', ], "conditions": [ ['OS == "mac"', { diff --git a/build.yaml b/build.yaml index d306f943018..984537a70d6 100644 --- a/build.yaml +++ b/build.yaml @@ -181,7 +181,7 @@ filegroups: - src/core/json/json_common.h - src/core/json/json_reader.h - src/core/json/json_writer.h - - src/core/proto/load_balancer.pb.h + - src/core/proto/grpc/lb/v0/load_balancer.pb.h - src/core/statistics/census_interface.h - src/core/statistics/census_rpc_stats.h - src/core/surface/api_trace.h @@ -221,10 +221,6 @@ filegroups: - src/core/transport/static_metadata.h - src/core/transport/transport.h - src/core/transport/transport_impl.h - - third_party/nanopb/pb.h - - third_party/nanopb/pb_common.h - - third_party/nanopb/pb_decode.h - - third_party/nanopb/pb_encode.h src: - src/core/census/grpc_context.c - src/core/census/grpc_filter.c @@ -305,7 +301,7 @@ filegroups: - src/core/json/json_reader.c - src/core/json/json_string.c - src/core/json/json_writer.c - - src/core/proto/load_balancer.pb.c + - src/core/proto/grpc/lb/v0/load_balancer.pb.c - src/core/surface/api_trace.c - src/core/surface/byte_buffer.c - src/core/surface/byte_buffer_reader.c @@ -353,9 +349,6 @@ filegroups: - src/core/transport/static_metadata.c - src/core/transport/transport.c - src/core/transport/transport_op_string.c - - third_party/nanopb/pb_common.c - - third_party/nanopb/pb_decode.c - - third_party/nanopb/pb_encode.c - name: grpc_test_util_base headers: - test/core/end2end/cq_verifier.h @@ -374,6 +367,16 @@ filegroups: - test/core/util/port_posix.c - test/core/util/port_windows.c - test/core/util/slice_splitter.c +- name: nanopb + headers: + - third_party/nanopb/pb.h + - third_party/nanopb/pb_common.h + - third_party/nanopb/pb_decode.h + - third_party/nanopb/pb_encode.h + src: + - third_party/nanopb/pb_common.c + - third_party/nanopb/pb_decode.c + - third_party/nanopb/pb_encode.c libs: - name: gpr build: all @@ -522,6 +525,7 @@ libs: filegroups: - grpc_base - census + - nanopb secure: true vs_packages: - grpc.dependencies.openssl @@ -568,6 +572,7 @@ libs: filegroups: - grpc_base - census + - nanopb secure: false vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}' - name: grpc_zookeeper @@ -2041,7 +2046,7 @@ targets: build: test language: c++ src: - - src/core/client_config/lb_policies/proto/load_balancer.proto + - src/proto/grpc/lb/v0/load_balancer.proto - test/cpp/grpclb/grpclb_api_test.cc deps: - grpc++ diff --git a/gRPC.podspec b/gRPC.podspec index 20b0264a585..2b67128d58b 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -231,7 +231,7 @@ Pod::Spec.new do |s| 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', - 'src/core/proto/load_balancer.pb.h', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/api_trace.h', @@ -271,13 +271,13 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', + 'src/core/census/aggregation.h', + 'src/core/census/context.h', + 'src/core/census/rpc_metric_id.h', 'third_party/nanopb/pb.h', 'third_party/nanopb/pb_common.h', 'third_party/nanopb/pb_decode.h', 'third_party/nanopb/pb_encode.h', - 'src/core/census/aggregation.h', - 'src/core/census/context.h', - 'src/core/census/rpc_metric_id.h', 'include/grpc/grpc_security.h', 'include/grpc/byte_buffer.h', 'include/grpc/byte_buffer_reader.h', @@ -385,7 +385,7 @@ Pod::Spec.new do |s| 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', - 'src/core/proto/load_balancer.pb.c', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_reader.c', @@ -433,13 +433,13 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/operation.c', - 'src/core/census/tracing.c' + 'src/core/census/tracing.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c' ss.private_header_files = 'src/core/profiling/timers.h', 'src/core/support/block_annotate.h', @@ -540,7 +540,7 @@ Pod::Spec.new do |s| 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', - 'src/core/proto/load_balancer.pb.h', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/api_trace.h', @@ -580,13 +580,13 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', + 'src/core/census/aggregation.h', + 'src/core/census/context.h', + 'src/core/census/rpc_metric_id.h', 'third_party/nanopb/pb.h', 'third_party/nanopb/pb_common.h', 'third_party/nanopb/pb_decode.h', - 'third_party/nanopb/pb_encode.h', - 'src/core/census/aggregation.h', - 'src/core/census/context.h', - 'src/core/census/rpc_metric_id.h' + 'third_party/nanopb/pb_encode.h' ss.header_mappings_dir = '.' # This isn't officially supported in Cocoapods. We've asked for an alternative: diff --git a/src/core/client_config/lb_policies/load_balancer_api.c b/src/core/client_config/lb_policies/load_balancer_api.c index c0fd726efd6..ea60944e079 100644 --- a/src/core/client_config/lb_policies/load_balancer_api.c +++ b/src/core/client_config/lb_policies/load_balancer_api.c @@ -37,7 +37,6 @@ #include - typedef struct decode_serverlist_arg { int first_pass; int i; diff --git a/src/core/client_config/lb_policies/load_balancer_api.h b/src/core/client_config/lb_policies/load_balancer_api.h index 4018a1bf876..d539c3fe3dd 100644 --- a/src/core/client_config/lb_policies/load_balancer_api.h +++ b/src/core/client_config/lb_policies/load_balancer_api.h @@ -37,7 +37,7 @@ #include #include "src/core/client_config/lb_policy_factory.h" -#include "src/core/proto/load_balancer.pb.h" +#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h" #ifdef __cplusplus extern "C" { @@ -56,10 +56,10 @@ typedef struct grpc_grpclb_serverlist { } grpc_grpclb_serverlist; /** Create a request for a gRPC LB service under \a lb_service_name */ -grpc_grpclb_request *grpc_grpclb_request_create(const char* lb_service_name); +grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name); /** Protocol Buffers v3-encode \a request */ -gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request); +gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request); /** Destroy \a request */ void grpc_grpclb_request_destroy(grpc_grpclb_request *request); diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.c b/src/core/proto/grpc/lb/v0/load_balancer.pb.c new file mode 100644 index 00000000000..ad9a0feb930 --- /dev/null +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.c @@ -0,0 +1,118 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.4-dev at Mon Jan 11 11:29:01 2016. */ + +#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h" + +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +const pb_field_t grpc_lb_v0_Duration_fields[3] = { + PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Duration, seconds, + seconds, 0), + PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Duration, nanos, + seconds, 0), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { + PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, grpc_lb_v0_LoadBalanceRequest, + initial_request, initial_request, + &grpc_lb_v0_InitialLoadBalanceRequest_fields), + PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_LoadBalanceRequest, + client_stats, initial_request, &grpc_lb_v0_ClientStats_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { + PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, + grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { + PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_ClientStats, + total_requests, total_requests, 0), + PB_FIELD(2, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, + client_rpc_errors, total_requests, 0), + PB_FIELD(3, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, + dropped_requests, client_rpc_errors, 0), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { + PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, + grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, + &grpc_lb_v0_InitialLoadBalanceResponse_fields), + PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, + grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, + &grpc_lb_v0_ServerList_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { + PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, + grpc_lb_v0_InitialLoadBalanceResponse, client_config, + client_config, 0), + PB_FIELD(2, STRING, OPTIONAL, STATIC, OTHER, + grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, + client_config, 0), + PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER, + grpc_lb_v0_InitialLoadBalanceResponse, + client_stats_report_interval, load_balancer_delegate, + &grpc_lb_v0_Duration_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_ServerList_fields[3] = { + PB_FIELD(1, MESSAGE, REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, + servers, servers, &grpc_lb_v0_Server_fields), + PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ServerList, + expiration_interval, servers, &grpc_lb_v0_Duration_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_Server_fields[5] = { + PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Server, ip_address, + ip_address, 0), + PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, port, + ip_address, 0), + PB_FIELD(3, BYTES, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, + load_balance_token, port, 0), + PB_FIELD(4, BOOL, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, drop_request, + load_balance_token, 0), + PB_LAST_FIELD}; + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT( + (pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && + pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && + pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, + client_stats_report_interval) < 65536 && + pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && + pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), + YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT( + (pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && + pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && + pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, + client_stats_report_interval) < 256 && + pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && + pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), + YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) +#endif diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.h b/src/core/proto/grpc/lb/v0/load_balancer.pb.h new file mode 100644 index 00000000000..897c8af2f74 --- /dev/null +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.h @@ -0,0 +1,189 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.4-dev at Mon Jan 11 11:29:01 2016. */ + +#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED +#define PB_LOAD_BALANCER_PB_H_INCLUDED +#include "third_party/nanopb/pb.h" +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Enum definitions */ +/* Struct definitions */ +typedef struct _grpc_lb_v0_ClientStats { + bool has_total_requests; + int64_t total_requests; + bool has_client_rpc_errors; + int64_t client_rpc_errors; + bool has_dropped_requests; + int64_t dropped_requests; +} grpc_lb_v0_ClientStats; + +typedef struct _grpc_lb_v0_Duration { + bool has_seconds; + int64_t seconds; + bool has_nanos; + int32_t nanos; +} grpc_lb_v0_Duration; + +typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { + bool has_name; + char name[128]; +} grpc_lb_v0_InitialLoadBalanceRequest; + +typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; +typedef struct _grpc_lb_v0_Server { + bool has_ip_address; + char ip_address[46]; + bool has_port; + int32_t port; + bool has_load_balance_token; + grpc_lb_v0_Server_load_balance_token_t load_balance_token; + bool has_drop_request; + bool drop_request; +} grpc_lb_v0_Server; + +typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { + bool has_client_config; + char client_config[64]; + bool has_load_balancer_delegate; + char load_balancer_delegate[64]; + bool has_client_stats_report_interval; + grpc_lb_v0_Duration client_stats_report_interval; +} grpc_lb_v0_InitialLoadBalanceResponse; + +typedef struct _grpc_lb_v0_LoadBalanceRequest { + bool has_initial_request; + grpc_lb_v0_InitialLoadBalanceRequest initial_request; + bool has_client_stats; + grpc_lb_v0_ClientStats client_stats; +} grpc_lb_v0_LoadBalanceRequest; + +typedef struct _grpc_lb_v0_ServerList { + pb_callback_t servers; + bool has_expiration_interval; + grpc_lb_v0_Duration expiration_interval; +} grpc_lb_v0_ServerList; + +typedef struct _grpc_lb_v0_LoadBalanceResponse { + bool has_initial_response; + grpc_lb_v0_InitialLoadBalanceResponse initial_response; + bool has_server_list; + grpc_lb_v0_ServerList server_list; +} grpc_lb_v0_LoadBalanceResponse; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define grpc_lb_v0_Duration_init_default \ + { false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceRequest_init_default \ + { \ + false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, \ + grpc_lb_v0_ClientStats_init_default \ + } +#define grpc_lb_v0_InitialLoadBalanceRequest_init_default \ + { false, "" } +#define grpc_lb_v0_ClientStats_init_default \ + { false, 0, false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceResponse_init_default \ + { \ + false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, \ + grpc_lb_v0_ServerList_init_default \ + } +#define grpc_lb_v0_InitialLoadBalanceResponse_init_default \ + { false, "", false, "", false, grpc_lb_v0_Duration_init_default } +#define grpc_lb_v0_ServerList_init_default \ + { \ + { \ + { NULL } \ + , NULL \ + } \ + , false, grpc_lb_v0_Duration_init_default \ + } +#define grpc_lb_v0_Server_init_default \ + { false, "", false, 0, false, {0, {0}}, false, 0 } +#define grpc_lb_v0_Duration_init_zero \ + { false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceRequest_init_zero \ + { \ + false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, \ + grpc_lb_v0_ClientStats_init_zero \ + } +#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero \ + { false, "" } +#define grpc_lb_v0_ClientStats_init_zero \ + { false, 0, false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceResponse_init_zero \ + { \ + false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, \ + grpc_lb_v0_ServerList_init_zero \ + } +#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero \ + { false, "", false, "", false, grpc_lb_v0_Duration_init_zero } +#define grpc_lb_v0_ServerList_init_zero \ + { \ + { \ + { NULL } \ + , NULL \ + } \ + , false, grpc_lb_v0_Duration_init_zero \ + } +#define grpc_lb_v0_Server_init_zero \ + { false, "", false, 0, false, {0, {0}}, false, 0 } + +/* Field tags (for use in manual encoding/decoding) */ +#define grpc_lb_v0_ClientStats_total_requests_tag 1 +#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 +#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 +#define grpc_lb_v0_Duration_seconds_tag 1 +#define grpc_lb_v0_Duration_nanos_tag 2 +#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 +#define grpc_lb_v0_Server_ip_address_tag 1 +#define grpc_lb_v0_Server_port_tag 2 +#define grpc_lb_v0_Server_load_balance_token_tag 3 +#define grpc_lb_v0_Server_drop_request_tag 4 +#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 +#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 +#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 +#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 +#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 +#define grpc_lb_v0_ServerList_servers_tag 1 +#define grpc_lb_v0_ServerList_expiration_interval_tag 3 +#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 +#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t grpc_lb_v0_Duration_fields[3]; +extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3]; +extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2]; +extern const pb_field_t grpc_lb_v0_ClientStats_fields[4]; +extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3]; +extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4]; +extern const pb_field_t grpc_lb_v0_ServerList_fields[3]; +extern const pb_field_t grpc_lb_v0_Server_fields[5]; + +/* Maximum encoded size of messages (where known) */ +#define grpc_lb_v0_Duration_size 22 +#define grpc_lb_v0_LoadBalanceRequest_size 169 +#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 +#define grpc_lb_v0_ClientStats_size 33 +#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 +#define grpc_lb_v0_Server_size 127 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define LOAD_BALANCER_MESSAGES + +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/core/proto/load_balancer.pb.c b/src/core/proto/load_balancer.pb.c deleted file mode 100644 index 2f29748d21f..00000000000 --- a/src/core/proto/load_balancer.pb.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:38:23 2015. */ - -#include "load_balancer.pb.h" - -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_lb_v0_Duration_fields[3] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Duration, seconds, seconds, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Duration, nanos, seconds, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v0_InitialLoadBalanceRequest_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v0_ClientStats_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_ClientStats, total_requests, total_requests, 0), - PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, client_rpc_errors, total_requests, 0), - PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, dropped_requests, client_rpc_errors, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v0_InitialLoadBalanceResponse_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v0_ServerList_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceResponse, client_config, client_config, 0), - PB_FIELD( 2, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, client_config, 0), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ServerList_fields[3] = { - PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, servers, servers, &grpc_lb_v0_Server_fields), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ServerList, expiration_interval, servers, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_Server_fields[5] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Server, ip_address, ip_address, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, port, ip_address, 0), - PB_FIELD( 3, BYTES , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, load_balance_token, port, 0), - PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, drop_request, load_balance_token, 0), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - - diff --git a/src/core/proto/load_balancer.pb.h b/src/core/proto/load_balancer.pb.h deleted file mode 100644 index 26404a89826..00000000000 --- a/src/core/proto/load_balancer.pb.h +++ /dev/null @@ -1,150 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:38:23 2015. */ - -#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED -#define PB_LOAD_BALANCER_PB_H_INCLUDED -#include "third_party/nanopb/pb.h" -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -/* Struct definitions */ -typedef struct _grpc_lb_v0_ClientStats { - bool has_total_requests; - int64_t total_requests; - bool has_client_rpc_errors; - int64_t client_rpc_errors; - bool has_dropped_requests; - int64_t dropped_requests; -} grpc_lb_v0_ClientStats; - -typedef struct _grpc_lb_v0_Duration { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -} grpc_lb_v0_Duration; - -typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { - bool has_name; - char name[128]; -} grpc_lb_v0_InitialLoadBalanceRequest; - -typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; -typedef struct _grpc_lb_v0_Server { - bool has_ip_address; - char ip_address[46]; - bool has_port; - int32_t port; - bool has_load_balance_token; - grpc_lb_v0_Server_load_balance_token_t load_balance_token; - bool has_drop_request; - bool drop_request; -} grpc_lb_v0_Server; - -typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { - bool has_client_config; - char client_config[64]; - bool has_load_balancer_delegate; - char load_balancer_delegate[64]; - bool has_client_stats_report_interval; - grpc_lb_v0_Duration client_stats_report_interval; -} grpc_lb_v0_InitialLoadBalanceResponse; - -typedef struct _grpc_lb_v0_LoadBalanceRequest { - bool has_initial_request; - grpc_lb_v0_InitialLoadBalanceRequest initial_request; - bool has_client_stats; - grpc_lb_v0_ClientStats client_stats; -} grpc_lb_v0_LoadBalanceRequest; - -typedef struct _grpc_lb_v0_ServerList { - pb_callback_t servers; - bool has_expiration_interval; - grpc_lb_v0_Duration expiration_interval; -} grpc_lb_v0_ServerList; - -typedef struct _grpc_lb_v0_LoadBalanceResponse { - bool has_initial_response; - grpc_lb_v0_InitialLoadBalanceResponse initial_response; - bool has_server_list; - grpc_lb_v0_ServerList server_list; -} grpc_lb_v0_LoadBalanceResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_lb_v0_Duration_init_default {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_default {false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, grpc_lb_v0_ClientStats_init_default} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_default {false, ""} -#define grpc_lb_v0_ClientStats_init_default {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_default {false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, grpc_lb_v0_ServerList_init_default} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_default {false, "", false, "", false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_Server_init_default {false, "", false, 0, false, {0, {0}}, false, 0} -#define grpc_lb_v0_Duration_init_zero {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_zero {false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v0_ClientStats_init_zero} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero {false, ""} -#define grpc_lb_v0_ClientStats_init_zero {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_zero {false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v0_ServerList_init_zero} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero {false, "", false, "", false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_Server_init_zero {false, "", false, 0, false, {0, {0}}, false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_lb_v0_ClientStats_total_requests_tag 1 -#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 -#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 -#define grpc_lb_v0_Duration_seconds_tag 1 -#define grpc_lb_v0_Duration_nanos_tag 2 -#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 -#define grpc_lb_v0_Server_ip_address_tag 1 -#define grpc_lb_v0_Server_port_tag 2 -#define grpc_lb_v0_Server_load_balance_token_tag 3 -#define grpc_lb_v0_Server_drop_request_tag 4 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 -#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 -#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 -#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 -#define grpc_lb_v0_ServerList_servers_tag 1 -#define grpc_lb_v0_ServerList_expiration_interval_tag 3 -#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 -#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_lb_v0_Duration_fields[3]; -extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2]; -extern const pb_field_t grpc_lb_v0_ClientStats_fields[4]; -extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4]; -extern const pb_field_t grpc_lb_v0_ServerList_fields[3]; -extern const pb_field_t grpc_lb_v0_Server_fields[5]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_lb_v0_Duration_size 22 -#define grpc_lb_v0_LoadBalanceRequest_size 169 -#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 -#define grpc_lb_v0_ClientStats_size 33 -#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 -#define grpc_lb_v0_Server_size 127 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define LOAD_BALANCER_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c b/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c deleted file mode 100644 index b225b09450e..00000000000 --- a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:31:24 2015. */ - -#include "load_balancer.pb.h" - -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_lb_v0_Duration_fields[3] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Duration, seconds, seconds, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Duration, nanos, seconds, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v0_InitialLoadBalanceRequest_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v0_ClientStats_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_ClientStats, total_requests, total_requests, 0), - PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, client_rpc_errors, total_requests, 0), - PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, dropped_requests, client_rpc_errors, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v0_InitialLoadBalanceResponse_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v0_ServerList_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceResponse, client_config, client_config, 0), - PB_FIELD( 2, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, client_config, 0), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ServerList_fields[3] = { - PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, servers, servers, &grpc_lb_v0_Server_fields), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ServerList, expiration_interval, servers, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_Server_fields[5] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Server, ip_address, ip_address, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, port, ip_address, 0), - PB_FIELD( 3, BYTES , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, load_balance_token, port, 0), - PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, drop_request, load_balance_token, 0), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - - diff --git a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h b/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h deleted file mode 100644 index d8196302a8c..00000000000 --- a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h +++ /dev/null @@ -1,150 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:31:24 2015. */ - -#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED -#define PB_LOAD_BALANCER_PB_H_INCLUDED -#include "third_party/nanopb/pb.h" -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -/* Struct definitions */ -typedef struct _grpc_lb_v0_ClientStats { - bool has_total_requests; - int64_t total_requests; - bool has_client_rpc_errors; - int64_t client_rpc_errors; - bool has_dropped_requests; - int64_t dropped_requests; -} grpc_lb_v0_ClientStats; - -typedef struct _grpc_lb_v0_Duration { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -} grpc_lb_v0_Duration; - -typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { - bool has_name; - char name[128]; -} grpc_lb_v0_InitialLoadBalanceRequest; - -typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; -typedef struct _grpc_lb_v0_Server { - bool has_ip_address; - char ip_address[46]; - bool has_port; - int32_t port; - bool has_load_balance_token; - grpc_lb_v0_Server_load_balance_token_t load_balance_token; - bool has_drop_request; - bool drop_request; -} grpc_lb_v0_Server; - -typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { - bool has_client_config; - char client_config[64]; - bool has_load_balancer_delegate; - char load_balancer_delegate[64]; - bool has_client_stats_report_interval; - grpc_lb_v0_Duration client_stats_report_interval; -} grpc_lb_v0_InitialLoadBalanceResponse; - -typedef struct _grpc_lb_v0_LoadBalanceRequest { - bool has_initial_request; - grpc_lb_v0_InitialLoadBalanceRequest initial_request; - bool has_client_stats; - grpc_lb_v0_ClientStats client_stats; -} grpc_lb_v0_LoadBalanceRequest; - -typedef struct _grpc_lb_v0_ServerList { - pb_callback_t servers; - bool has_expiration_interval; - grpc_lb_v0_Duration expiration_interval; -} grpc_lb_v0_ServerList; - -typedef struct _grpc_lb_v0_LoadBalanceResponse { - bool has_initial_response; - grpc_lb_v0_InitialLoadBalanceResponse initial_response; - bool has_server_list; - grpc_lb_v0_ServerList server_list; -} grpc_lb_v0_LoadBalanceResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_lb_v0_Duration_init_default {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_default {false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, grpc_lb_v0_ClientStats_init_default} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_default {false, ""} -#define grpc_lb_v0_ClientStats_init_default {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_default {false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, grpc_lb_v0_ServerList_init_default} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_default {false, "", false, "", false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_Server_init_default {false, "", false, 0, false, {0, {0}}, false, 0} -#define grpc_lb_v0_Duration_init_zero {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_zero {false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v0_ClientStats_init_zero} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero {false, ""} -#define grpc_lb_v0_ClientStats_init_zero {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_zero {false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v0_ServerList_init_zero} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero {false, "", false, "", false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_Server_init_zero {false, "", false, 0, false, {0, {0}}, false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_lb_v0_ClientStats_total_requests_tag 1 -#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 -#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 -#define grpc_lb_v0_Duration_seconds_tag 1 -#define grpc_lb_v0_Duration_nanos_tag 2 -#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 -#define grpc_lb_v0_Server_ip_address_tag 1 -#define grpc_lb_v0_Server_port_tag 2 -#define grpc_lb_v0_Server_load_balance_token_tag 3 -#define grpc_lb_v0_Server_drop_request_tag 4 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 -#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 -#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 -#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 -#define grpc_lb_v0_ServerList_servers_tag 1 -#define grpc_lb_v0_ServerList_expiration_interval_tag 3 -#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 -#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_lb_v0_Duration_fields[3]; -extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2]; -extern const pb_field_t grpc_lb_v0_ClientStats_fields[4]; -extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4]; -extern const pb_field_t grpc_lb_v0_ServerList_fields[3]; -extern const pb_field_t grpc_lb_v0_Server_fields[5]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_lb_v0_Duration_size 22 -#define grpc_lb_v0_LoadBalanceRequest_size 169 -#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 -#define grpc_lb_v0_ClientStats_size 33 -#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 -#define grpc_lb_v0_Server_size 127 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define LOAD_BALANCER_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/core/client_config/lb_policies/proto/load_balancer.options b/src/proto/grpc/lb/v0/load_balancer.options similarity index 100% rename from src/core/client_config/lb_policies/proto/load_balancer.options rename to src/proto/grpc/lb/v0/load_balancer.options diff --git a/src/core/client_config/lb_policies/proto/load_balancer.proto b/src/proto/grpc/lb/v0/load_balancer.proto similarity index 100% rename from src/core/client_config/lb_policies/proto/load_balancer.proto rename to src/proto/grpc/lb/v0/load_balancer.proto diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template index ba1c5a5ef85..6ceb3731fb1 100644 --- a/templates/tools/run_tests/sources_and_headers.json.template +++ b/templates/tools/run_tests/sources_and_headers.json.template @@ -12,20 +12,27 @@ out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) return out - def no_protos(src): + def no_protos_filter(src): + return os.path.splitext(src)[1] != '.proto' + + def no_third_party_filter(src): + return not src.startswith('third_party/') + + def filter_srcs(srcs, filters): out = [] - for f in src: - if os.path.splitext(f)[1] != '.proto': - out.append(f) + for s in srcs: + filter_passes = (f(s) for f in filters) + if all(filter_passes): + out.append(s) return out %> ${json.dumps([{"name": tgt.name, "language": tgt.language, "src": sorted( - no_protos(tgt.src) + - tgt.get('public_headers', []) + - tgt.get('headers', [])), + filter_srcs(tgt.src, (no_protos_filter, no_third_party_filter)) + + filter_srcs(tgt.get('public_headers', []), (no_protos_filter, no_third_party_filter)) + + filter_srcs(tgt.get('headers', []), (no_third_party_filter,))), "headers": sorted( tgt.get('public_headers', []) + tgt.get('headers', []) + diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index 5255da37869..98a50a4303a 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -35,7 +35,7 @@ #include #include "src/core/client_config/lb_policies/load_balancer_api.h" -#include "src/core/client_config/lb_policies/proto/load_balancer.pb.h" +#include "src/proto/grpc/lb/v0/load_balancer.pb.h" // C++ version namespace grpc { namespace { @@ -69,9 +69,9 @@ TEST_F(GrpclbTest, ParseResponse) { client_stats_report_interval->set_nanos(456); const std::string encoded_response = response.SerializeAsString(); - gpr_slice encoded_slice = gpr_slice_from_copied_string(encoded_response.c_str()); - grpc_grpclb_response* c_response = - grpc_grpclb_response_parse(encoded_slice); + gpr_slice encoded_slice = + gpr_slice_from_copied_string(encoded_response.c_str()); + grpc_grpclb_response* c_response = grpc_grpclb_response_parse(encoded_slice); EXPECT_TRUE(c_response->has_initial_response); EXPECT_TRUE(c_response->initial_response.has_client_config); EXPECT_FALSE(c_response->initial_response.has_load_balancer_delegate); @@ -101,8 +101,9 @@ TEST_F(GrpclbTest, ParseResponseServerList) { expiration_interval->set_nanos(999); const std::string encoded_response = response.SerializeAsString(); - gpr_slice encoded_slice = gpr_slice_from_copied_string(encoded_response.c_str()); - grpc_grpclb_serverlist *c_serverlist = + gpr_slice encoded_slice = + gpr_slice_from_copied_string(encoded_response.c_str()); + grpc_grpclb_serverlist* c_serverlist = grpc_grpclb_response_parse_serverlist(encoded_slice); ASSERT_EQ(c_serverlist->num_servers, 2ul); EXPECT_TRUE(c_serverlist->servers[0]->has_ip_address); diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 20fddf14f31..1c5384d8358 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -2,7 +2,7 @@ # # Example usage: # tools/codegen/core/gen_load_balancing_proto.sh \ -# src/core/client_config/lb_policies/proto/load_balancer.proto +# src/proto/grpc/lb/v0/load_balancer.proto if [ $# -eq 0 ]; then echo "Usage: $0 " @@ -26,7 +26,13 @@ pushd "$(dirname $1)" > /dev/null protoc \ --plugin=protoc-gen-nanopb="$GRPC_ROOT/third_party/nanopb/generator/protoc-gen-nanopb" \ ---nanopb_out='-L#include\ \"third_party/nanopb/pb.h\"'":$GRPC_ROOT/src/core/proto" \ +--nanopb_out='-L#include\ \"third_party/nanopb/pb.h\"'":$GRPC_ROOT/src/core/proto/grpc/lb/v0" \ "$(basename $1)" +readonly PROTO_BASENAME=$(basename $1 .proto) +sed -i "s:$PROTO_BASENAME.pb.h:src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" \ + "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" +clang-format -i "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" +clang-format -i "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h" + popd > /dev/null diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index cca2a0c079a..de1d3335a73 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -856,7 +856,7 @@ src/core/json/json.h \ src/core/json/json_common.h \ src/core/json/json_reader.h \ src/core/json/json_writer.h \ -src/core/proto/load_balancer.pb.h \ +src/core/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/statistics/census_interface.h \ src/core/statistics/census_rpc_stats.h \ src/core/surface/api_trace.h \ @@ -896,13 +896,13 @@ src/core/transport/metadata_batch.h \ src/core/transport/static_metadata.h \ src/core/transport/transport.h \ src/core/transport/transport_impl.h \ +src/core/census/aggregation.h \ +src/core/census/context.h \ +src/core/census/rpc_metric_id.h \ third_party/nanopb/pb.h \ third_party/nanopb/pb_common.h \ third_party/nanopb/pb_decode.h \ third_party/nanopb/pb_encode.h \ -src/core/census/aggregation.h \ -src/core/census/context.h \ -src/core/census/rpc_metric_id.h \ src/core/httpcli/httpcli_security_connector.c \ src/core/security/base64.c \ src/core/security/client_auth_filter.c \ @@ -1003,7 +1003,7 @@ src/core/json/json.c \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ -src/core/proto/load_balancer.pb.c \ +src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_reader.c \ @@ -1051,13 +1051,13 @@ src/core/transport/metadata_batch.c \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ -third_party/nanopb/pb_common.c \ -third_party/nanopb/pb_decode.c \ -third_party/nanopb/pb_encode.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ src/core/census/tracing.c \ +third_party/nanopb/pb_common.c \ +third_party/nanopb/pb_decode.c \ +third_party/nanopb/pb_encode.c \ include/grpc/support/alloc.h \ include/grpc/support/atm.h \ include/grpc/support/atm_gcc_atomic.h \ diff --git a/tools/run_tests/run_sanity.sh b/tools/run_tests/run_sanity.sh index 690332daae0..8170cff7775 100755 --- a/tools/run_tests/run_sanity.sh +++ b/tools/run_tests/run_sanity.sh @@ -44,6 +44,7 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules 9f897b25800d2f54f5c442ef01a60721aeca6d87 third_party/boringssl (version_for_cocoapods_1.0-67-g9f897b2) 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) + 5497a1dfc91a86965383cdd1652e348345400435 third_party/nanopb (nanopb-0.3.3-10-g5497a1d) 8fce8933649ce09c1661ff2b5b7f6eb79badd251 third_party/protobuf (v3.0.0-alpha-4-1-g8fce893) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) EOF diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 075cd0c9c20..73d1a63bf11 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -1592,8 +1592,8 @@ "grpc++" ], "headers": [ - "src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.h", - "src/core/client_config/lb_policies/proto/load_balancer.pb.h" + "src/proto/grpc/lb/v0/load_balancer.grpc.pb.h", + "src/proto/grpc/lb/v0/load_balancer.pb.h" ], "language": "c++", "name": "grpclb_api_test", @@ -2947,7 +2947,7 @@ "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/security/auth_filters.h", "src/core/security/base64.h", "src/core/security/credentials.h", @@ -3178,8 +3178,8 @@ "src/core/json/json_string.c", "src/core/json/json_writer.c", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.c", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/security/auth_filters.h", "src/core/security/base64.c", "src/core/security/base64.h", @@ -3299,14 +3299,7 @@ "src/core/tsi/ssl_types.h", "src/core/tsi/transport_security.c", "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.c", - "third_party/nanopb/pb_encode.h" + "src/core/tsi/transport_security_interface.h" ] }, { @@ -3476,7 +3469,7 @@ "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -3691,8 +3684,8 @@ "src/core/json/json_string.c", "src/core/json/json_writer.c", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.c", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.c", @@ -3779,14 +3772,7 @@ "src/core/transport/transport.c", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", - "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.c", - "third_party/nanopb/pb_encode.h" + "src/core/transport/transport_op_string.c" ] }, { diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 814bfe74bb7..106c1b5f9fe 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -363,7 +363,7 @@ - + @@ -403,13 +403,13 @@ + + + - - - @@ -612,7 +612,7 @@ - + @@ -708,12 +708,6 @@ - - - - - - @@ -722,6 +716,12 @@ + + + + + + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 06bb8871530..107f195d5c0 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -301,8 +301,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\surface @@ -445,15 +445,6 @@ src\core\transport - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - src\core\census @@ -466,6 +457,15 @@ src\core\census + + third_party\nanopb + + + third_party\nanopb + + + third_party\nanopb + @@ -758,8 +758,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\statistics @@ -878,6 +878,15 @@ src\core\transport + + src\core\census + + + src\core\census + + + src\core\census + third_party\nanopb @@ -890,15 +899,6 @@ third_party\nanopb - - src\core\census - - - src\core\census - - - src\core\census - @@ -947,6 +947,15 @@ {1ff04466-0905-8a5d-d6f4-7ff2df4c13b5} + + {7c7ad0b3-bf85-5bd3-e0c8-4f5468a8e2e6} + + + {3d533dad-8100-e8a3-b7c3-1fc13a4d60da} + + + {0ffcf868-7617-5fed-b6ce-2162d9d09148} + {1d850ac6-e639-4eab-5338-4ba40272fcc9} diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index fe74addb40c..8c062c797ba 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -341,7 +341,7 @@ - + @@ -381,13 +381,13 @@ + + + - - - @@ -550,7 +550,7 @@ - + @@ -646,12 +646,6 @@ - - - - - - @@ -660,6 +654,12 @@ + + + + + + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index f4be06d8e74..56d451ef29e 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -241,8 +241,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\surface @@ -385,15 +385,6 @@ src\core\transport - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - src\core\census @@ -406,6 +397,15 @@ src\core\census + + third_party\nanopb + + + third_party\nanopb + + + third_party\nanopb + @@ -653,8 +653,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\statistics @@ -773,6 +773,15 @@ src\core\transport + + src\core\census + + + src\core\census + + + src\core\census + third_party\nanopb @@ -785,15 +794,6 @@ third_party\nanopb - - src\core\census - - - src\core\census - - - src\core\census - @@ -842,6 +842,15 @@ {7f4bb22a-65ba-0f8f-6387-66b1f6677a80} + + {9c2bd164-c317-8a13-564d-3b28b0fd79cf} + + + {2bad8e10-4fc5-d8b3-e026-4abbd0c25cda} + + + {4475c8ed-e01b-8906-47d0-8a504189c0d5} + {e084164c-a069-00e3-db35-4e0b1cd6f0b7} diff --git a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj index b8f4c121db8..0f57b28e968 100644 --- a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj +++ b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj @@ -158,13 +158,13 @@ - + - + - + - + diff --git a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters index e561eaeb73f..6c57b8c162a 100644 --- a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters +++ b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters @@ -1,8 +1,8 @@ - - src\core\client_config\lb_policies\proto + + src\proto\grpc\lb\v0 test\cpp\grpclb @@ -13,17 +13,17 @@ {a31d21fb-c6ab-75ce-43dc-7d6f506765e6} - - {1ac58546-6910-9066-c5c0-fe8db59c641f} + + {10d49c90-8503-9b10-6678-eed983bc25d9} - - {9b998f5c-bc1b-9fc5-d21b-368485aac585} + + {8b6be783-e071-44cc-2096-f1c476012556} - - {bb3a28b9-b005-fd49-9cc3-8ee9552226c1} + + {2981699e-c196-c599-bc17-c177770f89ee} - - {b555558c-3db4-9746-b58e-40ccc1680c8a} + + {3d04774a-1c2f-e100-435e-08af5d539250} {64736e1d-eb77-664f-34ab-6cf41263d3d8}