Trait enclave_runner::usercalls::UsercallExtension[][src]

pub trait UsercallExtension: 'static + Send + Sync + Debug {
    fn connect_stream<'future>(
        &'future self,
        addr: &'future str,
        local_addr: Option<&'future mut String>,
        peer_addr: Option<&'future mut String>
    ) -> Pin<Box<dyn Future<Output = IoResult<Option<Box<dyn AsyncStream>>>> + 'future>> { ... }
fn bind_stream<'future>(
        &'future self,
        addr: &'future str,
        local_addr: Option<&'future mut String>
    ) -> Pin<Box<dyn Future<Output = IoResult<Option<Box<dyn AsyncListener>>>> + 'future>> { ... } }
Expand description

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

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.

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.

Implementors