Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Side by Side Diff: src/trusted/service_runtime/nacl_secure_service.h

Issue 10914138: Split secure command channel and untrusted application channel (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Fixed a few nits. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_SECURE_SERVICE_H_
8 #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_SECURE_SERVICE_H_
9
10 #include "native_client/src/include/nacl_base.h"
11 #include "native_client/src/trusted/service_runtime/sel_ldr.h"
12 #include "native_client/src/trusted/simple_service/nacl_simple_service.h"
13 #include "native_client/src/trusted/simple_service/nacl_simple_rservice.h"
14
15 EXTERN_C_BEGIN
16
17 struct NaClApp;
18
19 /*
20 * Secure channel.
21 */
22
23 struct NaClSecureService {
24 struct NaClSimpleService base NACL_IS_REFCOUNT_SUBCLASS;
25 struct NaClApp *nap;
26
27 struct NaClMutex mu;
28 /*
29 * |mu| protects the thread count access.
30 */
31 uint32_t thread_count;
32 };
33
34 int NaClSecureServiceCtor(
35 struct NaClSecureService *self,
36 struct NaClSrpcHandlerDesc const *srpc_handlers,
37 struct NaClApp *nap,
38 struct NaClDesc *service_port,
39 struct NaClDesc *sock_addr);
40
41 void NaClSecureServiceDtor(struct NaClRefCount *vself);
42
43 extern struct NaClSimpleServiceVtbl const kNaClSecureServiceVtbl;
44
45 struct NaClSecureRevClientConnHandler; /* fwd */
46
47 struct NaClSecureReverseClient {
48 struct NaClSimpleRevClient base;
49 struct NaClApp *nap;
50
51 struct NaClMutex mu;
52 /*
53 * |mu| protects the service entries hanging off of |queue_head|.
54 */
55 struct NaClSecureRevClientConnHandler *queue_head;
56 struct NaClSecureRevClientConnHandler **queue_insert;
57 };
58
59 struct NaClSecureReverseClientVtbl {
60 struct NaClSimpleRevClientVtbl vbase;
61
62 int (*InsertHandler)(
63 struct NaClSecureReverseClient *self,
64 void (*handler)(
65 void *handler_state,
66 struct NaClThreadInterface *thread_id,
67 struct NaClDesc *new_conn),
68 void *state);
69
70 struct NaClSecureRevClientConnHandler *(*RemoveHandler)(
71 struct NaClSecureReverseClient *self);
72 };
73
74 int NaClSecureReverseClientCtor(
75 struct NaClSecureReverseClient *self,
76 void (*client_callback)(
77 void *, struct NaClThreadInterface *, struct NaClDesc *),
78 void *state,
79 struct NaClApp *nap);
80
81 void NaClSecureReverseClientDtor(struct NaClRefCount *vself);
82
83 int NaClSecureReverseClientInsertHandler(
84 struct NaClSecureReverseClient *self,
85 void (*handler)(
86 void *handler_state,
87 struct NaClThreadInterface *thread_if,
88 struct NaClDesc *new_conn),
89 void *state) NACL_WUR;
90
91 struct NaClSecureRevClientConnHandler *NaClSecureReverseClientRemoveHandler(
92 struct NaClSecureReverseClient *self);
93
94 extern struct NaClSecureReverseClientVtbl const kNaClSecureReverseClientVtbl;
95
96 EXTERN_C_END
97
98 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_SECURE_SERVICE_H_ */
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/build.scons ('k') | src/trusted/service_runtime/nacl_secure_service.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698