grpc 1.23.0 → 1.24.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (245) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +765 -485
  3. data/include/grpc/grpc.h +3 -1
  4. data/include/grpc/grpc_security.h +20 -4
  5. data/include/grpc/impl/codegen/grpc_types.h +6 -5
  6. data/include/grpc/impl/codegen/port_platform.h +25 -0
  7. data/src/core/ext/filters/client_channel/backend_metric.cc +78 -0
  8. data/src/core/ext/filters/client_channel/backend_metric.h +36 -0
  9. data/src/core/ext/filters/client_channel/channel_connectivity.cc +16 -2
  10. data/src/core/ext/filters/client_channel/client_channel.cc +325 -267
  11. data/src/core/ext/filters/client_channel/client_channel_factory.h +0 -4
  12. data/src/core/ext/filters/client_channel/health/health_check_client.cc +23 -32
  13. data/src/core/ext/filters/client_channel/http_proxy.cc +7 -3
  14. data/src/core/ext/filters/client_channel/lb_policy.cc +1 -1
  15. data/src/core/ext/filters/client_channel/lb_policy.h +58 -34
  16. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +46 -50
  17. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +9 -2
  18. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +35 -17
  19. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +130 -215
  20. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +34 -21
  21. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +1120 -802
  22. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h +8 -2
  23. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc +33 -12
  24. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc +151 -40
  25. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h +184 -26
  26. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc +389 -245
  27. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h +98 -60
  28. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +6 -1
  29. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +89 -0
  30. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +3 -8
  31. data/src/core/ext/filters/client_channel/server_address.cc +1 -3
  32. data/src/core/ext/filters/client_channel/server_address.h +1 -1
  33. data/src/core/ext/filters/client_channel/subchannel.h +2 -1
  34. data/src/core/ext/filters/client_idle/client_idle_filter.cc +207 -29
  35. data/src/core/ext/filters/http/client/http_client_filter.cc +10 -8
  36. data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
  37. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +10 -7
  38. data/src/core/ext/filters/http/server/http_server_filter.cc +52 -26
  39. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +23 -20
  40. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +24 -21
  41. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -1
  42. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +37 -24
  43. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -0
  44. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +237 -191
  45. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +29 -27
  46. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +1 -1
  47. data/src/core/ext/transport/chttp2/transport/hpack_table.cc +19 -4
  48. data/src/core/ext/transport/chttp2/transport/hpack_table.h +13 -4
  49. data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +2 -1
  50. data/src/core/ext/transport/chttp2/transport/internal.h +0 -2
  51. data/src/core/ext/transport/chttp2/transport/parsing.cc +99 -71
  52. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +222 -0
  53. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +818 -0
  54. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +314 -0
  55. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +1142 -0
  56. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +53 -0
  57. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +158 -0
  58. data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +34 -0
  59. data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h +69 -0
  60. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +49 -0
  61. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +240 -0
  62. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +110 -0
  63. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +324 -0
  64. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +235 -0
  65. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +661 -0
  66. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +84 -0
  67. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +274 -0
  68. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +175 -0
  69. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +572 -0
  70. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +150 -0
  71. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +596 -0
  72. data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +35 -0
  73. data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h +80 -0
  74. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +95 -0
  75. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +308 -0
  76. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +128 -0
  77. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h +392 -0
  78. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +91 -0
  79. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +236 -0
  80. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +88 -0
  81. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +258 -0
  82. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +111 -0
  83. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h +324 -0
  84. data/src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c +23 -0
  85. data/src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h +50 -0
  86. data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c +52 -0
  87. data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h +130 -0
  88. data/src/core/ext/upb-generated/envoy/type/percent.upb.c +39 -0
  89. data/src/core/ext/upb-generated/envoy/type/percent.upb.h +87 -0
  90. data/src/core/ext/upb-generated/envoy/type/range.upb.c +39 -0
  91. data/src/core/ext/upb-generated/envoy/type/range.upb.h +85 -0
  92. data/src/core/ext/upb-generated/gogoproto/gogo.upb.c +17 -0
  93. data/src/core/ext/upb-generated/gogoproto/gogo.upb.h +30 -0
  94. data/src/core/ext/upb-generated/google/api/annotations.upb.c +18 -0
  95. data/src/core/ext/upb-generated/google/api/annotations.upb.h +30 -0
  96. data/src/core/ext/upb-generated/google/api/http.upb.c +66 -0
  97. data/src/core/ext/upb-generated/google/api/http.upb.h +190 -0
  98. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +27 -0
  99. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +58 -0
  100. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +485 -0
  101. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1690 -0
  102. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +27 -0
  103. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +58 -0
  104. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +22 -0
  105. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +50 -0
  106. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +79 -0
  107. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +215 -0
  108. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +27 -0
  109. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +58 -0
  110. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +106 -0
  111. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +238 -0
  112. data/src/core/ext/upb-generated/google/rpc/status.upb.c +33 -0
  113. data/src/core/ext/upb-generated/google/rpc/status.upb.h +74 -0
  114. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +49 -0
  115. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +126 -0
  116. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +209 -0
  117. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +681 -0
  118. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +42 -0
  119. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +109 -0
  120. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +36 -0
  121. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +84 -0
  122. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +133 -0
  123. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +359 -0
  124. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +58 -0
  125. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +144 -0
  126. data/src/core/ext/upb-generated/validate/validate.upb.c +443 -0
  127. data/src/core/ext/upb-generated/validate/validate.upb.h +2037 -0
  128. data/src/core/lib/channel/channel_args.cc +21 -0
  129. data/src/core/lib/channel/channel_args.h +16 -2
  130. data/src/core/lib/channel/channel_stack.h +2 -1
  131. data/src/core/lib/channel/channelz.cc +54 -56
  132. data/src/core/lib/channel/channelz.h +29 -12
  133. data/src/core/lib/compression/compression.cc +2 -1
  134. data/src/core/lib/compression/compression_internal.h +8 -0
  135. data/src/core/lib/gpr/log_linux.cc +2 -2
  136. data/src/core/lib/gpr/log_posix.cc +2 -2
  137. data/src/core/lib/gpr/time_precise.cc +123 -36
  138. data/src/core/lib/gpr/time_precise.h +37 -0
  139. data/src/core/lib/gprpp/abstract.h +10 -0
  140. data/src/core/lib/gprpp/atomic.h +4 -0
  141. data/src/core/lib/gprpp/inlined_vector.h +20 -4
  142. data/src/core/lib/gprpp/map.h +109 -6
  143. data/src/core/lib/gprpp/memory.h +6 -0
  144. data/src/core/lib/gprpp/ref_counted_ptr.h +2 -0
  145. data/src/core/lib/iomgr/ev_epollex_linux.cc +29 -54
  146. data/src/core/lib/iomgr/exec_ctx.cc +27 -17
  147. data/src/core/lib/iomgr/exec_ctx.h +3 -0
  148. data/src/core/lib/iomgr/sockaddr_utils.cc +1 -3
  149. data/src/core/lib/iomgr/tcp_posix.cc +16 -25
  150. data/src/core/lib/iomgr/tcp_server_custom.cc +1 -1
  151. data/src/core/lib/iomgr/timer_manager.cc +8 -1
  152. data/src/core/lib/iomgr/timer_manager.h +2 -0
  153. data/src/core/lib/security/credentials/credentials.h +8 -2
  154. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +23 -0
  155. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +3 -0
  156. data/src/core/lib/security/credentials/tls/spiffe_credentials.cc +3 -3
  157. data/src/core/lib/security/security_connector/ssl_utils.cc +1 -12
  158. data/src/core/lib/security/security_connector/ssl_utils.h +10 -6
  159. data/src/core/lib/security/security_connector/ssl_utils_config.cc +32 -0
  160. data/src/core/lib/security/security_connector/ssl_utils_config.h +30 -0
  161. data/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +161 -49
  162. data/src/core/lib/security/security_connector/tls/spiffe_security_connector.h +34 -1
  163. data/src/core/lib/slice/slice_intern.cc +17 -9
  164. data/src/core/lib/slice/slice_internal.h +34 -7
  165. data/src/core/lib/slice/slice_utils.h +7 -3
  166. data/src/core/lib/surface/call.cc +97 -57
  167. data/src/core/lib/surface/channel.cc +2 -2
  168. data/src/core/lib/surface/completion_queue.cc +10 -16
  169. data/src/core/lib/surface/init.cc +3 -0
  170. data/src/core/lib/surface/server.cc +11 -14
  171. data/src/core/lib/surface/validate_metadata.cc +4 -0
  172. data/src/core/lib/surface/version.cc +2 -2
  173. data/src/core/lib/transport/metadata.cc +4 -4
  174. data/src/core/lib/transport/metadata_batch.cc +72 -16
  175. data/src/core/lib/transport/metadata_batch.h +38 -0
  176. data/src/core/lib/transport/static_metadata.cc +814 -1023
  177. data/src/core/lib/transport/static_metadata.h +271 -213
  178. data/src/core/lib/transport/transport.h +12 -0
  179. data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
  180. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +104 -76
  181. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +34 -16
  182. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +2 -2
  183. data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +10 -6
  184. data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +4 -3
  185. data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +74 -48
  186. data/src/core/tsi/alts/handshaker/transport_security_common_api.h +34 -26
  187. data/src/core/tsi/ssl_transport_security.cc +14 -6
  188. data/src/core/tsi/ssl_transport_security.h +4 -0
  189. data/src/ruby/ext/grpc/ext-export.clang +1 -0
  190. data/src/ruby/ext/grpc/ext-export.gcc +6 -0
  191. data/src/ruby/ext/grpc/extconf.rb +5 -0
  192. data/src/ruby/ext/grpc/rb_enable_cpp.cc +22 -0
  193. data/src/ruby/ext/grpc/rb_grpc.c +1 -42
  194. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +4 -0
  195. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +6 -0
  196. data/src/ruby/lib/grpc.rb +2 -0
  197. data/src/ruby/lib/grpc/core/status_codes.rb +135 -0
  198. data/src/ruby/lib/grpc/errors.rb +4 -7
  199. data/src/ruby/lib/grpc/google_rpc_status_utils.rb +9 -4
  200. data/src/ruby/lib/grpc/structs.rb +15 -0
  201. data/src/ruby/lib/grpc/version.rb +1 -1
  202. data/src/ruby/spec/errors_spec.rb +1 -0
  203. data/src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto +22 -0
  204. data/src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto +34 -0
  205. data/src/ruby/spec/pb/codegen/package_option_spec.rb +53 -29
  206. data/third_party/upb/upb/decode.c +604 -0
  207. data/third_party/upb/upb/decode.h +21 -0
  208. data/third_party/upb/upb/encode.c +378 -0
  209. data/third_party/upb/upb/encode.h +21 -0
  210. data/third_party/upb/upb/generated_util.h +105 -0
  211. data/third_party/upb/upb/msg.c +111 -0
  212. data/third_party/upb/upb/msg.h +69 -0
  213. data/third_party/upb/upb/port.c +27 -0
  214. data/third_party/upb/upb/port_def.inc +152 -0
  215. data/third_party/upb/upb/port_undef.inc +21 -0
  216. data/third_party/upb/upb/table.c +911 -0
  217. data/third_party/upb/upb/table.int.h +507 -0
  218. data/third_party/upb/upb/upb.c +261 -0
  219. data/third_party/upb/upb/upb.h +364 -0
  220. metadata +129 -50
  221. data/src/core/ext/filters/client_channel/health/health.pb.c +0 -23
  222. data/src/core/ext/filters/client_channel/health/health.pb.h +0 -73
  223. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c +0 -19
  224. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h +0 -54
  225. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c +0 -19
  226. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h +0 -54
  227. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +0 -89
  228. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +0 -164
  229. data/src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc +0 -520
  230. data/src/core/tsi/alts/handshaker/alts_handshaker_service_api.h +0 -323
  231. data/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc +0 -145
  232. data/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h +0 -149
  233. data/src/core/tsi/alts/handshaker/altscontext.pb.c +0 -47
  234. data/src/core/tsi/alts/handshaker/altscontext.pb.h +0 -63
  235. data/src/core/tsi/alts/handshaker/handshaker.pb.c +0 -122
  236. data/src/core/tsi/alts/handshaker/handshaker.pb.h +0 -254
  237. data/src/core/tsi/alts/handshaker/transport_security_common.pb.c +0 -49
  238. data/src/core/tsi/alts/handshaker/transport_security_common.pb.h +0 -78
  239. data/third_party/nanopb/pb.h +0 -579
  240. data/third_party/nanopb/pb_common.c +0 -97
  241. data/third_party/nanopb/pb_common.h +0 -42
  242. data/third_party/nanopb/pb_decode.c +0 -1347
  243. data/third_party/nanopb/pb_decode.h +0 -149
  244. data/third_party/nanopb/pb_encode.c +0 -696
  245. data/third_party/nanopb/pb_encode.h +0 -154
@@ -29,9 +29,6 @@ bool grpc_gcp_rpc_protocol_versions_set_max(
29
29
  "grpc_gcp_rpc_protocol_versions_set_max().");
30
30
  return false;
31
31
  }
32
- versions->has_max_rpc_version = true;
33
- versions->max_rpc_version.has_major = true;
34
- versions->max_rpc_version.has_minor = true;
35
32
  versions->max_rpc_version.major = max_major;
36
33
  versions->max_rpc_version.minor = max_minor;
37
34
  return true;
@@ -46,63 +43,45 @@ bool grpc_gcp_rpc_protocol_versions_set_min(
46
43
  "grpc_gcp_rpc_protocol_versions_set_min().");
47
44
  return false;
48
45
  }
49
- versions->has_min_rpc_version = true;
50
- versions->min_rpc_version.has_major = true;
51
- versions->min_rpc_version.has_minor = true;
52
46
  versions->min_rpc_version.major = min_major;
53
47
  versions->min_rpc_version.minor = min_minor;
54
48
  return true;
55
49
  }
56
50
 
57
- size_t grpc_gcp_rpc_protocol_versions_encode_length(
58
- const grpc_gcp_rpc_protocol_versions* versions) {
59
- if (versions == nullptr) {
60
- gpr_log(GPR_ERROR,
61
- "Invalid nullptr arguments to "
62
- "grpc_gcp_rpc_protocol_versions_encode_length().");
63
- return 0;
64
- }
65
- pb_ostream_t size_stream;
66
- memset(&size_stream, 0, sizeof(pb_ostream_t));
67
- if (!pb_encode(&size_stream, grpc_gcp_RpcProtocolVersions_fields, versions)) {
68
- gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&size_stream));
69
- return 0;
70
- }
71
- return size_stream.bytes_written;
72
- }
73
-
74
- bool grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes(
75
- const grpc_gcp_rpc_protocol_versions* versions, uint8_t* bytes,
76
- size_t bytes_length) {
77
- if (versions == nullptr || bytes == nullptr || bytes_length == 0) {
51
+ bool grpc_gcp_rpc_protocol_versions_encode(
52
+ const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice) {
53
+ if (versions == nullptr || slice == nullptr) {
78
54
  gpr_log(GPR_ERROR,
79
55
  "Invalid nullptr arguments to "
80
- "grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes().");
81
- return false;
82
- }
83
- pb_ostream_t output_stream = pb_ostream_from_buffer(bytes, bytes_length);
84
- if (!pb_encode(&output_stream, grpc_gcp_RpcProtocolVersions_fields,
85
- versions)) {
86
- gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&output_stream));
56
+ "grpc_gcp_rpc_protocol_versions_encode().");
87
57
  return false;
88
58
  }
89
- return true;
59
+ upb::Arena arena;
60
+ grpc_gcp_RpcProtocolVersions* versions_msg =
61
+ grpc_gcp_RpcProtocolVersions_new(arena.ptr());
62
+ grpc_gcp_RpcProtocolVersions_assign_from_struct(versions_msg, arena.ptr(),
63
+ versions);
64
+ return grpc_gcp_rpc_protocol_versions_encode(versions_msg, arena.ptr(),
65
+ slice);
90
66
  }
91
67
 
92
68
  bool grpc_gcp_rpc_protocol_versions_encode(
93
- const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice) {
94
- if (versions == nullptr || slice == nullptr) {
69
+ const grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
70
+ grpc_slice* slice) {
71
+ if (versions == nullptr || arena == nullptr || slice == nullptr) {
95
72
  gpr_log(GPR_ERROR,
96
73
  "Invalid nullptr arguments to "
97
74
  "grpc_gcp_rpc_protocol_versions_encode().");
98
75
  return false;
99
76
  }
100
- size_t encoded_length =
101
- grpc_gcp_rpc_protocol_versions_encode_length(versions);
102
- if (encoded_length == 0) return false;
103
- *slice = grpc_slice_malloc(encoded_length);
104
- return grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes(
105
- versions, GRPC_SLICE_START_PTR(*slice), encoded_length);
77
+ size_t buf_length;
78
+ char* buf =
79
+ grpc_gcp_RpcProtocolVersions_serialize(versions, arena, &buf_length);
80
+ if (buf == nullptr) {
81
+ return false;
82
+ }
83
+ *slice = grpc_slice_from_copied_buffer(buf, buf_length);
84
+ return true;
106
85
  }
107
86
 
108
87
  bool grpc_gcp_rpc_protocol_versions_decode(
@@ -113,16 +92,63 @@ bool grpc_gcp_rpc_protocol_versions_decode(
113
92
  "grpc_gcp_rpc_protocol_versions_decode().");
114
93
  return false;
115
94
  }
116
- pb_istream_t stream =
117
- pb_istream_from_buffer(const_cast<uint8_t*>(GRPC_SLICE_START_PTR(slice)),
118
- GRPC_SLICE_LENGTH(slice));
119
- if (!pb_decode(&stream, grpc_gcp_RpcProtocolVersions_fields, versions)) {
120
- gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream));
95
+ upb::Arena arena;
96
+ grpc_gcp_RpcProtocolVersions* versions_msg =
97
+ grpc_gcp_RpcProtocolVersions_parse(
98
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(slice)),
99
+ GRPC_SLICE_LENGTH(slice), arena.ptr());
100
+ if (versions_msg == nullptr) {
101
+ gpr_log(GPR_ERROR, "cannot deserialize RpcProtocolVersions message");
121
102
  return false;
122
103
  }
104
+ grpc_gcp_rpc_protocol_versions_assign_from_upb(versions, versions_msg);
123
105
  return true;
124
106
  }
125
107
 
108
+ void grpc_gcp_rpc_protocol_versions_assign_from_upb(
109
+ grpc_gcp_rpc_protocol_versions* versions,
110
+ const grpc_gcp_RpcProtocolVersions* value) {
111
+ const grpc_gcp_RpcProtocolVersions_Version* max_version_msg =
112
+ grpc_gcp_RpcProtocolVersions_max_rpc_version(value);
113
+ if (max_version_msg != nullptr) {
114
+ versions->max_rpc_version.major =
115
+ grpc_gcp_RpcProtocolVersions_Version_major(max_version_msg);
116
+ versions->max_rpc_version.minor =
117
+ grpc_gcp_RpcProtocolVersions_Version_minor(max_version_msg);
118
+ } else {
119
+ versions->max_rpc_version.major = 0;
120
+ versions->max_rpc_version.minor = 0;
121
+ }
122
+ const grpc_gcp_RpcProtocolVersions_Version* min_version_msg =
123
+ grpc_gcp_RpcProtocolVersions_min_rpc_version(value);
124
+ if (min_version_msg != nullptr) {
125
+ versions->min_rpc_version.major =
126
+ grpc_gcp_RpcProtocolVersions_Version_major(min_version_msg);
127
+ versions->min_rpc_version.minor =
128
+ grpc_gcp_RpcProtocolVersions_Version_minor(min_version_msg);
129
+ } else {
130
+ versions->min_rpc_version.major = 0;
131
+ versions->min_rpc_version.minor = 0;
132
+ }
133
+ }
134
+
135
+ void grpc_gcp_RpcProtocolVersions_assign_from_struct(
136
+ grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
137
+ const grpc_gcp_rpc_protocol_versions* value) {
138
+ grpc_gcp_RpcProtocolVersions_Version* max_version_msg =
139
+ grpc_gcp_RpcProtocolVersions_mutable_max_rpc_version(versions, arena);
140
+ grpc_gcp_RpcProtocolVersions_Version_set_major(max_version_msg,
141
+ value->max_rpc_version.major);
142
+ grpc_gcp_RpcProtocolVersions_Version_set_minor(max_version_msg,
143
+ value->max_rpc_version.minor);
144
+ grpc_gcp_RpcProtocolVersions_Version* min_version_msg =
145
+ grpc_gcp_RpcProtocolVersions_mutable_min_rpc_version(versions, arena);
146
+ grpc_gcp_RpcProtocolVersions_Version_set_major(min_version_msg,
147
+ value->min_rpc_version.major);
148
+ grpc_gcp_RpcProtocolVersions_Version_set_minor(min_version_msg,
149
+ value->min_rpc_version.minor);
150
+ }
151
+
126
152
  bool grpc_gcp_rpc_protocol_versions_copy(
127
153
  const grpc_gcp_rpc_protocol_versions* src,
128
154
  grpc_gcp_rpc_protocol_versions* dst) {
@@ -21,20 +21,24 @@
21
21
 
22
22
  #include <grpc/support/port_platform.h>
23
23
 
24
- #include "pb_decode.h"
25
- #include "pb_encode.h"
26
-
27
24
  #include <grpc/slice.h>
28
25
  #include <grpc/slice_buffer.h>
29
26
  #include <grpc/support/alloc.h>
30
27
  #include <grpc/support/log.h>
31
28
 
32
- #include "src/core/tsi/alts/handshaker/transport_security_common.pb.h"
29
+ #include "src/proto/grpc/gcp/transport_security_common.upb.h"
33
30
 
34
- typedef grpc_gcp_RpcProtocolVersions grpc_gcp_rpc_protocol_versions;
31
+ // C struct coresponding to protobuf message RpcProtocolVersions.Version
32
+ typedef struct _grpc_gcp_RpcProtocolVersions_Version {
33
+ uint32_t major;
34
+ uint32_t minor;
35
+ } grpc_gcp_rpc_protocol_versions_version;
35
36
 
36
- typedef grpc_gcp_RpcProtocolVersions_Version
37
- grpc_gcp_rpc_protocol_versions_version;
37
+ // C struct coresponding to protobuf message RpcProtocolVersions
38
+ typedef struct _grpc_gcp_RpcProtocolVersions {
39
+ grpc_gcp_rpc_protocol_versions_version max_rpc_version;
40
+ grpc_gcp_rpc_protocol_versions_version min_rpc_version;
41
+ } grpc_gcp_rpc_protocol_versions;
38
42
 
39
43
  /**
40
44
  * This method sets the value for max_rpc_versions field of rpc protocol
@@ -65,41 +69,30 @@ bool grpc_gcp_rpc_protocol_versions_set_min(
65
69
  uint32_t min_minor);
66
70
 
67
71
  /**
68
- * This method computes serialized byte length of rpc protocol versions.
69
- *
70
- * - versions: an rpc protocol versions instance.
71
- *
72
- * The method returns serialized byte length. It returns 0 on failure.
73
- */
74
- size_t grpc_gcp_rpc_protocol_versions_encode_length(
75
- const grpc_gcp_rpc_protocol_versions* versions);
76
-
77
- /**
78
- * This method serializes rpc protocol versions and writes the result to
79
- * the memory buffer provided by the caller. Caller is responsible for
80
- * allocating sufficient memory to store the serialized data.
72
+ * This method serializes an rpc protocol version and returns serialized rpc
73
+ * versions in grpc slice.
81
74
  *
82
75
  * - versions: an rpc protocol versions instance.
83
- * - bytes: bytes buffer where the result will be written to.
84
- * - bytes_length: length of the bytes buffer.
76
+ * - slice: grpc slice where the serialized result will be written.
85
77
  *
86
78
  * The method returns true on success and false otherwise.
87
79
  */
88
- bool grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes(
89
- const grpc_gcp_rpc_protocol_versions* versions, uint8_t* bytes,
90
- size_t bytes_length);
80
+ bool grpc_gcp_rpc_protocol_versions_encode(
81
+ const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice);
91
82
 
92
83
  /**
93
84
  * This method serializes an rpc protocol version and returns serialized rpc
94
85
  * versions in grpc slice.
95
86
  *
96
87
  * - versions: an rpc protocol versions instance.
88
+ * - arena: upb arena.
97
89
  * - slice: grpc slice where the serialized result will be written.
98
90
  *
99
91
  * The method returns true on success and false otherwise.
100
92
  */
101
93
  bool grpc_gcp_rpc_protocol_versions_encode(
102
- const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice);
94
+ const grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
95
+ grpc_slice* slice);
103
96
 
104
97
  /**
105
98
  * This method de-serializes input in grpc slice form and stores the result
@@ -114,6 +107,21 @@ bool grpc_gcp_rpc_protocol_versions_encode(
114
107
  bool grpc_gcp_rpc_protocol_versions_decode(
115
108
  const grpc_slice& slice, grpc_gcp_rpc_protocol_versions* versions);
116
109
 
110
+ /**
111
+ * Assigns value of upb RpcProtocolVersions to grpc_gcp_rpc_protocol_versions.
112
+ */
113
+ void grpc_gcp_rpc_protocol_versions_assign_from_upb(
114
+ grpc_gcp_rpc_protocol_versions* versions,
115
+ const grpc_gcp_RpcProtocolVersions* value);
116
+
117
+ /**
118
+ * Assigns value of struct grpc_gcp_rpc_protocol_versions to
119
+ * RpcProtocolVersions.
120
+ */
121
+ void grpc_gcp_RpcProtocolVersions_assign_from_struct(
122
+ grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
123
+ const grpc_gcp_rpc_protocol_versions* value);
124
+
117
125
  /**
118
126
  * This method performs a deep copy operation on rpc protocol versions
119
127
  * instance.
@@ -350,11 +350,19 @@ static tsi_result add_subject_alt_names_properties_to_peer(
350
350
  for (i = 0; i < subject_alt_name_count; i++) {
351
351
  GENERAL_NAME* subject_alt_name =
352
352
  sk_GENERAL_NAME_value(subject_alt_names, TSI_SIZE_AS_SIZE(i));
353
- /* Filter out the non-dns entries names. */
354
- if (subject_alt_name->type == GEN_DNS) {
353
+ if (subject_alt_name->type == GEN_DNS ||
354
+ subject_alt_name->type == GEN_EMAIL ||
355
+ subject_alt_name->type == GEN_URI) {
355
356
  unsigned char* name = nullptr;
356
357
  int name_size;
357
- name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.dNSName);
358
+ if (subject_alt_name->type == GEN_DNS) {
359
+ name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.dNSName);
360
+ } else if (subject_alt_name->type == GEN_EMAIL) {
361
+ name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.rfc822Name);
362
+ } else {
363
+ name_size = ASN1_STRING_to_UTF8(
364
+ &name, subject_alt_name->d.uniformResourceIdentifier);
365
+ }
358
366
  if (name_size < 0) {
359
367
  gpr_log(GPR_ERROR, "Could not get utf8 from asn1 string.");
360
368
  result = TSI_INTERNAL_ERROR;
@@ -703,8 +711,8 @@ static tsi_result populate_ssl_context(
703
711
  }
704
712
 
705
713
  /* Extracts the CN and the SANs from an X509 cert as a peer object. */
706
- static tsi_result extract_x509_subject_names_from_pem_cert(const char* pem_cert,
707
- tsi_peer* peer) {
714
+ tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert(
715
+ const char* pem_cert, tsi_peer* peer) {
708
716
  tsi_result result = TSI_OK;
709
717
  X509* cert = nullptr;
710
718
  BIO* pem;
@@ -1882,7 +1890,7 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
1882
1890
  }
1883
1891
  /* TODO(jboeuf): Add revocation verification. */
1884
1892
 
1885
- result = extract_x509_subject_names_from_pem_cert(
1893
+ result = tsi_ssl_extract_x509_subject_names_from_pem_cert(
1886
1894
  options->pem_key_cert_pairs[i].cert_chain,
1887
1895
  &impl->ssl_context_x509_subject_names[i]);
1888
1896
  if (result != TSI_OK) break;
@@ -332,4 +332,8 @@ const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable(
332
332
  tsi_ssl_handshaker_factory* factory,
333
333
  tsi_ssl_handshaker_factory_vtable* new_vtable);
334
334
 
335
+ /* Exposed for testing only. */
336
+ tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert(
337
+ const char* pem_cert, tsi_peer* peer);
338
+
335
339
  #endif /* GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H */
@@ -0,0 +1 @@
1
+ _Init_grpc_c
@@ -0,0 +1,6 @@
1
+ grpc_1.0 {
2
+ global:
3
+ Init_grpc_c;
4
+ local:
5
+ *;
6
+ };
@@ -60,6 +60,11 @@ unless windows
60
60
  end
61
61
 
62
62
  $CFLAGS << ' -I' + File.join(grpc_root, 'include')
63
+
64
+ ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', 'ext-export')
65
+ $LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if RUBY_PLATFORM =~ /linux/
66
+ $LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"' if RUBY_PLATFORM =~ /darwin/
67
+
63
68
  $LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows
64
69
  if grpc_config == 'gcov'
65
70
  $CFLAGS << ' -O0 -fprofile-arcs -ftest-coverage'
@@ -0,0 +1,22 @@
1
+ /*
2
+ *
3
+ * Copyright 2019 gRPC authors.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ *
17
+ */
18
+
19
+ #include <ruby/ruby.h>
20
+
21
+ // This is a dummy C++ source file to trigger ruby extension builder to
22
+ // pick C++ rather than C linker to link with c++ library properly.
@@ -155,45 +155,6 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) {
155
155
  return t;
156
156
  }
157
157
 
158
- static void Init_grpc_status_codes() {
159
- /* Constants representing the status codes or grpc_status_code in status.h */
160
- VALUE grpc_rb_mStatusCodes =
161
- rb_define_module_under(grpc_rb_mGrpcCore, "StatusCodes");
162
- rb_define_const(grpc_rb_mStatusCodes, "OK", INT2NUM(GRPC_STATUS_OK));
163
- rb_define_const(grpc_rb_mStatusCodes, "CANCELLED",
164
- INT2NUM(GRPC_STATUS_CANCELLED));
165
- rb_define_const(grpc_rb_mStatusCodes, "UNKNOWN",
166
- INT2NUM(GRPC_STATUS_UNKNOWN));
167
- rb_define_const(grpc_rb_mStatusCodes, "INVALID_ARGUMENT",
168
- INT2NUM(GRPC_STATUS_INVALID_ARGUMENT));
169
- rb_define_const(grpc_rb_mStatusCodes, "DEADLINE_EXCEEDED",
170
- INT2NUM(GRPC_STATUS_DEADLINE_EXCEEDED));
171
- rb_define_const(grpc_rb_mStatusCodes, "NOT_FOUND",
172
- INT2NUM(GRPC_STATUS_NOT_FOUND));
173
- rb_define_const(grpc_rb_mStatusCodes, "ALREADY_EXISTS",
174
- INT2NUM(GRPC_STATUS_ALREADY_EXISTS));
175
- rb_define_const(grpc_rb_mStatusCodes, "PERMISSION_DENIED",
176
- INT2NUM(GRPC_STATUS_PERMISSION_DENIED));
177
- rb_define_const(grpc_rb_mStatusCodes, "UNAUTHENTICATED",
178
- INT2NUM(GRPC_STATUS_UNAUTHENTICATED));
179
- rb_define_const(grpc_rb_mStatusCodes, "RESOURCE_EXHAUSTED",
180
- INT2NUM(GRPC_STATUS_RESOURCE_EXHAUSTED));
181
- rb_define_const(grpc_rb_mStatusCodes, "FAILED_PRECONDITION",
182
- INT2NUM(GRPC_STATUS_FAILED_PRECONDITION));
183
- rb_define_const(grpc_rb_mStatusCodes, "ABORTED",
184
- INT2NUM(GRPC_STATUS_ABORTED));
185
- rb_define_const(grpc_rb_mStatusCodes, "OUT_OF_RANGE",
186
- INT2NUM(GRPC_STATUS_OUT_OF_RANGE));
187
- rb_define_const(grpc_rb_mStatusCodes, "UNIMPLEMENTED",
188
- INT2NUM(GRPC_STATUS_UNIMPLEMENTED));
189
- rb_define_const(grpc_rb_mStatusCodes, "INTERNAL",
190
- INT2NUM(GRPC_STATUS_INTERNAL));
191
- rb_define_const(grpc_rb_mStatusCodes, "UNAVAILABLE",
192
- INT2NUM(GRPC_STATUS_UNAVAILABLE));
193
- rb_define_const(grpc_rb_mStatusCodes, "DATA_LOSS",
194
- INT2NUM(GRPC_STATUS_DATA_LOSS));
195
- }
196
-
197
158
  /* id_at is the constructor method of the ruby standard Time class. */
198
159
  static ID id_at;
199
160
 
@@ -351,8 +312,7 @@ void Init_grpc_c() {
351
312
  grpc_rb_mGrpcCore = rb_define_module_under(grpc_rb_mGRPC, "Core");
352
313
  grpc_rb_sNewServerRpc = rb_struct_define(
353
314
  "NewServerRpc", "method", "host", "deadline", "metadata", "call", NULL);
354
- grpc_rb_sStatus =
355
- rb_struct_define("Status", "code", "details", "metadata", NULL);
315
+ grpc_rb_sStatus = rb_const_get(rb_cStruct, rb_intern("Status"));
356
316
  sym_code = ID2SYM(rb_intern("code"));
357
317
  sym_details = ID2SYM(rb_intern("details"));
358
318
  sym_metadata = ID2SYM(rb_intern("metadata"));
@@ -363,7 +323,6 @@ void Init_grpc_c() {
363
323
  Init_grpc_channel_credentials();
364
324
  Init_grpc_server();
365
325
  Init_grpc_server_credentials();
366
- Init_grpc_status_codes();
367
326
  Init_grpc_time_consts();
368
327
  Init_grpc_compression_options();
369
328
  }
@@ -164,6 +164,8 @@ grpc_tls_credentials_options_set_credential_reload_config_type grpc_tls_credenti
164
164
  grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls_credentials_options_set_server_authorization_check_config_import;
165
165
  grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_create_import;
166
166
  grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import;
167
+ grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import;
168
+ grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import;
167
169
  grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import;
168
170
  grpc_tls_server_authorization_check_config_create_type grpc_tls_server_authorization_check_config_create_import;
169
171
  grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import;
@@ -435,6 +437,8 @@ void grpc_rb_load_imports(HMODULE library) {
435
437
  grpc_tls_credentials_options_set_server_authorization_check_config_import = (grpc_tls_credentials_options_set_server_authorization_check_config_type) GetProcAddress(library, "grpc_tls_credentials_options_set_server_authorization_check_config");
436
438
  grpc_tls_key_materials_config_create_import = (grpc_tls_key_materials_config_create_type) GetProcAddress(library, "grpc_tls_key_materials_config_create");
437
439
  grpc_tls_key_materials_config_set_key_materials_import = (grpc_tls_key_materials_config_set_key_materials_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_key_materials");
440
+ grpc_tls_key_materials_config_set_version_import = (grpc_tls_key_materials_config_set_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_version");
441
+ grpc_tls_key_materials_config_get_version_import = (grpc_tls_key_materials_config_get_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_get_version");
438
442
  grpc_tls_credential_reload_config_create_import = (grpc_tls_credential_reload_config_create_type) GetProcAddress(library, "grpc_tls_credential_reload_config_create");
439
443
  grpc_tls_server_authorization_check_config_create_import = (grpc_tls_server_authorization_check_config_create_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_create");
440
444
  grpc_raw_byte_buffer_create_import = (grpc_raw_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_byte_buffer_create");
@@ -467,6 +467,12 @@ extern grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_c
467
467
  typedef int(*grpc_tls_key_materials_config_set_key_materials_type)(grpc_tls_key_materials_config* config, const char* pem_root_certs, const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs, size_t num_key_cert_pairs);
468
468
  extern grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import;
469
469
  #define grpc_tls_key_materials_config_set_key_materials grpc_tls_key_materials_config_set_key_materials_import
470
+ typedef int(*grpc_tls_key_materials_config_set_version_type)(grpc_tls_key_materials_config* config, int version);
471
+ extern grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import;
472
+ #define grpc_tls_key_materials_config_set_version grpc_tls_key_materials_config_set_version_import
473
+ typedef int(*grpc_tls_key_materials_config_get_version_type)(grpc_tls_key_materials_config* config);
474
+ extern grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import;
475
+ #define grpc_tls_key_materials_config_get_version grpc_tls_key_materials_config_get_version_import
470
476
  typedef grpc_tls_credential_reload_config*(*grpc_tls_credential_reload_config_create_type)(const void* config_user_data, int (*schedule)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*cancel)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*destruct)(void* config_user_data));
471
477
  extern grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import;
472
478
  #define grpc_tls_credential_reload_config_create grpc_tls_credential_reload_config_create_import