[−][src]Trait enclave_runner::usercalls::UsercallExtension
Provides a mechanism for the enclave code to interface with an external service via a modified runner.
An implementation of UsercallExtension
can be registered while building the enclave.
Provided methods
fn connect_stream(
&self,
addr: &str,
local_addr: Option<&mut String>,
peer_addr: Option<&mut String>
) -> IoResult<Option<Box<dyn SyncStream>>>
&self,
addr: &str,
local_addr: Option<&mut String>,
peer_addr: Option<&mut String>
) -> IoResult<Option<Box<dyn SyncStream>>>
Override the connection target for connect calls by the enclave. The runner should determine the service that the enclave is trying to connect to by looking at addr.
If connect_stream
returns None, the default implementation of connect_stream
is used.
The enclave may optionally request the local or peer addresses
be returned in local_addr
or peer_addr
, respectively.
If local_addr
and/or peer_addr
are not None
, they will point to an empty String
.
On success, user-space can fill in the strings as appropriate.
The enclave must not make any security decisions based on the local or peer address received.
fn bind_stream(
&self,
addr: &str,
local_addr: Option<&mut String>
) -> IoResult<Option<Box<dyn SyncListener>>>
&self,
addr: &str,
local_addr: Option<&mut String>
) -> IoResult<Option<Box<dyn SyncListener>>>
Override the target for bind calls by the enclave. The runner should determine the service that the enclave is trying to bind to by looking at addr.
If bind_stream
returns None, the default implementation of bind_stream
is used.
The enclave may optionally request the local address be returned in local_addr
.
If local_addr
is not None
, it will point to an empty String
.
On success, user-space can fill in the string as appropriate.
The enclave must not make any security decisions based on the local address received.