1 # Copyright 2015 gRPC authors.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 ctypedef ssize_t intptr_t
18 ctypedef size_t uintptr_t
19 ctypedef signed char int8_t
20 ctypedef signed short int16_t
21 ctypedef signed int int32_t
22 ctypedef signed long long int64_t
23 ctypedef unsigned char uint8_t
24 ctypedef unsigned short uint16_t
25 ctypedef unsigned int uint32_t
26 ctypedef unsigned long long uint64_t
29 cdef extern from "grpc/support/alloc.h":
31 void *gpr_malloc(size_t size) nogil
32 void *gpr_zalloc(size_t size) nogil
33 void gpr_free(void *ptr) nogil
34 void *gpr_realloc(void *p, size_t size) nogil
37 cdef extern from "grpc/byte_buffer_reader.h":
39 struct grpc_byte_buffer_reader:
40 # We don't care about the internals
44 cdef extern from "grpc/impl/codegen/grpc_types.h":
45 ctypedef struct grpc_experimental_completion_queue_functor:
46 void (*functor_run)(grpc_experimental_completion_queue_functor*, int);
49 cdef extern from "grpc/grpc.h":
51 ctypedef struct grpc_slice:
52 # don't worry about writing out the members of grpc_slice; we never access
56 grpc_slice grpc_slice_ref(grpc_slice s) nogil
57 void grpc_slice_unref(grpc_slice s) nogil
58 grpc_slice grpc_empty_slice() nogil
59 grpc_slice grpc_slice_new(void *p, size_t len, void (*destroy)(void *)) nogil
60 grpc_slice grpc_slice_new_with_len(
61 void *p, size_t len, void (*destroy)(void *, size_t)) nogil
62 grpc_slice grpc_slice_malloc(size_t length) nogil
63 grpc_slice grpc_slice_from_copied_string(const char *source) nogil
64 grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t len) nogil
65 grpc_slice grpc_slice_copy(grpc_slice s) nogil
67 # Declare functions for function-like macros (because Cython)...
68 void *grpc_slice_start_ptr "GRPC_SLICE_START_PTR" (grpc_slice s) nogil
69 size_t grpc_slice_length "GRPC_SLICE_LENGTH" (grpc_slice s) nogil
71 const int GPR_MS_PER_SEC
72 const int GPR_US_PER_SEC
73 const int GPR_NS_PER_SEC
75 ctypedef enum gpr_clock_type:
81 ctypedef struct gpr_timespec:
82 int64_t seconds "tv_sec"
83 int32_t nanoseconds "tv_nsec"
84 gpr_clock_type clock_type
86 gpr_timespec gpr_time_0(gpr_clock_type type) nogil
87 gpr_timespec gpr_inf_future(gpr_clock_type type) nogil
88 gpr_timespec gpr_inf_past(gpr_clock_type type) nogil
90 gpr_timespec gpr_now(gpr_clock_type clock) nogil
92 gpr_timespec gpr_convert_clock_type(gpr_timespec t,
93 gpr_clock_type target_clock) nogil
95 gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type type) nogil
96 gpr_timespec gpr_time_from_nanos(int64_t ns, gpr_clock_type type) nogil
97 double gpr_timespec_to_micros(gpr_timespec t) nogil
99 gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b) nogil
101 int gpr_time_cmp(gpr_timespec a, gpr_timespec b) nogil
103 ctypedef struct grpc_byte_buffer:
104 # We don't care about the internals.
107 grpc_byte_buffer *grpc_raw_byte_buffer_create(grpc_slice *slices,
108 size_t nslices) nogil
109 size_t grpc_byte_buffer_length(grpc_byte_buffer *bb) nogil
110 void grpc_byte_buffer_destroy(grpc_byte_buffer *byte_buffer) nogil
112 int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
113 grpc_byte_buffer *buffer) nogil
114 int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
115 grpc_slice *slice) nogil
116 void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader) nogil
118 ctypedef enum grpc_status_code:
120 GRPC_STATUS_CANCELLED
122 GRPC_STATUS_INVALID_ARGUMENT
123 GRPC_STATUS_DEADLINE_EXCEEDED
124 GRPC_STATUS_NOT_FOUND
125 GRPC_STATUS_ALREADY_EXISTS
126 GRPC_STATUS_PERMISSION_DENIED
127 GRPC_STATUS_UNAUTHENTICATED
128 GRPC_STATUS_RESOURCE_EXHAUSTED
129 GRPC_STATUS_FAILED_PRECONDITION
131 GRPC_STATUS_OUT_OF_RANGE
132 GRPC_STATUS_UNIMPLEMENTED
134 GRPC_STATUS_UNAVAILABLE
135 GRPC_STATUS_DATA_LOSS
136 GRPC_STATUS__DO_NOT_USE
138 const char *GRPC_ARG_ENABLE_CENSUS
139 const char *GRPC_ARG_MAX_CONCURRENT_STREAMS
140 const char *GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH
141 const char *GRPC_ARG_MAX_SEND_MESSAGE_LENGTH
142 const char *GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER
143 const char *GRPC_ARG_DEFAULT_AUTHORITY
144 const char *GRPC_ARG_PRIMARY_USER_AGENT_STRING
145 const char *GRPC_ARG_SECONDARY_USER_AGENT_STRING
146 const char *GRPC_SSL_TARGET_NAME_OVERRIDE_ARG
147 const char *GRPC_SSL_SESSION_CACHE_ARG
148 const char *_GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM \
149 "GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM"
150 const char *GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL
151 const char *GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET
153 const int GRPC_WRITE_BUFFER_HINT
154 const int GRPC_WRITE_NO_COMPRESS
155 const int GRPC_WRITE_USED_MASK
157 const int GRPC_INITIAL_METADATA_WAIT_FOR_READY
158 const int GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET
159 const int GRPC_INITIAL_METADATA_USED_MASK
161 const int GRPC_MAX_COMPLETION_QUEUE_PLUCKERS
163 ctypedef struct grpc_completion_queue:
164 # We don't care about the internals (and in fact don't know them)
167 ctypedef struct grpc_channel:
168 # We don't care about the internals (and in fact don't know them)
171 ctypedef struct grpc_server:
172 # We don't care about the internals (and in fact don't know them)
175 ctypedef struct grpc_call:
176 # We don't care about the internals (and in fact don't know them)
179 ctypedef enum grpc_arg_type:
184 ctypedef struct grpc_arg_pointer_vtable:
185 void *(*copy)(void *)
186 void (*destroy)(void *)
187 int (*cmp)(void *, void *)
189 ctypedef struct grpc_arg_value_pointer:
191 grpc_arg_pointer_vtable *vtable
193 union grpc_arg_value:
196 grpc_arg_value_pointer pointer
198 ctypedef struct grpc_arg:
203 ctypedef struct grpc_channel_args:
204 size_t arguments_length "num_args"
205 grpc_arg *arguments "args"
207 ctypedef enum grpc_stream_compression_level:
208 GRPC_STREAM_COMPRESS_LEVEL_NONE
209 GRPC_STREAM_COMPRESS_LEVEL_LOW
210 GRPC_STREAM_COMPRESS_LEVEL_MED
211 GRPC_STREAM_COMPRESS_LEVEL_HIGH
213 ctypedef enum grpc_call_error:
216 GRPC_CALL_ERROR_NOT_ON_SERVER
217 GRPC_CALL_ERROR_NOT_ON_CLIENT
218 GRPC_CALL_ERROR_ALREADY_ACCEPTED
219 GRPC_CALL_ERROR_ALREADY_INVOKED
220 GRPC_CALL_ERROR_NOT_INVOKED
221 GRPC_CALL_ERROR_ALREADY_FINISHED
222 GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
223 GRPC_CALL_ERROR_INVALID_FLAGS
224 GRPC_CALL_ERROR_INVALID_METADATA
226 ctypedef enum grpc_cq_completion_type:
230 ctypedef enum grpc_cq_polling_type:
231 GRPC_CQ_DEFAULT_POLLING
232 GRPC_CQ_NON_LISTENING
235 ctypedef struct grpc_completion_queue_attributes:
237 grpc_cq_completion_type cq_completion_type
238 grpc_cq_polling_type cq_polling_type
240 ctypedef enum grpc_connectivity_state:
242 GRPC_CHANNEL_CONNECTING
244 GRPC_CHANNEL_TRANSIENT_FAILURE
245 GRPC_CHANNEL_SHUTDOWN
247 ctypedef struct grpc_metadata:
250 # ignore the 'internal_data.obfuscated' fields.
252 ctypedef enum grpc_completion_type:
257 ctypedef struct grpc_event:
258 grpc_completion_type type
262 ctypedef struct grpc_metadata_array:
265 grpc_metadata *metadata
267 void grpc_metadata_array_init(grpc_metadata_array *array) nogil
268 void grpc_metadata_array_destroy(grpc_metadata_array *array) nogil
270 ctypedef struct grpc_call_details:
273 gpr_timespec deadline
275 void grpc_call_details_init(grpc_call_details *details) nogil
276 void grpc_call_details_destroy(grpc_call_details *details) nogil
278 ctypedef enum grpc_op_type:
279 GRPC_OP_SEND_INITIAL_METADATA
281 GRPC_OP_SEND_CLOSE_FROM_CLIENT
282 GRPC_OP_SEND_STATUS_FROM_SERVER
283 GRPC_OP_RECV_INITIAL_METADATA
285 GRPC_OP_RECV_STATUS_ON_CLIENT
286 GRPC_OP_RECV_CLOSE_ON_SERVER
288 ctypedef struct grpc_op_send_initial_metadata_maybe_compression_level:
290 grpc_compression_level level
292 ctypedef struct grpc_op_data_send_initial_metadata:
294 grpc_metadata *metadata
295 grpc_op_send_initial_metadata_maybe_compression_level maybe_compression_level
297 ctypedef struct grpc_op_data_send_status_from_server:
298 size_t trailing_metadata_count
299 grpc_metadata *trailing_metadata
300 grpc_status_code status
301 grpc_slice *status_details
303 ctypedef struct grpc_op_data_recv_status_on_client:
304 grpc_metadata_array *trailing_metadata
305 grpc_status_code *status
306 grpc_slice *status_details
309 ctypedef struct grpc_op_data_recv_close_on_server:
312 ctypedef struct grpc_op_data_send_message:
313 grpc_byte_buffer *send_message
315 ctypedef struct grpc_op_data_receive_message:
316 grpc_byte_buffer **receive_message "recv_message"
318 ctypedef struct grpc_op_data_receive_initial_metadata:
319 grpc_metadata_array *receive_initial_metadata "recv_initial_metadata"
322 grpc_op_data_send_initial_metadata send_initial_metadata
323 grpc_op_data_send_message send_message
324 grpc_op_data_send_status_from_server send_status_from_server
325 grpc_op_data_receive_initial_metadata receive_initial_metadata "recv_initial_metadata"
326 grpc_op_data_receive_message receive_message "recv_message"
327 grpc_op_data_recv_status_on_client receive_status_on_client "recv_status_on_client"
328 grpc_op_data_recv_close_on_server receive_close_on_server "recv_close_on_server"
330 ctypedef struct grpc_op:
331 grpc_op_type type "op"
336 void grpc_init() nogil
337 void grpc_shutdown() nogil
338 void grpc_shutdown_blocking() nogil
339 int grpc_is_initialized() nogil
341 ctypedef struct grpc_completion_queue_factory:
344 grpc_completion_queue_factory *grpc_completion_queue_factory_lookup(
345 const grpc_completion_queue_attributes* attributes) nogil
346 grpc_completion_queue *grpc_completion_queue_create(
347 const grpc_completion_queue_factory* factory,
348 const grpc_completion_queue_attributes* attr, void* reserved) nogil
349 grpc_completion_queue *grpc_completion_queue_create_for_next(void *reserved) nogil
351 grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
352 gpr_timespec deadline,
353 void *reserved) nogil
354 grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag,
355 gpr_timespec deadline,
356 void *reserved) nogil
357 void grpc_completion_queue_shutdown(grpc_completion_queue *cq) nogil
358 void grpc_completion_queue_destroy(grpc_completion_queue *cq) nogil
360 grpc_completion_queue *grpc_completion_queue_create_for_callback(
361 grpc_experimental_completion_queue_functor* shutdown_callback,
362 void *reserved) nogil
364 grpc_call_error grpc_call_start_batch(
365 grpc_call *call, const grpc_op *ops, size_t nops, void *tag,
366 void *reserved) nogil
367 grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved) nogil
368 grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
369 grpc_status_code status,
370 const char *description,
371 void *reserved) nogil
372 char *grpc_call_get_peer(grpc_call *call) nogil
373 void grpc_call_unref(grpc_call *call) nogil
375 grpc_channel *grpc_insecure_channel_create(const char *target,
376 const grpc_channel_args *args,
377 void *reserved) nogil
378 grpc_call *grpc_channel_create_call(
379 grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
380 grpc_completion_queue *completion_queue, grpc_slice method,
381 const grpc_slice *host, gpr_timespec deadline, void *reserved) nogil
382 grpc_connectivity_state grpc_channel_check_connectivity_state(
383 grpc_channel *channel, int try_to_connect) nogil
384 void grpc_channel_watch_connectivity_state(
385 grpc_channel *channel, grpc_connectivity_state last_observed_state,
386 gpr_timespec deadline, grpc_completion_queue *cq, void *tag) nogil
387 char *grpc_channel_get_target(grpc_channel *channel) nogil
388 void grpc_channel_destroy(grpc_channel *channel) nogil
390 grpc_server *grpc_server_create(
391 const grpc_channel_args *args, void *reserved) nogil
392 grpc_call_error grpc_server_request_call(
393 grpc_server *server, grpc_call **call, grpc_call_details *details,
394 grpc_metadata_array *request_metadata, grpc_completion_queue
395 *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void
397 void grpc_server_register_completion_queue(grpc_server *server,
398 grpc_completion_queue *cq,
399 void *reserved) nogil
401 ctypedef struct grpc_server_config_fetcher:
404 void grpc_server_set_config_fetcher(
405 grpc_server* server, grpc_server_config_fetcher* config_fetcher) nogil
407 grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create() nogil
410 int grpc_server_add_insecure_http2_port(
411 grpc_server *server, const char *addr) nogil
412 void grpc_server_start(grpc_server *server) nogil
413 void grpc_server_shutdown_and_notify(
414 grpc_server *server, grpc_completion_queue *cq, void *tag) nogil
415 void grpc_server_cancel_all_calls(grpc_server *server) nogil
416 void grpc_server_destroy(grpc_server *server) nogil
418 char* grpc_channelz_get_top_channels(intptr_t start_channel_id)
419 char* grpc_channelz_get_servers(intptr_t start_server_id)
420 char* grpc_channelz_get_server(intptr_t server_id)
421 char* grpc_channelz_get_server_sockets(intptr_t server_id,
422 intptr_t start_socket_id,
423 intptr_t max_results)
424 char* grpc_channelz_get_channel(intptr_t channel_id)
425 char* grpc_channelz_get_subchannel(intptr_t subchannel_id)
426 char* grpc_channelz_get_socket(intptr_t socket_id)
429 cdef extern from "grpc/grpc_security.h":
431 # Declare this as an enum, this is the only way to make it a const in
433 enum: GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX
435 ctypedef enum grpc_ssl_roots_override_result:
436 GRPC_SSL_ROOTS_OVERRIDE_OK
437 GRPC_SSL_ROOTS_OVERRIDE_FAILED_PERMANENTLY
438 GRPC_SSL_ROOTS_OVERRIDE_FAILED
440 ctypedef enum grpc_ssl_client_certificate_request_type:
441 GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE,
442 GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY
443 GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY
444 GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY
445 GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
447 ctypedef enum grpc_security_level:
449 GRPC_SECURITY_NONE = GRPC_SECURITY_MIN
451 GRPC_PRIVACY_AND_INTEGRITY
452 GRPC_SECURITY_MAX = GRPC_PRIVACY_AND_INTEGRITY
454 ctypedef enum grpc_ssl_certificate_config_reload_status:
455 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED
456 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW
457 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL
459 ctypedef struct grpc_ssl_server_certificate_config:
460 # We don't care about the internals
463 ctypedef struct grpc_ssl_server_credentials_options:
464 # We don't care about the internals
467 grpc_ssl_server_certificate_config * grpc_ssl_server_certificate_config_create(
468 const char *pem_root_certs,
469 const grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
470 size_t num_key_cert_pairs)
472 void grpc_ssl_server_certificate_config_destroy(grpc_ssl_server_certificate_config *config)
474 ctypedef grpc_ssl_certificate_config_reload_status (*grpc_ssl_server_certificate_config_callback)(
476 grpc_ssl_server_certificate_config **config)
478 grpc_ssl_server_credentials_options *grpc_ssl_server_credentials_create_options_using_config(
479 grpc_ssl_client_certificate_request_type client_certificate_request,
480 grpc_ssl_server_certificate_config *certificate_config)
482 grpc_ssl_server_credentials_options* grpc_ssl_server_credentials_create_options_using_config_fetcher(
483 grpc_ssl_client_certificate_request_type client_certificate_request,
484 grpc_ssl_server_certificate_config_callback cb,
487 grpc_server_credentials *grpc_ssl_server_credentials_create_with_options(
488 grpc_ssl_server_credentials_options *options)
490 ctypedef struct grpc_ssl_pem_key_cert_pair:
491 const char *private_key
492 const char *certificate_chain "cert_chain"
494 ctypedef struct grpc_channel_credentials:
495 # We don't care about the internals (and in fact don't know them)
498 ctypedef struct grpc_call_credentials:
499 # We don't care about the internals (and in fact don't know them)
502 ctypedef struct grpc_ssl_session_cache:
503 # We don't care about the internals (and in fact don't know them)
506 ctypedef struct verify_peer_options:
507 # We don't care about the internals (and in fact don't know them)
510 ctypedef void (*grpc_ssl_roots_override_callback)(char **pem_root_certs)
512 grpc_ssl_session_cache *grpc_ssl_session_cache_create_lru(size_t capacity)
513 void grpc_ssl_session_cache_destroy(grpc_ssl_session_cache* cache)
515 void grpc_set_ssl_roots_override_callback(
516 grpc_ssl_roots_override_callback cb) nogil
518 grpc_channel_credentials *grpc_google_default_credentials_create(grpc_call_credentials* call_credentials) nogil
519 grpc_channel_credentials *grpc_ssl_credentials_create(
520 const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
521 verify_peer_options *verify_options, void *reserved) nogil
522 grpc_channel_credentials *grpc_composite_channel_credentials_create(
523 grpc_channel_credentials *creds1, grpc_call_credentials *creds2,
524 void *reserved) nogil
525 void grpc_channel_credentials_release(grpc_channel_credentials *creds) nogil
527 grpc_channel_credentials *grpc_xds_credentials_create(
528 grpc_channel_credentials *fallback_creds) nogil
530 grpc_channel_credentials *grpc_insecure_credentials_create() nogil
532 grpc_server_credentials *grpc_xds_server_credentials_create(
533 grpc_server_credentials *fallback_creds) nogil
535 grpc_server_credentials *grpc_insecure_server_credentials_create() nogil
537 grpc_call_credentials *grpc_composite_call_credentials_create(
538 grpc_call_credentials *creds1, grpc_call_credentials *creds2,
539 void *reserved) nogil
540 grpc_call_credentials *grpc_google_compute_engine_credentials_create(
541 void *reserved) nogil
542 grpc_call_credentials *grpc_service_account_jwt_access_credentials_create(
543 const char *json_key,
544 gpr_timespec token_lifetime, void *reserved) nogil
545 grpc_call_credentials *grpc_google_refresh_token_credentials_create(
546 const char *json_refresh_token, void *reserved) nogil
547 grpc_call_credentials *grpc_google_iam_credentials_create(
548 const char *authorization_token, const char *authority_selector,
549 void *reserved) nogil
550 void grpc_call_credentials_release(grpc_call_credentials *creds) nogil
552 grpc_channel *grpc_secure_channel_create(
553 grpc_channel_credentials *creds, const char *target,
554 const grpc_channel_args *args, void *reserved) nogil
556 ctypedef struct grpc_server_credentials:
557 # We don't care about the internals (and in fact don't know them)
560 void grpc_server_credentials_release(grpc_server_credentials *creds) nogil
562 int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
563 grpc_server_credentials *creds) nogil
565 grpc_call_error grpc_call_set_credentials(grpc_call *call,
566 grpc_call_credentials *creds) nogil
568 ctypedef struct grpc_auth_context:
569 # We don't care about the internals (and in fact don't know them)
572 ctypedef struct grpc_auth_metadata_context:
573 const char *service_url
574 const char *method_name
575 const grpc_auth_context *channel_auth_context
577 ctypedef void (*grpc_credentials_plugin_metadata_cb)(
578 void *user_data, const grpc_metadata *creds_md, size_t num_creds_md,
579 grpc_status_code status, const char *error_details)
581 ctypedef struct grpc_metadata_credentials_plugin:
583 void *state, grpc_auth_metadata_context context,
584 grpc_credentials_plugin_metadata_cb cb, void *user_data,
585 grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
586 size_t *num_creds_md, grpc_status_code *status,
587 const char **error_details) except *
588 void (*destroy)(void *state) except *
592 grpc_call_credentials *grpc_metadata_credentials_create_from_plugin(
593 grpc_metadata_credentials_plugin plugin, grpc_security_level min_security_level, void *reserved) nogil
595 ctypedef struct grpc_auth_property_iterator:
598 ctypedef struct grpc_auth_property:
603 grpc_auth_property *grpc_auth_property_iterator_next(
604 grpc_auth_property_iterator *it)
606 grpc_auth_property_iterator grpc_auth_context_property_iterator(
607 const grpc_auth_context *ctx)
609 grpc_auth_property_iterator grpc_auth_context_peer_identity(
610 const grpc_auth_context *ctx)
612 char *grpc_auth_context_peer_identity_property_name(
613 const grpc_auth_context *ctx)
615 grpc_auth_property_iterator grpc_auth_context_find_properties_by_name(
616 const grpc_auth_context *ctx, const char *name)
618 grpc_auth_context_peer_is_authenticated(
619 const grpc_auth_context *ctx)
621 grpc_auth_context *grpc_call_auth_context(grpc_call *call)
623 void grpc_auth_context_release(grpc_auth_context *context)
625 grpc_channel_credentials *grpc_local_credentials_create(
626 grpc_local_connect_type type)
627 grpc_server_credentials *grpc_local_server_credentials_create(
628 grpc_local_connect_type type)
630 ctypedef struct grpc_alts_credentials_options:
631 # We don't care about the internals (and in fact don't know them)
634 grpc_channel_credentials *grpc_alts_credentials_create(
635 const grpc_alts_credentials_options *options)
636 grpc_server_credentials *grpc_alts_server_credentials_create(
637 const grpc_alts_credentials_options *options)
639 grpc_alts_credentials_options* grpc_alts_credentials_client_options_create()
640 grpc_alts_credentials_options* grpc_alts_credentials_server_options_create()
641 void grpc_alts_credentials_options_destroy(grpc_alts_credentials_options *options)
642 void grpc_alts_credentials_client_options_add_target_service_account(grpc_alts_credentials_options *options, const char *service_account)
646 cdef extern from "grpc/compression.h":
648 ctypedef enum grpc_compression_algorithm:
650 GRPC_COMPRESS_DEFLATE
652 GRPC_COMPRESS_STREAM_GZIP
653 GRPC_COMPRESS_ALGORITHMS_COUNT
655 ctypedef enum grpc_compression_level:
656 GRPC_COMPRESS_LEVEL_NONE
657 GRPC_COMPRESS_LEVEL_LOW
658 GRPC_COMPRESS_LEVEL_MED
659 GRPC_COMPRESS_LEVEL_HIGH
660 GRPC_COMPRESS_LEVEL_COUNT
662 ctypedef struct grpc_compression_options:
663 uint32_t enabled_algorithms_bitset
665 int grpc_compression_algorithm_parse(
666 grpc_slice value, grpc_compression_algorithm *algorithm) nogil
667 int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm,
668 const char **name) nogil
669 grpc_compression_algorithm grpc_compression_algorithm_for_level(
670 grpc_compression_level level, uint32_t accepted_encodings) nogil
671 void grpc_compression_options_init(grpc_compression_options *opts) nogil
672 void grpc_compression_options_enable_algorithm(
673 grpc_compression_options *opts,
674 grpc_compression_algorithm algorithm) nogil
675 void grpc_compression_options_disable_algorithm(
676 grpc_compression_options *opts,
677 grpc_compression_algorithm algorithm) nogil
678 int grpc_compression_options_is_algorithm_enabled(
679 const grpc_compression_options *opts,
680 grpc_compression_algorithm algorithm) nogil
682 cdef extern from "grpc/impl/codegen/compression_types.h":
684 const char *_GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY \
685 "GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY"
688 cdef extern from "grpc/grpc_security_constants.h":
689 ctypedef enum grpc_local_connect_type: