grpc 1.3.4 → 1.4.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 (286) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +581 -450
  3. data/include/grpc/census.h +49 -49
  4. data/include/grpc/grpc.h +16 -70
  5. data/include/grpc/grpc_security.h +59 -59
  6. data/include/grpc/grpc_security_constants.h +9 -9
  7. data/include/grpc/impl/codegen/atm.h +1 -1
  8. data/include/grpc/impl/codegen/atm_windows.h +4 -4
  9. data/include/grpc/impl/codegen/byte_buffer_reader.h +2 -2
  10. data/include/grpc/impl/codegen/compression_types.h +4 -5
  11. data/include/grpc/impl/codegen/gpr_slice.h +5 -5
  12. data/include/grpc/impl/codegen/gpr_types.h +6 -7
  13. data/include/grpc/impl/codegen/grpc_types.h +128 -59
  14. data/include/grpc/impl/codegen/port_platform.h +6 -0
  15. data/include/grpc/impl/codegen/propagation_bits.h +2 -2
  16. data/include/grpc/impl/codegen/slice.h +13 -12
  17. data/include/grpc/impl/codegen/status.h +23 -18
  18. data/include/grpc/impl/codegen/sync.h +1 -1
  19. data/include/grpc/load_reporting.h +6 -6
  20. data/include/grpc/slice.h +47 -25
  21. data/include/grpc/slice_buffer.h +18 -14
  22. data/include/grpc/support/alloc.h +7 -7
  23. data/include/grpc/support/cmdline.h +10 -10
  24. data/include/grpc/support/cpu.h +3 -3
  25. data/include/grpc/support/histogram.h +1 -1
  26. data/include/grpc/support/host_port.h +2 -2
  27. data/include/grpc/support/log.h +9 -9
  28. data/include/grpc/support/log_windows.h +1 -1
  29. data/include/grpc/support/string_util.h +3 -3
  30. data/include/grpc/support/subprocess.h +3 -3
  31. data/include/grpc/support/sync.h +31 -31
  32. data/include/grpc/support/thd.h +11 -11
  33. data/include/grpc/support/time.h +12 -12
  34. data/include/grpc/support/tls.h +1 -1
  35. data/include/grpc/support/tls_gcc.h +2 -2
  36. data/include/grpc/support/tls_msvc.h +1 -1
  37. data/include/grpc/support/tls_pthread.h +1 -1
  38. data/include/grpc/support/useful.h +2 -2
  39. data/include/grpc/support/workaround_list.h +46 -0
  40. data/src/core/ext/census/context.c +1 -1
  41. data/src/core/ext/census/intrusive_hash_map.c +319 -0
  42. data/src/core/ext/census/intrusive_hash_map.h +167 -0
  43. data/src/core/ext/census/intrusive_hash_map_internal.h +63 -0
  44. data/src/core/ext/census/resource.c +3 -1
  45. data/src/core/ext/filters/client_channel/channel_connectivity.c +1 -1
  46. data/src/core/ext/filters/client_channel/client_channel.c +173 -103
  47. data/src/core/ext/filters/client_channel/client_channel_plugin.c +3 -2
  48. data/src/core/ext/filters/client_channel/lb_policy.c +2 -1
  49. data/src/core/ext/filters/client_channel/lb_policy.h +8 -7
  50. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c +153 -0
  51. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +42 -0
  52. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c +405 -102
  53. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c +133 -0
  54. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +65 -0
  55. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c +90 -51
  56. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +7 -1
  57. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +19 -8
  58. data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +63 -34
  59. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c +2 -1
  60. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +188 -294
  61. data/src/core/ext/filters/client_channel/lb_policy_factory.c +28 -5
  62. data/src/core/ext/filters/client_channel/lb_policy_factory.h +18 -4
  63. data/src/core/ext/filters/client_channel/parse_address.c +90 -59
  64. data/src/core/ext/filters/client_channel/parse_address.h +17 -8
  65. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c +11 -7
  66. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +59 -14
  67. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +6 -0
  68. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c +3 -3
  69. data/src/core/ext/filters/client_channel/subchannel.c +20 -17
  70. data/src/core/ext/filters/client_channel/subchannel.h +1 -0
  71. data/src/core/ext/filters/client_channel/subchannel_index.c +11 -1
  72. data/src/core/ext/filters/client_channel/uri_parser.c +36 -22
  73. data/src/core/ext/filters/client_channel/uri_parser.h +1 -1
  74. data/src/core/{lib/channel → ext/filters/deadline}/deadline_filter.c +42 -17
  75. data/src/core/{lib/channel → ext/filters/deadline}/deadline_filter.h +8 -9
  76. data/src/core/{lib/channel → ext/filters/http/client}/http_client_filter.c +19 -11
  77. data/src/core/{lib/channel → ext/filters/http/client}/http_client_filter.h +3 -6
  78. data/src/core/ext/filters/http/http_filters_plugin.c +104 -0
  79. data/src/core/{lib/channel/compress_filter.c → ext/filters/http/message_compress/message_compress_filter.c} +124 -23
  80. data/src/core/{lib/channel/compress_filter.h → ext/filters/http/message_compress/message_compress_filter.h} +5 -6
  81. data/src/core/{lib/channel → ext/filters/http/server}/http_server_filter.c +4 -6
  82. data/src/core/{lib/channel → ext/filters/http/server}/http_server_filter.h +3 -3
  83. data/src/core/ext/filters/load_reporting/load_reporting.c +2 -25
  84. data/src/core/ext/filters/load_reporting/load_reporting_filter.c +26 -1
  85. data/src/core/ext/filters/max_age/max_age_filter.c +14 -14
  86. data/src/core/{lib/channel → ext/filters/message_size}/message_size_filter.c +91 -47
  87. data/src/core/{lib/channel → ext/filters/message_size}/message_size_filter.h +3 -3
  88. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c +223 -0
  89. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +40 -0
  90. data/src/core/ext/filters/workarounds/workaround_utils.c +65 -0
  91. data/src/core/ext/filters/workarounds/workaround_utils.h +52 -0
  92. data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +1 -1
  93. data/src/core/ext/transport/chttp2/server/chttp2_server.c +3 -2
  94. data/src/core/ext/transport/chttp2/transport/bin_decoder.c +2 -2
  95. data/src/core/ext/transport/chttp2/transport/bin_encoder.c +3 -3
  96. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +319 -175
  97. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -2
  98. data/src/core/ext/transport/chttp2/transport/frame_data.c +203 -164
  99. data/src/core/ext/transport/chttp2/transport/frame_data.h +8 -14
  100. data/src/core/ext/transport/chttp2/transport/frame_goaway.c +1 -1
  101. data/src/core/ext/transport/chttp2/transport/frame_ping.c +1 -1
  102. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +1 -1
  103. data/src/core/ext/transport/chttp2/transport/frame_settings.c +5 -5
  104. data/src/core/ext/transport/chttp2/transport/frame_window_update.c +1 -1
  105. data/src/core/ext/transport/chttp2/transport/hpack_encoder.c +4 -4
  106. data/src/core/ext/transport/chttp2/transport/hpack_parser.c +2 -4
  107. data/src/core/ext/transport/chttp2/transport/hpack_table.c +4 -3
  108. data/src/core/ext/transport/chttp2/transport/internal.h +50 -33
  109. data/src/core/ext/transport/chttp2/transport/parsing.c +10 -11
  110. data/src/core/ext/transport/chttp2/transport/writing.c +32 -13
  111. data/src/core/lib/channel/channel_args.c +30 -9
  112. data/src/core/lib/channel/channel_args.h +5 -1
  113. data/src/core/lib/channel/channel_stack.c +1 -1
  114. data/src/core/lib/channel/channel_stack.h +2 -2
  115. data/src/core/lib/channel/channel_stack_builder.c +13 -1
  116. data/src/core/lib/channel/channel_stack_builder.h +5 -1
  117. data/src/core/lib/channel/connected_channel.c +3 -1
  118. data/src/core/lib/channel/context.h +2 -2
  119. data/src/core/lib/compression/message_compress.c +2 -2
  120. data/src/core/lib/debug/trace.c +13 -6
  121. data/src/core/lib/debug/trace.h +27 -1
  122. data/src/core/lib/http/httpcli.c +1 -1
  123. data/src/core/lib/http/httpcli_security_connector.c +9 -11
  124. data/src/core/lib/http/parser.c +2 -2
  125. data/src/core/lib/http/parser.h +2 -1
  126. data/src/core/lib/iomgr/combiner.c +6 -6
  127. data/src/core/lib/iomgr/combiner.h +2 -1
  128. data/src/core/lib/iomgr/error.c +12 -5
  129. data/src/core/lib/iomgr/error.h +13 -13
  130. data/src/core/lib/iomgr/ev_epoll1_linux.c +984 -0
  131. data/src/core/lib/iomgr/ev_epoll1_linux.h +44 -0
  132. data/src/core/lib/iomgr/ev_epoll_limited_pollers_linux.c +2146 -0
  133. data/src/core/lib/iomgr/ev_epoll_limited_pollers_linux.h +43 -0
  134. data/src/core/lib/iomgr/ev_epoll_thread_pool_linux.c +1337 -0
  135. data/src/core/lib/iomgr/ev_epoll_thread_pool_linux.h +43 -0
  136. data/src/core/lib/iomgr/ev_epollex_linux.c +1511 -0
  137. data/src/core/lib/iomgr/ev_epollex_linux.h +43 -0
  138. data/src/core/lib/iomgr/{ev_epoll_linux.c → ev_epollsig_linux.c} +41 -33
  139. data/src/core/lib/iomgr/{ev_epoll_linux.h → ev_epollsig_linux.h} +4 -4
  140. data/src/core/lib/iomgr/ev_poll_posix.c +12 -27
  141. data/src/core/lib/iomgr/ev_poll_posix.h +2 -2
  142. data/src/core/lib/iomgr/ev_posix.c +22 -8
  143. data/src/core/lib/iomgr/ev_posix.h +4 -3
  144. data/src/core/lib/iomgr/ev_windows.c +43 -0
  145. data/src/core/lib/iomgr/exec_ctx.c +5 -0
  146. data/src/core/lib/iomgr/exec_ctx.h +2 -0
  147. data/src/core/lib/iomgr/iomgr.c +4 -0
  148. data/src/core/lib/iomgr/iomgr.h +3 -0
  149. data/src/core/lib/iomgr/is_epollexclusive_available.c +116 -0
  150. data/src/core/lib/iomgr/is_epollexclusive_available.h +41 -0
  151. data/src/core/lib/iomgr/lockfree_event.c +16 -0
  152. data/src/core/lib/iomgr/pollset.h +2 -5
  153. data/src/core/lib/iomgr/pollset_uv.c +1 -1
  154. data/src/core/lib/iomgr/pollset_windows.c +3 -3
  155. data/src/core/lib/iomgr/resource_quota.c +9 -8
  156. data/src/core/lib/iomgr/resource_quota.h +2 -1
  157. data/src/core/lib/iomgr/sockaddr_utils.h +1 -1
  158. data/src/core/lib/iomgr/socket_mutator.h +2 -0
  159. data/src/core/lib/iomgr/sys_epoll_wrapper.h +43 -0
  160. data/src/core/lib/iomgr/tcp_client_posix.c +6 -6
  161. data/src/core/lib/iomgr/tcp_client_uv.c +3 -3
  162. data/src/core/lib/iomgr/tcp_posix.c +7 -7
  163. data/src/core/lib/iomgr/tcp_posix.h +2 -1
  164. data/src/core/lib/iomgr/tcp_server_posix.c +1 -1
  165. data/src/core/lib/iomgr/tcp_uv.c +6 -6
  166. data/src/core/lib/iomgr/tcp_uv.h +2 -1
  167. data/src/core/lib/iomgr/tcp_windows.c +1 -1
  168. data/src/core/lib/iomgr/timer_generic.c +24 -25
  169. data/src/core/lib/iomgr/timer_manager.c +276 -0
  170. data/src/core/lib/iomgr/timer_manager.h +52 -0
  171. data/src/core/lib/iomgr/timer_uv.c +6 -0
  172. data/src/core/lib/iomgr/udp_server.c +42 -9
  173. data/src/core/lib/iomgr/udp_server.h +3 -1
  174. data/src/core/lib/security/credentials/credentials.c +0 -1
  175. data/src/core/lib/security/credentials/fake/fake_credentials.c +23 -0
  176. data/src/core/lib/security/credentials/fake/fake_credentials.h +12 -9
  177. data/src/core/lib/security/credentials/google_default/google_default_credentials.c +1 -1
  178. data/src/core/lib/security/credentials/jwt/jwt_credentials.c +1 -1
  179. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +1 -1
  180. data/src/core/lib/security/credentials/ssl/ssl_credentials.c +24 -53
  181. data/src/core/lib/security/transport/client_auth_filter.c +9 -3
  182. data/src/core/lib/security/transport/secure_endpoint.c +7 -7
  183. data/src/core/lib/security/transport/secure_endpoint.h +1 -1
  184. data/src/core/lib/security/transport/security_connector.c +45 -57
  185. data/src/core/lib/security/transport/security_connector.h +10 -14
  186. data/src/core/lib/security/transport/security_handshaker.c +123 -97
  187. data/src/core/lib/slice/b64.c +1 -1
  188. data/src/core/lib/slice/percent_encoding.c +3 -3
  189. data/src/core/lib/slice/slice.c +66 -33
  190. data/src/core/lib/slice/slice_buffer.c +25 -6
  191. data/src/core/lib/slice/slice_hash_table.c +33 -35
  192. data/src/core/lib/slice/slice_hash_table.h +7 -12
  193. data/src/core/lib/support/atomic.h +45 -0
  194. data/src/core/lib/support/atomic_with_atm.h +70 -0
  195. data/src/core/lib/support/atomic_with_std.h +48 -0
  196. data/src/core/lib/support/avl.c +14 -14
  197. data/src/core/lib/support/cmdline.c +3 -3
  198. data/src/core/lib/support/histogram.c +2 -2
  199. data/src/core/lib/support/host_port.c +1 -1
  200. data/src/core/lib/support/memory.h +74 -0
  201. data/src/core/lib/support/mpscq.c +36 -2
  202. data/src/core/lib/support/mpscq.h +28 -1
  203. data/src/core/lib/support/stack_lockfree.c +3 -36
  204. data/src/core/lib/support/string.c +12 -12
  205. data/src/core/lib/support/string_posix.c +1 -1
  206. data/src/core/lib/support/subprocess_posix.c +2 -2
  207. data/src/core/lib/support/thd_posix.c +1 -1
  208. data/src/core/lib/support/time_posix.c +8 -0
  209. data/src/core/lib/support/tmpfile_posix.c +10 -10
  210. data/src/core/lib/surface/alarm.c +3 -1
  211. data/src/core/lib/surface/api_trace.c +2 -1
  212. data/src/core/lib/surface/api_trace.h +2 -2
  213. data/src/core/lib/surface/byte_buffer_reader.c +1 -1
  214. data/src/core/lib/surface/call.c +65 -22
  215. data/src/core/lib/surface/call.h +4 -2
  216. data/src/core/lib/surface/channel_init.c +2 -19
  217. data/src/core/lib/surface/channel_stack_type.c +18 -0
  218. data/src/core/lib/surface/channel_stack_type.h +2 -0
  219. data/src/core/lib/surface/completion_queue.c +694 -247
  220. data/src/core/lib/surface/completion_queue.h +30 -13
  221. data/src/core/lib/surface/completion_queue_factory.c +24 -9
  222. data/src/core/lib/surface/init.c +1 -52
  223. data/src/core/lib/surface/{lame_client.c → lame_client.cc} +37 -26
  224. data/src/core/lib/surface/server.c +79 -110
  225. data/src/core/lib/surface/server.h +2 -1
  226. data/src/core/lib/surface/version.c +2 -2
  227. data/src/core/lib/transport/bdp_estimator.c +25 -9
  228. data/src/core/lib/transport/bdp_estimator.h +7 -1
  229. data/src/core/lib/transport/byte_stream.c +23 -9
  230. data/src/core/lib/transport/byte_stream.h +15 -6
  231. data/src/core/lib/transport/connectivity_state.c +6 -6
  232. data/src/core/lib/transport/connectivity_state.h +2 -1
  233. data/src/core/lib/transport/service_config.c +6 -13
  234. data/src/core/lib/transport/service_config.h +2 -2
  235. data/src/core/lib/transport/static_metadata.c +403 -389
  236. data/src/core/lib/transport/static_metadata.h +127 -114
  237. data/src/core/plugin_registry/grpc_plugin_registry.c +16 -0
  238. data/src/core/tsi/fake_transport_security.c +5 -4
  239. data/src/core/tsi/ssl_transport_security.c +71 -82
  240. data/src/core/tsi/ssl_transport_security.h +39 -61
  241. data/src/core/tsi/transport_security.c +83 -2
  242. data/src/core/tsi/transport_security.h +27 -2
  243. data/src/core/tsi/transport_security_adapter.c +236 -0
  244. data/src/core/tsi/transport_security_adapter.h +62 -0
  245. data/src/core/tsi/transport_security_interface.h +179 -66
  246. data/src/ruby/ext/grpc/extconf.rb +2 -1
  247. data/src/ruby/ext/grpc/rb_byte_buffer.c +8 -6
  248. data/src/ruby/ext/grpc/rb_call.c +56 -48
  249. data/src/ruby/ext/grpc/rb_call.h +3 -4
  250. data/src/ruby/ext/grpc/rb_call_credentials.c +23 -22
  251. data/src/ruby/ext/grpc/rb_channel.c +2 -3
  252. data/src/ruby/ext/grpc/rb_channel_args.c +11 -9
  253. data/src/ruby/ext/grpc/rb_channel_credentials.c +16 -12
  254. data/src/ruby/ext/grpc/rb_completion_queue.c +7 -9
  255. data/src/ruby/ext/grpc/rb_compression_options.c +7 -6
  256. data/src/ruby/ext/grpc/rb_event_thread.c +10 -12
  257. data/src/ruby/ext/grpc/rb_event_thread.h +1 -2
  258. data/src/ruby/ext/grpc/rb_grpc.c +11 -15
  259. data/src/ruby/ext/grpc/rb_grpc.h +2 -2
  260. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +16 -6
  261. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +25 -10
  262. data/src/ruby/ext/grpc/rb_server.c +26 -28
  263. data/src/ruby/lib/grpc/grpc.rb +1 -1
  264. data/src/ruby/lib/grpc/version.rb +1 -1
  265. data/third_party/cares/config_linux/ares_config.h +36 -2
  266. data/third_party/zlib/adler32.c +14 -7
  267. data/third_party/zlib/compress.c +24 -18
  268. data/third_party/zlib/crc32.c +29 -12
  269. data/third_party/zlib/deflate.c +499 -303
  270. data/third_party/zlib/deflate.h +19 -16
  271. data/third_party/zlib/gzguts.h +16 -7
  272. data/third_party/zlib/gzlib.c +17 -14
  273. data/third_party/zlib/gzread.c +108 -48
  274. data/third_party/zlib/gzwrite.c +210 -122
  275. data/third_party/zlib/infback.c +2 -2
  276. data/third_party/zlib/inffast.c +34 -51
  277. data/third_party/zlib/inflate.c +86 -37
  278. data/third_party/zlib/inflate.h +7 -4
  279. data/third_party/zlib/inftrees.c +12 -14
  280. data/third_party/zlib/trees.c +38 -61
  281. data/third_party/zlib/uncompr.c +66 -32
  282. data/third_party/zlib/zconf.h +32 -9
  283. data/third_party/zlib/zlib.h +298 -154
  284. data/third_party/zlib/zutil.c +25 -24
  285. data/third_party/zlib/zutil.h +35 -17
  286. metadata +63 -30
@@ -31,7 +31,7 @@
31
31
  *
32
32
  */
33
33
 
34
- /* RPC-internal Census API's. These are designed to be generic enough that
34
+ /** RPC-internal Census API's. These are designed to be generic enough that
35
35
  * they can (ultimately) be used in many different RPC systems (with differing
36
36
  * implementations). */
37
37
 
@@ -44,12 +44,12 @@
44
44
  extern "C" {
45
45
  #endif
46
46
 
47
- /* Identify census features that can be enabled via census_initialize(). */
47
+ /** Identify census features that can be enabled via census_initialize(). */
48
48
  enum census_features {
49
- CENSUS_FEATURE_NONE = 0, /* Do not enable census. */
50
- CENSUS_FEATURE_TRACING = 1, /* Enable census tracing. */
51
- CENSUS_FEATURE_STATS = 2, /* Enable Census stats collection. */
52
- CENSUS_FEATURE_CPU = 4, /* Enable Census CPU usage collection. */
49
+ CENSUS_FEATURE_NONE = 0, /** Do not enable census. */
50
+ CENSUS_FEATURE_TRACING = 1, /** Enable census tracing. */
51
+ CENSUS_FEATURE_STATS = 2, /** Enable Census stats collection. */
52
+ CENSUS_FEATURE_CPU = 4, /** Enable Census CPU usage collection. */
53
53
  CENSUS_FEATURE_ALL =
54
54
  CENSUS_FEATURE_TRACING | CENSUS_FEATURE_STATS | CENSUS_FEATURE_CPU
55
55
  };
@@ -82,7 +82,7 @@ CENSUSAPI int census_enabled(void);
82
82
  metrics will be recorded. Keys are unique within a context. */
83
83
  typedef struct census_context census_context;
84
84
 
85
- /* A tag is a key:value pair. Both keys and values are nil-terminated strings,
85
+ /** A tag is a key:value pair. Both keys and values are nil-terminated strings,
86
86
  containing printable ASCII characters (decimal 32-126). Keys must be at
87
87
  least one character in length. Both keys and values can have at most
88
88
  CENSUS_MAX_TAG_KB_LEN characters (including the terminating nil). The
@@ -97,36 +97,36 @@ typedef struct {
97
97
  uint8_t flags;
98
98
  } census_tag;
99
99
 
100
- /* Maximum length of a tag's key or value. */
100
+ /** Maximum length of a tag's key or value. */
101
101
  #define CENSUS_MAX_TAG_KV_LEN 255
102
- /* Maximum number of propagatable tags. */
102
+ /** Maximum number of propagatable tags. */
103
103
  #define CENSUS_MAX_PROPAGATED_TAGS 255
104
104
 
105
- /* Tag flags. */
106
- #define CENSUS_TAG_PROPAGATE 1 /* Tag should be propagated over RPC */
107
- #define CENSUS_TAG_STATS 2 /* Tag will be used for statistics aggregation */
108
- #define CENSUS_TAG_RESERVED 4 /* Reserved for internal use. */
109
- /* Flag values 4,8,16,32,64,128 are reserved for future/internal use. Clients
105
+ /** Tag flags. */
106
+ #define CENSUS_TAG_PROPAGATE 1 /** Tag should be propagated over RPC */
107
+ #define CENSUS_TAG_STATS 2 /** Tag will be used for statistics aggregation */
108
+ #define CENSUS_TAG_RESERVED 4 /** Reserved for internal use. */
109
+ /** Flag values 4,8,16,32,64,128 are reserved for future/internal use. Clients
110
110
  should not use or rely on their values. */
111
111
 
112
112
  #define CENSUS_TAG_IS_PROPAGATED(flags) (flags & CENSUS_TAG_PROPAGATE)
113
113
  #define CENSUS_TAG_IS_STATS(flags) (flags & CENSUS_TAG_STATS)
114
114
 
115
- /* An instance of this structure is kept by every context, and records the
115
+ /** An instance of this structure is kept by every context, and records the
116
116
  basic information associated with the creation of that context. */
117
117
  typedef struct {
118
- int n_propagated_tags; /* number of propagated tags */
119
- int n_local_tags; /* number of non-propagated (local) tags */
120
- int n_deleted_tags; /* number of tags that were deleted */
121
- int n_added_tags; /* number of tags that were added */
122
- int n_modified_tags; /* number of tags that were modified */
123
- int n_invalid_tags; /* number of tags with bad keys or values (e.g.
118
+ int n_propagated_tags; /** number of propagated tags */
119
+ int n_local_tags; /** number of non-propagated (local) tags */
120
+ int n_deleted_tags; /** number of tags that were deleted */
121
+ int n_added_tags; /** number of tags that were added */
122
+ int n_modified_tags; /** number of tags that were modified */
123
+ int n_invalid_tags; /** number of tags with bad keys or values (e.g.
124
124
  longer than CENSUS_MAX_TAG_KV_LEN) */
125
- int n_ignored_tags; /* number of tags ignored because of
125
+ int n_ignored_tags; /** number of tags ignored because of
126
126
  CENSUS_MAX_PROPAGATED_TAGS limit. */
127
127
  } census_context_status;
128
128
 
129
- /* Create a new context, adding and removing tags from an existing context.
129
+ /** Create a new context, adding and removing tags from an existing context.
130
130
  This will copy all tags from the 'tags' input, so it is recommended
131
131
  to add as many tags in a single operation as is practical for the client.
132
132
  @param base Base context to build upon. Can be NULL.
@@ -148,15 +148,15 @@ CENSUSAPI census_context *census_context_create(
148
148
  const census_context *base, const census_tag *tags, int ntags,
149
149
  census_context_status const **status);
150
150
 
151
- /* Destroy a context. Once this function has been called, the context cannot
151
+ /** Destroy a context. Once this function has been called, the context cannot
152
152
  be reused. */
153
153
  CENSUSAPI void census_context_destroy(census_context *context);
154
154
 
155
- /* Get a pointer to the original status from the context creation. */
155
+ /** Get a pointer to the original status from the context creation. */
156
156
  CENSUSAPI const census_context_status *census_context_get_status(
157
157
  const census_context *context);
158
158
 
159
- /* Structure used for iterating over the tags in a context. API clients should
159
+ /** Structure used for iterating over the tags in a context. API clients should
160
160
  not use or reference internal fields - neither their contents or
161
161
  presence/absence are guaranteed. */
162
162
  typedef struct {
@@ -166,25 +166,25 @@ typedef struct {
166
166
  char *kvm;
167
167
  } census_context_iterator;
168
168
 
169
- /* Initialize a census_tag_iterator. Must be called before first use. */
169
+ /** Initialize a census_tag_iterator. Must be called before first use. */
170
170
  CENSUSAPI void census_context_initialize_iterator(
171
171
  const census_context *context, census_context_iterator *iterator);
172
172
 
173
- /* Get the contents of the "next" tag in the context. If there are no more
173
+ /** Get the contents of the "next" tag in the context. If there are no more
174
174
  tags, returns 0 (and 'tag' contents will be unchanged), otherwise returns 1.
175
175
  */
176
176
  CENSUSAPI int census_context_next_tag(census_context_iterator *iterator,
177
177
  census_tag *tag);
178
178
 
179
- /* Get a context tag by key. Returns 0 if the key is not present. */
179
+ /** Get a context tag by key. Returns 0 if the key is not present. */
180
180
  CENSUSAPI int census_context_get_tag(const census_context *context,
181
181
  const char *key, census_tag *tag);
182
182
 
183
- /* Tag set encode/decode functionality. These functions are intended
183
+ /** Tag set encode/decode functionality. These functions are intended
184
184
  for use by RPC systems only, for purposes of transmitting/receiving contexts.
185
185
  */
186
186
 
187
- /* Encode a context into a buffer.
187
+ /** Encode a context into a buffer.
188
188
  @param context context to be encoded
189
189
  @param buffer buffer into which the context will be encoded.
190
190
  @param buf_size number of available bytes in buffer.
@@ -193,15 +193,15 @@ CENSUSAPI int census_context_get_tag(const census_context *context,
193
193
  CENSUSAPI size_t census_context_encode(const census_context *context,
194
194
  char *buffer, size_t buf_size);
195
195
 
196
- /* Decode context buffer encoded with census_context_encode(). Returns NULL
196
+ /** Decode context buffer encoded with census_context_encode(). Returns NULL
197
197
  if there is an error in parsing either buffer. */
198
198
  CENSUSAPI census_context *census_context_decode(const char *buffer,
199
199
  size_t size);
200
200
 
201
- /* Distributed traces can have a number of options. */
201
+ /** Distributed traces can have a number of options. */
202
202
  enum census_trace_mask_values {
203
- CENSUS_TRACE_MASK_NONE = 0, /* Default, empty flags */
204
- CENSUS_TRACE_MASK_IS_SAMPLED = 1 /* RPC tracing enabled for this context. */
203
+ CENSUS_TRACE_MASK_NONE = 0, /** Default, empty flags */
204
+ CENSUS_TRACE_MASK_IS_SAMPLED = 1 /** RPC tracing enabled for this context. */
205
205
  };
206
206
 
207
207
  /** Get the current trace mask associated with this context. The value returned
@@ -211,7 +211,7 @@ CENSUSAPI int census_trace_mask(const census_context *context);
211
211
  /** Set the trace mask associated with a context. */
212
212
  CENSUSAPI void census_set_trace_mask(int trace_mask);
213
213
 
214
- /* The concept of "operation" is a fundamental concept for Census. In an RPC
214
+ /** The concept of "operation" is a fundamental concept for Census. In an RPC
215
215
  system, an operation typically represents a single RPC, or a significant
216
216
  sub-part thereof (e.g. a single logical "read" RPC to a distributed storage
217
217
  system might do several other actions in parallel, from looking up metadata
@@ -238,7 +238,7 @@ CENSUSAPI void census_set_trace_mask(int trace_mask);
238
238
  at which an operation begins.
239
239
  */
240
240
  typedef struct {
241
- /* Use gpr_timespec for default implementation. High performance
241
+ /** Use gpr_timespec for default implementation. High performance
242
242
  * implementations should use a cycle-counter based timestamp. */
243
243
  gpr_timespec ts;
244
244
  } census_timestamp;
@@ -398,12 +398,12 @@ CENSUSAPI void census_trace_print(census_context *context, uint32_t type,
398
398
 
399
399
  /** Trace record. */
400
400
  typedef struct {
401
- census_timestamp timestamp; /* Time of record creation */
402
- uint64_t trace_id; /* Trace ID associated with record */
403
- uint64_t op_id; /* Operation ID associated with record */
404
- uint32_t type; /* Type (as used in census_trace_print() */
405
- const char *buffer; /* Buffer (from census_trace_print() */
406
- size_t buf_size; /* Number of bytes inside buffer */
401
+ census_timestamp timestamp; /** Time of record creation */
402
+ uint64_t trace_id; /** Trace ID associated with record */
403
+ uint64_t op_id; /** Operation ID associated with record */
404
+ uint32_t type; /** Type (as used in census_trace_print() */
405
+ const char *buffer; /** Buffer (from census_trace_print() */
406
+ size_t buf_size; /** Number of bytes inside buffer */
407
407
  } census_trace_record;
408
408
 
409
409
  /** Start a scan of existing trace records. While a scan is ongoing, addition
@@ -431,7 +431,7 @@ CENSUSAPI int census_get_trace_record(census_trace_record *trace_record);
431
431
  /** End a scan previously started by census_trace_scan_start() */
432
432
  CENSUSAPI void census_trace_scan_end();
433
433
 
434
- /* Core stats collection API's. The following concepts are used:
434
+ /** Core stats collection API's. The following concepts are used:
435
435
  * Resource: Users record measurements for a single resource. Examples
436
436
  include RPC latency, CPU seconds consumed, and bytes transmitted.
437
437
  * Aggregation: An aggregation of a set of measurements. Census supports the
@@ -450,7 +450,7 @@ CENSUSAPI void census_trace_scan_end();
450
450
  implementations. The proto definitions can be found in src/proto/census.
451
451
  */
452
452
 
453
- /* Define a new resource. `resource_pb` should contain an encoded Resource
453
+ /** Define a new resource. `resource_pb` should contain an encoded Resource
454
454
  protobuf, `resource_pb_size` being the size of the buffer. Returns a -ve
455
455
  value on error, or a positive (>= 0) resource id (for use in
456
456
  census_delete_resource() and census_record_values()). In order to be valid, a
@@ -459,21 +459,21 @@ CENSUSAPI void census_trace_scan_end();
459
459
  CENSUSAPI int32_t census_define_resource(const uint8_t *resource_pb,
460
460
  size_t resource_pb_size);
461
461
 
462
- /* Delete a resource created by census_define_resource(). */
462
+ /** Delete a resource created by census_define_resource(). */
463
463
  CENSUSAPI void census_delete_resource(int32_t resource_id);
464
464
 
465
- /* Determine the id of a resource, given its name. returns -1 if the resource
465
+ /** Determine the id of a resource, given its name. returns -1 if the resource
466
466
  does not exist. */
467
467
  CENSUSAPI int32_t census_resource_id(const char *name);
468
468
 
469
- /* A single value to be recorded comprises two parts: an ID for the particular
469
+ /** A single value to be recorded comprises two parts: an ID for the particular
470
470
  * resource and the value to be recorded against it. */
471
471
  typedef struct {
472
472
  int32_t resource_id;
473
473
  double value;
474
474
  } census_value;
475
475
 
476
- /* Record new usage values against the given context. */
476
+ /** Record new usage values against the given context. */
477
477
  CENSUSAPI void census_record_values(census_context *context,
478
478
  census_value *values, size_t nvalues);
479
479
 
@@ -93,55 +93,6 @@ GRPCAPI const char *grpc_version_string(void);
93
93
  /** Return a string specifying what the 'g' in gRPC stands for */
94
94
  GRPCAPI const char *grpc_g_stands_for(void);
95
95
 
96
- /** Specifies the type of APIs to use to pop events from the completion queue */
97
- typedef enum {
98
- /* Events are popped out by calling grpc_completion_queue_next() API ONLY */
99
- GRPC_CQ_NEXT = 1,
100
-
101
- /* Events are popped out by calling grpc_completion_queue_pluck() API ONLY */
102
- GRPC_CQ_PLUCK
103
- } grpc_cq_completion_type;
104
-
105
- /** Completion queues internally MAY maintain a set of file descriptors in a
106
- structure called 'pollset'. This enum specifies if a completion queue has an
107
- associated pollset and any restrictions on the type of file descriptors that
108
- can be present in the pollset.
109
-
110
- I/O progress can only be made when grpc_completion_queue_next() or
111
- grpc_completion_queue_pluck() are called on the completion queue (unless the
112
- grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important
113
- to actively call these APIs */
114
- typedef enum {
115
- /** The completion queue will have an associated pollset and there is no
116
- restriction on the type of file descriptors the pollset may contain */
117
- GRPC_CQ_DEFAULT_POLLING,
118
-
119
- /* Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will
120
- not contain any 'listening file descriptors' (i.e file descriptors used to
121
- listen to incoming channels) */
122
- GRPC_CQ_NON_LISTENING,
123
-
124
- /* The completion queue will not have an associated pollset. Note that
125
- grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still be
126
- called to pop events from the completion queue; it is not required to call
127
- them actively to make I/O progress */
128
- GRPC_CQ_NON_POLLING
129
- } grpc_cq_polling_type;
130
-
131
- #define GRPC_CQ_CURRENT_VERSION 1
132
- typedef struct grpc_completion_queue_attributes {
133
- /* The version number of this structure. More fields might be added to this
134
- structure in future. */
135
- int version; /* Set to GRPC_CQ_CURRENT_VERSION */
136
-
137
- grpc_cq_completion_type cq_completion_type;
138
-
139
- grpc_cq_polling_type cq_polling_type;
140
- } grpc_completion_queue_attributes;
141
-
142
- /** The completion queue factory structure is opaque to the callers of grpc */
143
- typedef struct grpc_completion_queue_factory grpc_completion_queue_factory;
144
-
145
96
  /** Returns the completion queue factory based on the attributes. MAY return a
146
97
  NULL if no factory can be found */
147
98
  GRPCAPI const grpc_completion_queue_factory *
@@ -159,7 +110,9 @@ GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_pluck(
159
110
  void *reserved);
160
111
 
161
112
  /** Create a completion queue */
162
- GRPCAPI grpc_completion_queue *grpc_completion_queue_create(void *reserved);
113
+ GRPCAPI grpc_completion_queue *grpc_completion_queue_create(
114
+ const grpc_completion_queue_factory *factory,
115
+ const grpc_completion_queue_attributes *attributes, void *reserved);
163
116
 
164
117
  /** Blocks until an event is available, the completion queue is being shut down,
165
118
  or deadline is reached.
@@ -269,6 +222,10 @@ GRPCAPI grpc_call *grpc_channel_create_registered_call(
269
222
  grpc_completion_queue *completion_queue, void *registered_call_handle,
270
223
  gpr_timespec deadline, void *reserved);
271
224
 
225
+ /** Allocate memory in the grpc_call arena: this memory is automatically
226
+ discarded at call completion */
227
+ GRPCAPI void *grpc_call_arena_alloc(grpc_call *call, size_t size);
228
+
272
229
  /** Start a batch of operations defined in the array ops; when complete, post a
273
230
  completion of type 'tag' to the completion queue bound to the call.
274
231
  The order of ops specified in the batch has no significance.
@@ -300,12 +257,6 @@ GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call *call,
300
257
  functionality. Instead, use grpc_auth_context. */
301
258
  GRPCAPI char *grpc_call_get_peer(grpc_call *call);
302
259
 
303
- struct grpc_load_reporting_cost_context;
304
-
305
- /* Associate costs contained in \a cost_context to \a call. */
306
- GRPCAPI void grpc_call_set_load_reporting_cost_context(
307
- grpc_call *call, struct grpc_load_reporting_cost_context *context);
308
-
309
260
  struct census_context;
310
261
 
311
262
  /** Set census context for a call; Must be called before first call to
@@ -342,7 +293,7 @@ GRPCAPI grpc_channel *grpc_lame_client_channel_create(
342
293
  /** Close and destroy a grpc channel */
343
294
  GRPCAPI void grpc_channel_destroy(grpc_channel *channel);
344
295
 
345
- /* Error handling for grpc_call
296
+ /** Error handling for grpc_call
346
297
  Most grpc_call functions return a grpc_error. If the error is not GRPC_OK
347
298
  then the operation failed due to some unsatisfied precondition.
348
299
  If a grpc_call fails, it's guaranteed that no change to the call state
@@ -351,7 +302,7 @@ GRPCAPI void grpc_channel_destroy(grpc_channel *channel);
351
302
  /** Called by clients to cancel an RPC on the server.
352
303
  Can be called multiple times, from any thread.
353
304
  THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status
354
- are thread-safe, and can be called at any point before grpc_call_destroy
305
+ are thread-safe, and can be called at any point before grpc_call_unref
355
306
  is called.*/
356
307
  GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved);
357
308
 
@@ -366,9 +317,13 @@ GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
366
317
  const char *description,
367
318
  void *reserved);
368
319
 
369
- /** Destroy a call.
370
- THREAD SAFETY: grpc_call_destroy is thread-compatible */
371
- GRPCAPI void grpc_call_destroy(grpc_call *call);
320
+ /** Ref a call.
321
+ THREAD SAFETY: grpc_call_unref is thread-compatible */
322
+ GRPCAPI void grpc_call_ref(grpc_call *call);
323
+
324
+ /** Unref a call.
325
+ THREAD SAFETY: grpc_call_unref is thread-compatible */
326
+ GRPCAPI void grpc_call_unref(grpc_call *call);
372
327
 
373
328
  /** Request notification of a new call.
374
329
  Once a call is received, a notification tagged with \a tag_new is added to
@@ -429,15 +384,6 @@ GRPCAPI void grpc_server_register_completion_queue(grpc_server *server,
429
384
  grpc_completion_queue *cq,
430
385
  void *reserved);
431
386
 
432
- /** Register a non-listening completion queue with the server. This API is
433
- similar to grpc_server_register_completion_queue except that the server will
434
- not use this completion_queue to listen to any incoming channels.
435
-
436
- Registering a non-listening completion queue will have negative performance
437
- impact and hence this API is not recommended for production use cases. */
438
- GRPCAPI void grpc_server_register_non_listening_completion_queue(
439
- grpc_server *server, grpc_completion_queue *q, void *reserved);
440
-
441
387
  /** Add a HTTP2 over plaintext over tcp listener.
442
388
  Returns bound port number on success, 0 on failure.
443
389
  REQUIRES: server not started */
@@ -42,7 +42,7 @@
42
42
  extern "C" {
43
43
  #endif
44
44
 
45
- /* --- Authentication Context. --- */
45
+ /** --- Authentication Context. --- */
46
46
 
47
47
  typedef struct grpc_auth_context grpc_auth_context;
48
48
 
@@ -52,84 +52,84 @@ typedef struct grpc_auth_property_iterator {
52
52
  const char *name;
53
53
  } grpc_auth_property_iterator;
54
54
 
55
- /* value, if not NULL, is guaranteed to be NULL terminated. */
55
+ /** value, if not NULL, is guaranteed to be NULL terminated. */
56
56
  typedef struct grpc_auth_property {
57
57
  char *name;
58
58
  char *value;
59
59
  size_t value_length;
60
60
  } grpc_auth_property;
61
61
 
62
- /* Returns NULL when the iterator is at the end. */
62
+ /** Returns NULL when the iterator is at the end. */
63
63
  GRPCAPI const grpc_auth_property *grpc_auth_property_iterator_next(
64
64
  grpc_auth_property_iterator *it);
65
65
 
66
- /* Iterates over the auth context. */
66
+ /** Iterates over the auth context. */
67
67
  GRPCAPI grpc_auth_property_iterator
68
68
  grpc_auth_context_property_iterator(const grpc_auth_context *ctx);
69
69
 
70
- /* Gets the peer identity. Returns an empty iterator (first _next will return
70
+ /** Gets the peer identity. Returns an empty iterator (first _next will return
71
71
  NULL) if the peer is not authenticated. */
72
72
  GRPCAPI grpc_auth_property_iterator
73
73
  grpc_auth_context_peer_identity(const grpc_auth_context *ctx);
74
74
 
75
- /* Finds a property in the context. May return an empty iterator (first _next
75
+ /** Finds a property in the context. May return an empty iterator (first _next
76
76
  will return NULL) if no property with this name was found in the context. */
77
77
  GRPCAPI grpc_auth_property_iterator grpc_auth_context_find_properties_by_name(
78
78
  const grpc_auth_context *ctx, const char *name);
79
79
 
80
- /* Gets the name of the property that indicates the peer identity. Will return
80
+ /** Gets the name of the property that indicates the peer identity. Will return
81
81
  NULL if the peer is not authenticated. */
82
82
  GRPCAPI const char *grpc_auth_context_peer_identity_property_name(
83
83
  const grpc_auth_context *ctx);
84
84
 
85
- /* Returns 1 if the peer is authenticated, 0 otherwise. */
85
+ /** Returns 1 if the peer is authenticated, 0 otherwise. */
86
86
  GRPCAPI int grpc_auth_context_peer_is_authenticated(
87
87
  const grpc_auth_context *ctx);
88
88
 
89
- /* Gets the auth context from the call. Caller needs to call
89
+ /** Gets the auth context from the call. Caller needs to call
90
90
  grpc_auth_context_release on the returned context. */
91
91
  GRPCAPI grpc_auth_context *grpc_call_auth_context(grpc_call *call);
92
92
 
93
- /* Releases the auth context returned from grpc_call_auth_context. */
93
+ /** Releases the auth context returned from grpc_call_auth_context. */
94
94
  GRPCAPI void grpc_auth_context_release(grpc_auth_context *context);
95
95
 
96
- /* --
96
+ /** --
97
97
  The following auth context methods should only be called by a server metadata
98
98
  processor to set properties extracted from auth metadata.
99
99
  -- */
100
100
 
101
- /* Add a property. */
101
+ /** Add a property. */
102
102
  GRPCAPI void grpc_auth_context_add_property(grpc_auth_context *ctx,
103
103
  const char *name, const char *value,
104
104
  size_t value_length);
105
105
 
106
- /* Add a C string property. */
106
+ /** Add a C string property. */
107
107
  GRPCAPI void grpc_auth_context_add_cstring_property(grpc_auth_context *ctx,
108
108
  const char *name,
109
109
  const char *value);
110
110
 
111
- /* Sets the property name. Returns 1 if successful or 0 in case of failure
111
+ /** Sets the property name. Returns 1 if successful or 0 in case of failure
112
112
  (which means that no property with this name exists). */
113
113
  GRPCAPI int grpc_auth_context_set_peer_identity_property_name(
114
114
  grpc_auth_context *ctx, const char *name);
115
115
 
116
- /* --- grpc_channel_credentials object. ---
116
+ /** --- grpc_channel_credentials object. ---
117
117
 
118
118
  A channel credentials object represents a way to authenticate a client on a
119
119
  channel. */
120
120
 
121
121
  typedef struct grpc_channel_credentials grpc_channel_credentials;
122
122
 
123
- /* Releases a channel credentials object.
123
+ /** Releases a channel credentials object.
124
124
  The creator of the credentials object is responsible for its release. */
125
125
  GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials *creds);
126
126
 
127
- /* Creates default credentials to connect to a google gRPC service.
127
+ /** Creates default credentials to connect to a google gRPC service.
128
128
  WARNING: Do NOT use this credentials to connect to a non-google service as
129
129
  this could result in an oauth2 token leak. */
130
130
  GRPCAPI grpc_channel_credentials *grpc_google_default_credentials_create(void);
131
131
 
132
- /* Callback for getting the SSL roots override from the application.
132
+ /** Callback for getting the SSL roots override from the application.
133
133
  In case of success, *pem_roots_certs must be set to a NULL terminated string
134
134
  containing the list of PEM encoded root certificates. The ownership is passed
135
135
  to the core and freed (laster by the core) with gpr_free.
@@ -138,7 +138,7 @@ GRPCAPI grpc_channel_credentials *grpc_google_default_credentials_create(void);
138
138
  typedef grpc_ssl_roots_override_result (*grpc_ssl_roots_override_callback)(
139
139
  char **pem_root_certs);
140
140
 
141
- /* Setup a callback to override the default TLS/SSL roots.
141
+ /** Setup a callback to override the default TLS/SSL roots.
142
142
  This function is not thread-safe and must be called at initialization time
143
143
  before any ssl credentials are created to have the desired side effect.
144
144
  If GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the
@@ -146,19 +146,19 @@ typedef grpc_ssl_roots_override_result (*grpc_ssl_roots_override_callback)(
146
146
  GRPCAPI void grpc_set_ssl_roots_override_callback(
147
147
  grpc_ssl_roots_override_callback cb);
148
148
 
149
- /* Object that holds a private key / certificate chain pair in PEM format. */
149
+ /** Object that holds a private key / certificate chain pair in PEM format. */
150
150
  typedef struct {
151
- /* private_key is the NULL-terminated string containing the PEM encoding of
151
+ /** private_key is the NULL-terminated string containing the PEM encoding of
152
152
  the client's private key. */
153
153
  const char *private_key;
154
154
 
155
- /* cert_chain is the NULL-terminated string containing the PEM encoding of
155
+ /** cert_chain is the NULL-terminated string containing the PEM encoding of
156
156
  the client's certificate chain. */
157
157
  const char *cert_chain;
158
158
  } grpc_ssl_pem_key_cert_pair;
159
159
 
160
- /* Creates an SSL credentials object.
161
- - pem_roots_cert is the NULL-terminated string containing the PEM encoding
160
+ /** Creates an SSL credentials object.
161
+ - pem_root_certs is the NULL-terminated string containing the PEM encoding
162
162
  of the server root certificates. If this parameter is NULL, the
163
163
  implementation will first try to dereference the file pointed by the
164
164
  GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,
@@ -172,7 +172,7 @@ GRPCAPI grpc_channel_credentials *grpc_ssl_credentials_create(
172
172
  const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
173
173
  void *reserved);
174
174
 
175
- /* --- grpc_call_credentials object.
175
+ /** --- grpc_call_credentials object.
176
176
 
177
177
  A call credentials object represents a way to authenticate on a particular
178
178
  call. These credentials can be composed with a channel credentials object
@@ -180,21 +180,21 @@ GRPCAPI grpc_channel_credentials *grpc_ssl_credentials_create(
180
180
 
181
181
  typedef struct grpc_call_credentials grpc_call_credentials;
182
182
 
183
- /* Releases a call credentials object.
183
+ /** Releases a call credentials object.
184
184
  The creator of the credentials object is responsible for its release. */
185
185
  GRPCAPI void grpc_call_credentials_release(grpc_call_credentials *creds);
186
186
 
187
- /* Creates a composite channel credentials object. */
187
+ /** Creates a composite channel credentials object. */
188
188
  GRPCAPI grpc_channel_credentials *grpc_composite_channel_credentials_create(
189
189
  grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds,
190
190
  void *reserved);
191
191
 
192
- /* Creates a composite call credentials object. */
192
+ /** Creates a composite call credentials object. */
193
193
  GRPCAPI grpc_call_credentials *grpc_composite_call_credentials_create(
194
194
  grpc_call_credentials *creds1, grpc_call_credentials *creds2,
195
195
  void *reserved);
196
196
 
197
- /* Creates a compute engine credentials object for connecting to Google.
197
+ /** Creates a compute engine credentials object for connecting to Google.
198
198
  WARNING: Do NOT use this credentials to connect to a non-google service as
199
199
  this could result in an oauth2 token leak. */
200
200
  GRPCAPI grpc_call_credentials *grpc_google_compute_engine_credentials_create(
@@ -202,7 +202,7 @@ GRPCAPI grpc_call_credentials *grpc_google_compute_engine_credentials_create(
202
202
 
203
203
  GRPCAPI gpr_timespec grpc_max_auth_token_lifetime();
204
204
 
205
- /* Creates a JWT credentials object. May return NULL if the input is invalid.
205
+ /** Creates a JWT credentials object. May return NULL if the input is invalid.
206
206
  - json_key is the JSON key string containing the client's private key.
207
207
  - token_lifetime is the lifetime of each Json Web Token (JWT) created with
208
208
  this credentials. It should not exceed grpc_max_auth_token_lifetime or
@@ -212,7 +212,7 @@ grpc_service_account_jwt_access_credentials_create(const char *json_key,
212
212
  gpr_timespec token_lifetime,
213
213
  void *reserved);
214
214
 
215
- /* Creates an Oauth2 Refresh Token credentials object for connecting to Google.
215
+ /** Creates an Oauth2 Refresh Token credentials object for connecting to Google.
216
216
  May return NULL if the input is invalid.
217
217
  WARNING: Do NOT use this credentials to connect to a non-google service as
218
218
  this could result in an oauth2 token leak.
@@ -221,17 +221,17 @@ grpc_service_account_jwt_access_credentials_create(const char *json_key,
221
221
  GRPCAPI grpc_call_credentials *grpc_google_refresh_token_credentials_create(
222
222
  const char *json_refresh_token, void *reserved);
223
223
 
224
- /* Creates an Oauth2 Access Token credentials with an access token that was
224
+ /** Creates an Oauth2 Access Token credentials with an access token that was
225
225
  aquired by an out of band mechanism. */
226
226
  GRPCAPI grpc_call_credentials *grpc_access_token_credentials_create(
227
227
  const char *access_token, void *reserved);
228
228
 
229
- /* Creates an IAM credentials object for connecting to Google. */
229
+ /** Creates an IAM credentials object for connecting to Google. */
230
230
  GRPCAPI grpc_call_credentials *grpc_google_iam_credentials_create(
231
231
  const char *authorization_token, const char *authority_selector,
232
232
  void *reserved);
233
233
 
234
- /* Callback function to be called by the metadata credentials plugin
234
+ /** Callback function to be called by the metadata credentials plugin
235
235
  implementation when the metadata is ready.
236
236
  - user_data is the opaque pointer that was passed in the get_metadata method
237
237
  of the grpc_metadata_credentials_plugin (see below).
@@ -246,31 +246,31 @@ typedef void (*grpc_credentials_plugin_metadata_cb)(
246
246
  void *user_data, const grpc_metadata *creds_md, size_t num_creds_md,
247
247
  grpc_status_code status, const char *error_details);
248
248
 
249
- /* Context that can be used by metadata credentials plugin in order to create
249
+ /** Context that can be used by metadata credentials plugin in order to create
250
250
  auth related metadata. */
251
251
  typedef struct {
252
- /* The fully qualifed service url. */
252
+ /** The fully qualifed service url. */
253
253
  const char *service_url;
254
254
 
255
- /* The method name of the RPC being called (not fully qualified).
255
+ /** The method name of the RPC being called (not fully qualified).
256
256
  The fully qualified method name can be built from the service_url:
257
257
  full_qualified_method_name = ctx->service_url + '/' + ctx->method_name. */
258
258
  const char *method_name;
259
259
 
260
- /* The auth_context of the channel which gives the server's identity. */
260
+ /** The auth_context of the channel which gives the server's identity. */
261
261
  const grpc_auth_context *channel_auth_context;
262
262
 
263
- /* Reserved for future use. */
263
+ /** Reserved for future use. */
264
264
  void *reserved;
265
265
  } grpc_auth_metadata_context;
266
266
 
267
- /* grpc_metadata_credentials plugin is an API user provided structure used to
267
+ /** grpc_metadata_credentials plugin is an API user provided structure used to
268
268
  create grpc_credentials objects that can be set on a channel (composed) or
269
269
  a call. See grpc_credentials_metadata_create_from_plugin below.
270
270
  The grpc client stack will call the get_metadata method of the plugin for
271
271
  every call in scope for the credentials created from it. */
272
272
  typedef struct {
273
- /* The implementation of this method has to be non-blocking.
273
+ /** The implementation of this method has to be non-blocking.
274
274
  - context is the information that can be used by the plugin to create auth
275
275
  metadata.
276
276
  - cb is the callback that needs to be called when the metadata is ready.
@@ -278,39 +278,39 @@ typedef struct {
278
278
  void (*get_metadata)(void *state, grpc_auth_metadata_context context,
279
279
  grpc_credentials_plugin_metadata_cb cb, void *user_data);
280
280
 
281
- /* Destroys the plugin state. */
281
+ /** Destroys the plugin state. */
282
282
  void (*destroy)(void *state);
283
283
 
284
- /* State that will be set as the first parameter of the methods above. */
284
+ /** State that will be set as the first parameter of the methods above. */
285
285
  void *state;
286
286
 
287
- /* Type of credentials that this plugin is implementing. */
287
+ /** Type of credentials that this plugin is implementing. */
288
288
  const char *type;
289
289
  } grpc_metadata_credentials_plugin;
290
290
 
291
- /* Creates a credentials object from a plugin. */
291
+ /** Creates a credentials object from a plugin. */
292
292
  GRPCAPI grpc_call_credentials *grpc_metadata_credentials_create_from_plugin(
293
293
  grpc_metadata_credentials_plugin plugin, void *reserved);
294
294
 
295
- /* --- Secure channel creation. --- */
295
+ /** --- Secure channel creation. --- */
296
296
 
297
- /* Creates a secure channel using the passed-in credentials. */
297
+ /** Creates a secure channel using the passed-in credentials. */
298
298
  GRPCAPI grpc_channel *grpc_secure_channel_create(
299
299
  grpc_channel_credentials *creds, const char *target,
300
300
  const grpc_channel_args *args, void *reserved);
301
301
 
302
- /* --- grpc_server_credentials object. ---
302
+ /** --- grpc_server_credentials object. ---
303
303
 
304
304
  A server credentials object represents a way to authenticate a server. */
305
305
 
306
306
  typedef struct grpc_server_credentials grpc_server_credentials;
307
307
 
308
- /* Releases a server_credentials object.
308
+ /** Releases a server_credentials object.
309
309
  The creator of the server_credentials object is responsible for its release.
310
310
  */
311
311
  GRPCAPI void grpc_server_credentials_release(grpc_server_credentials *creds);
312
312
 
313
- /* Deprecated in favor of grpc_ssl_server_credentials_create_ex.
313
+ /** Deprecated in favor of grpc_ssl_server_credentials_create_ex.
314
314
  Creates an SSL server_credentials object.
315
315
  - pem_roots_cert is the NULL-terminated string containing the PEM encoding of
316
316
  the client root certificates. This parameter may be NULL if the server does
@@ -326,7 +326,7 @@ GRPCAPI grpc_server_credentials *grpc_ssl_server_credentials_create(
326
326
  const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
327
327
  size_t num_key_cert_pairs, int force_client_auth, void *reserved);
328
328
 
329
- /* Same as grpc_ssl_server_credentials_create method except uses
329
+ /** Same as grpc_ssl_server_credentials_create method except uses
330
330
  grpc_ssl_client_certificate_request_type enum to support more ways to
331
331
  authenticate client cerificates.*/
332
332
  GRPCAPI grpc_server_credentials *grpc_ssl_server_credentials_create_ex(
@@ -335,25 +335,25 @@ GRPCAPI grpc_server_credentials *grpc_ssl_server_credentials_create_ex(
335
335
  grpc_ssl_client_certificate_request_type client_certificate_request,
336
336
  void *reserved);
337
337
 
338
- /* --- Server-side secure ports. --- */
338
+ /** --- Server-side secure ports. --- */
339
339
 
340
- /* Add a HTTP2 over an encrypted link over tcp listener.
340
+ /** Add a HTTP2 over an encrypted link over tcp listener.
341
341
  Returns bound port number on success, 0 on failure.
342
342
  REQUIRES: server not started */
343
343
  GRPCAPI int grpc_server_add_secure_http2_port(grpc_server *server,
344
344
  const char *addr,
345
345
  grpc_server_credentials *creds);
346
346
 
347
- /* --- Call specific credentials. --- */
347
+ /** --- Call specific credentials. --- */
348
348
 
349
- /* Sets a credentials to a call. Can only be called on the client side before
349
+ /** Sets a credentials to a call. Can only be called on the client side before
350
350
  grpc_call_start_batch. */
351
351
  GRPCAPI grpc_call_error grpc_call_set_credentials(grpc_call *call,
352
352
  grpc_call_credentials *creds);
353
353
 
354
- /* --- Auth Metadata Processing --- */
354
+ /** --- Auth Metadata Processing --- */
355
355
 
356
- /* Callback function that is called when the metadata processing is done.
356
+ /** Callback function that is called when the metadata processing is done.
357
357
  - Consumed metadata will be removed from the set of metadata available on the
358
358
  call. consumed_md may be NULL if no metadata has been consumed.
359
359
  - Response metadata will be set on the response. response_md may be NULL.
@@ -367,9 +367,9 @@ typedef void (*grpc_process_auth_metadata_done_cb)(
367
367
  const grpc_metadata *response_md, size_t num_response_md,
368
368
  grpc_status_code status, const char *error_details);
369
369
 
370
- /* Pluggable server-side metadata processor object. */
370
+ /** Pluggable server-side metadata processor object. */
371
371
  typedef struct {
372
- /* The context object is read/write: it contains the properties of the
372
+ /** The context object is read/write: it contains the properties of the
373
373
  channel peer and it is the job of the process function to augment it with
374
374
  properties derived from the passed-in metadata.
375
375
  The lifetime of these objects is guaranteed until cb is invoked. */