diff options
author | 2015-09-22 12:33:20 -0700 | |
---|---|---|
committer | 2015-09-22 12:33:20 -0700 | |
commit | a82950e68318a6aab6fe894fa39f7fa616c4647b (patch) | |
tree | 7d02bd1e9e1cbae1f14ad4ad1e06d3ae81a96dfe /src/core/tsi/transport_security.h | |
parent | 8af4c337181322cc4fb396199c90f574cfb4163f (diff) |
clang-format all core files
Diffstat (limited to 'src/core/tsi/transport_security.h')
-rw-r--r-- | src/core/tsi/transport_security.h | 89 |
1 files changed, 53 insertions, 36 deletions
diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index 3ae82a31cc..4077737473 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -37,58 +37,75 @@ #include "src/core/tsi/transport_security_interface.h" #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif - extern int tsi_tracing_enabled; +extern int tsi_tracing_enabled; /* Base for tsi_frame_protector implementations. See transport_security_interface.h for documentation. */ - typedef struct - { - tsi_result (*protect) (tsi_frame_protector * self, const unsigned char *unprotected_bytes, size_t * unprotected_bytes_size, unsigned char *protected_output_frames, size_t * protected_output_frames_size); - tsi_result (*protect_flush) (tsi_frame_protector * self, unsigned char *protected_output_frames, size_t * protected_output_frames_size, size_t * still_pending_size); - tsi_result (*unprotect) (tsi_frame_protector * self, const unsigned char *protected_frames_bytes, size_t * protected_frames_bytes_size, unsigned char *unprotected_bytes, size_t * unprotected_bytes_size); - void (*destroy) (tsi_frame_protector * self); - } tsi_frame_protector_vtable; +typedef struct { + tsi_result (*protect)(tsi_frame_protector *self, + const unsigned char *unprotected_bytes, + size_t *unprotected_bytes_size, + unsigned char *protected_output_frames, + size_t *protected_output_frames_size); + tsi_result (*protect_flush)(tsi_frame_protector *self, + unsigned char *protected_output_frames, + size_t *protected_output_frames_size, + size_t *still_pending_size); + tsi_result (*unprotect)(tsi_frame_protector *self, + const unsigned char *protected_frames_bytes, + size_t *protected_frames_bytes_size, + unsigned char *unprotected_bytes, + size_t *unprotected_bytes_size); + void (*destroy)(tsi_frame_protector *self); +} tsi_frame_protector_vtable; - struct tsi_frame_protector - { - const tsi_frame_protector_vtable *vtable; - }; +struct tsi_frame_protector { + const tsi_frame_protector_vtable *vtable; +}; /* Base for tsi_handshaker implementations. See transport_security_interface.h for documentation. */ - typedef struct - { - tsi_result (*get_bytes_to_send_to_peer) (tsi_handshaker * self, unsigned char *bytes, size_t * bytes_size); - tsi_result (*process_bytes_from_peer) (tsi_handshaker * self, const unsigned char *bytes, size_t * bytes_size); - tsi_result (*get_result) (tsi_handshaker * self); - tsi_result (*extract_peer) (tsi_handshaker * self, tsi_peer * peer); - tsi_result (*create_frame_protector) (tsi_handshaker * self, size_t * max_protected_frame_size, tsi_frame_protector ** protector); - void (*destroy) (tsi_handshaker * self); - } tsi_handshaker_vtable; +typedef struct { + tsi_result (*get_bytes_to_send_to_peer)(tsi_handshaker *self, + unsigned char *bytes, + size_t *bytes_size); + tsi_result (*process_bytes_from_peer)(tsi_handshaker *self, + const unsigned char *bytes, + size_t *bytes_size); + tsi_result (*get_result)(tsi_handshaker *self); + tsi_result (*extract_peer)(tsi_handshaker *self, tsi_peer *peer); + tsi_result (*create_frame_protector)(tsi_handshaker *self, + size_t *max_protected_frame_size, + tsi_frame_protector **protector); + void (*destroy)(tsi_handshaker *self); +} tsi_handshaker_vtable; - struct tsi_handshaker - { - const tsi_handshaker_vtable *vtable; - int frame_protector_created; - }; +struct tsi_handshaker { + const tsi_handshaker_vtable *vtable; + int frame_protector_created; +}; /* Peer and property construction/destruction functions. */ - tsi_result tsi_construct_peer (size_t property_count, tsi_peer * peer); - tsi_peer_property tsi_init_peer_property (void); - void tsi_peer_property_destruct (tsi_peer_property * property); - tsi_result tsi_construct_string_peer_property (const char *name, const char *value, size_t value_length, tsi_peer_property * property); - tsi_result tsi_construct_allocated_string_peer_property (const char *name, size_t value_length, tsi_peer_property * property); - tsi_result tsi_construct_string_peer_property_from_cstring (const char *name, const char *value, tsi_peer_property * property); +tsi_result tsi_construct_peer(size_t property_count, tsi_peer *peer); +tsi_peer_property tsi_init_peer_property(void); +void tsi_peer_property_destruct(tsi_peer_property *property); +tsi_result tsi_construct_string_peer_property(const char *name, + const char *value, + size_t value_length, + tsi_peer_property *property); +tsi_result tsi_construct_allocated_string_peer_property( + const char *name, size_t value_length, tsi_peer_property *property); +tsi_result tsi_construct_string_peer_property_from_cstring( + const char *name, const char *value, tsi_peer_property *property); /* Utils. */ - char *tsi_strdup (const char *src); /* Sadly, no strdup in C89. */ +char *tsi_strdup(const char *src); /* Sadly, no strdup in C89. */ #ifdef __cplusplus } #endif -#endif /* GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_H */ +#endif /* GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_H */ |