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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/service_runtime/nacl_secure_service.h
diff --git a/src/trusted/service_runtime/nacl_secure_service.h b/src/trusted/service_runtime/nacl_secure_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..187a866b7eaa705dca364c670199f0649da450ef
--- /dev/null
+++ b/src/trusted/service_runtime/nacl_secure_service.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2012 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_SECURE_SERVICE_H_
+#define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_SECURE_SERVICE_H_
+
+#include "native_client/src/include/nacl_base.h"
+#include "native_client/src/trusted/service_runtime/sel_ldr.h"
+#include "native_client/src/trusted/simple_service/nacl_simple_service.h"
+#include "native_client/src/trusted/simple_service/nacl_simple_rservice.h"
+
+EXTERN_C_BEGIN
+
+struct NaClApp;
+
+/*
+ * Secure channel.
+ */
+
+struct NaClSecureService {
+ struct NaClSimpleService base;
+ struct NaClApp *nap;
+};
+
+int NaClSecureServiceCtor(
+ struct NaClSecureService *self,
+ struct NaClSrpcHandlerDesc const *srpc_handlers,
+ struct NaClApp *nap,
+ struct NaClDesc *service_port,
+ struct NaClDesc *sock_addr);
+
+void NaClSecureServiceDtor(struct NaClRefCount *vself);
+
+extern struct NaClSimpleServiceVtbl const kNaClSecureServiceVtbl;
+
+struct NaClSecureRevClientConnHandler; /* fwd */
+
+struct NaClSecureReverseClient {
+ struct NaClSimpleRevClient base;
+ struct NaClApp *nap;
+
+ struct NaClMutex mu;
+ /*
+ * |mu| protects the service entries hanging off of |queue_head|.
+ */
+ struct NaClSecureRevClientConnHandler *queue_head;
+ struct NaClSecureRevClientConnHandler **queue_insert;
+};
+
+struct NaClSecureReverseClientVtbl {
+ struct NaClSimpleRevClientVtbl vbase;
+
+ int (*InsertHandler)(
+ struct NaClSecureReverseClient *self,
+ void (*handler)(
+ void *handler_state,
+ struct NaClThreadInterface *thread_id,
+ struct NaClDesc *new_conn),
+ void *state);
+
+ struct NaClSecureRevClientConnHandler *(*RemoveHandler)(
+ struct NaClSecureReverseClient *self);
+};
+
+int NaClSecureReverseClientCtor(
+ struct NaClSecureReverseClient *self,
+ void (*client_callback)(
+ void *, struct NaClThreadInterface *, struct NaClDesc *),
+ void *state,
+ struct NaClApp *nap);
+
+void NaClSecureReverseClientDtor(struct NaClRefCount *vself);
+
+int NaClSecureReverseClientInsertHandler(
+ struct NaClSecureReverseClient *self,
+ void (*handler)(
+ void *handler_state,
+ struct NaClThreadInterface *thread_if,
+ struct NaClDesc *new_conn),
+ void *state) NACL_WUR;
+
+struct NaClSecureRevClientConnHandler *NaClSecureReverseClientRemoveHandler(
+ struct NaClSecureReverseClient *self);
+
+extern struct NaClSecureReverseClientVtbl const kNaClSecureReverseClientVtbl;
+
+EXTERN_C_END
+
+#endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_SECURE_SERVICE_H_ */

Powered by Google App Engine
This is Rietveld 408576698