diff options
author | 2017-04-27 10:42:33 -0700 | |
---|---|---|
committer | 2017-04-27 10:42:33 -0700 | |
commit | 8c71bde9b04c873aa4f4b6b65ef7711ac0d7b468 (patch) | |
tree | 4c1132a9b04101ddf2480042f7c5d7431fac408d /src/core/tsi/transport_security.h | |
parent | f7cd5859016212dc6a172fe42ad9e7216bd99502 (diff) | |
parent | a04aeec396a6224b4fefed58319b40f6fa99c69e (diff) |
Merge pull request #10522 from jiangtaoli2016/new_tsi
Update TSI with new non-blocking TSI interfaces.
Diffstat (limited to 'src/core/tsi/transport_security.h')
-rw-r--r-- | src/core/tsi/transport_security.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index 491fa1a8bd..a4c9cbc001 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -34,6 +34,8 @@ #ifndef GRPC_CORE_TSI_TRANSPORT_SECURITY_H #define GRPC_CORE_TSI_TRANSPORT_SECURITY_H +#include <stdbool.h> + #include "src/core/tsi/transport_security_interface.h" #ifdef __cplusplus @@ -81,11 +83,33 @@ typedef struct { size_t *max_protected_frame_size, tsi_frame_protector **protector); void (*destroy)(tsi_handshaker *self); + tsi_result (*next)(tsi_handshaker *self, const unsigned char *received_bytes, + size_t received_bytes_size, unsigned char **bytes_to_send, + size_t *bytes_to_send_size, + tsi_handshaker_result **handshaker_result, + tsi_handshaker_on_next_done_cb cb, void *user_data); } tsi_handshaker_vtable; struct tsi_handshaker { const tsi_handshaker_vtable *vtable; - int frame_protector_created; + bool frame_protector_created; + bool handshaker_result_created; +}; + +/* Base for tsi_handshaker_result implementations. + See transport_security_interface.h for documentation. */ +typedef struct { + tsi_result (*extract_peer)(const tsi_handshaker_result *self, tsi_peer *peer); + tsi_result (*create_frame_protector)(const tsi_handshaker_result *self, + size_t *max_output_protected_frame_size, + tsi_frame_protector **protector); + tsi_result (*get_unused_bytes)(const tsi_handshaker_result *self, + unsigned char **bytes, size_t *bytes_size); + void (*destroy)(tsi_handshaker_result *self); +} tsi_handshaker_result_vtable; + +struct tsi_handshaker_result { + const tsi_handshaker_result_vtable *vtable; }; /* Peer and property construction/destruction functions. */ |