Yihua Zhang | 1435bfc | 2017-07-17 11:20:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright 2017 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 | #ifndef GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H |
| 20 | #define GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H |
| 21 | |
| 22 | #include <grpc/grpc.h> |
| 23 | #include <grpc/support/sync.h> |
| 24 | #include <grpc/support/thd.h> |
| 25 | |
Yash Tibrewal | a7e6d65 | 2017-09-20 18:56:37 -0700 | [diff] [blame] | 26 | #ifdef __cplusplus |
| 27 | extern "C" { |
| 28 | #endif |
| 29 | |
Yihua Zhang | 1435bfc | 2017-07-17 11:20:51 -0700 | [diff] [blame] | 30 | typedef struct gts_shared_resource { |
| 31 | gpr_thd_id thread_id; |
Craig Tiller | baa14a9 | 2017-11-03 09:09:36 -0700 | [diff] [blame] | 32 | grpc_channel* channel; |
| 33 | grpc_completion_queue* cq; |
Yihua Zhang | 1435bfc | 2017-07-17 11:20:51 -0700 | [diff] [blame] | 34 | gpr_mu mu; |
| 35 | } gts_shared_resource; |
| 36 | |
| 37 | /* This method returns the address of gts_shared_resource object shared by all |
| 38 | * TSI handshakes. */ |
Craig Tiller | baa14a9 | 2017-11-03 09:09:36 -0700 | [diff] [blame] | 39 | gts_shared_resource* gts_get_shared_resource(void); |
Yihua Zhang | 1435bfc | 2017-07-17 11:20:51 -0700 | [diff] [blame] | 40 | |
Yash Tibrewal | a7e6d65 | 2017-09-20 18:56:37 -0700 | [diff] [blame] | 41 | #ifdef __cplusplus |
| 42 | } |
| 43 | #endif |
| 44 | |
Yash Tibrewal | 12fc6d4 | 2017-10-09 16:43:34 -0700 | [diff] [blame] | 45 | #endif /* GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H */ |