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

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: CommandSetup SRPC call added to secure command service. 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;
25 struct NaClApp *nap;
26 };
27
28 int NaClSecureServiceCtor(
29 struct NaClSecureService *self,
30 struct NaClSrpcHandlerDesc const *srpc_handlers,
31 struct NaClApp *nap,
32 struct NaClDesc *service_port,
33 struct NaClDesc *sock_addr);
34
35 void NaClSecureServiceDtor(struct NaClRefCount *vself);
36
37 extern struct NaClSimpleServiceVtbl const kNaClSecureServiceVtbl;
38
39 struct NaClSecureRevClientConnHandler; /* fwd */
40
41 struct NaClSecureReverseClient {
42 struct NaClSimpleRevClient base;
43 struct NaClApp *nap;
44
45 struct NaClMutex mu;
46 /*
47 * |mu| protects the service entries hanging off of |queue_head|.
48 */
49 struct NaClSecureRevClientConnHandler *queue_head;
50 struct NaClSecureRevClientConnHandler **queue_insert;
51 };
52
53 struct NaClSecureReverseClientVtbl {
54 struct NaClSimpleRevClientVtbl vbase;
55
56 int (*InsertHandler)(
57 struct NaClSecureReverseClient *self,
58 void (*handler)(
59 void *handler_state,
60 struct NaClThreadInterface *thread_id,
61 struct NaClDesc *new_conn),
62 void *state);
63
64 struct NaClSecureRevClientConnHandler *(*RemoveHandler)(
65 struct NaClSecureReverseClient *self);
66 };
67
68 int NaClSecureReverseClientCtor(
69 struct NaClSecureReverseClient *self,
70 void (*client_callback)(
71 void *, struct NaClThreadInterface *, struct NaClDesc *),
72 void *state,
73 struct NaClApp *nap);
74
75 void NaClSecureReverseClientDtor(struct NaClRefCount *vself);
76
77 int NaClSecureReverseClientInsertHandler(
78 struct NaClSecureReverseClient *self,
79 void (*handler)(
80 void *handler_state,
81 struct NaClThreadInterface *thread_if,
82 struct NaClDesc *new_conn),
83 void *state) NACL_WUR;
84
85 struct NaClSecureRevClientConnHandler *NaClSecureReverseClientRemoveHandler(
86 struct NaClSecureReverseClient *self);
87
88 extern struct NaClSecureReverseClientVtbl const kNaClSecureReverseClientVtbl;
89
90 EXTERN_C_END
91
92 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_SECURE_SERVICE_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698