Skip to main content

Module common

Module common 

Source
Expand description

The common module (shared between the CLI and enclave process).

Modules§

commands_parser
The module which parses command parameters from command-line arguments.
document_errors
The module which provides mappings between NitroCliErrors and their corresponding code.
json_output
The module which provides JSON-ready information structures.
logger
The module which provides the per-process logger.
signal_handler
The module which provides signal handling.

Structs§

NitroCliFailure
Struct that is passed along the backtrace and accumulates error messages.

Enums§

EnclaveProcessCommandType
The type of commands that can be sent to an enclave process.
EnclaveProcessReply
The type of replies that an enclave process can send to a CLI instance.
NitroCliErrorEnum
All possible errors which may occur.

Constants§

ENCLAVE_PROC_WAIT_TIMEOUT_MSEC
The amount of time in milliseconds an enclave process will wait for certain operations.
ENCLAVE_READY_VSOCK_PORT
The vsock port used to confirm that the enclave has booted.
MSG_ENCLAVE_CONFIRM
The confirmation code sent by an enclave process to a requesting CLI instance in order to signal that it is alive.
SOCKETS_DIR_PATH_ENV_VAR
The environment variable which holds the path to the Unix sockets directory.
VMADDR_CID_PARENT
The CID for the vsock device of the parent VM.

Traits§

ExitGracefully
A trait which allows a more graceful program exit instead of the standard panic. Provides a custom exit code.

Functions§

construct_error_message
Assembles the error message which gets displayed to the user.
enclave_proc_command_send_single
Send a command to a single socket.
get_socket_path
Get the path to the Unix socket owned by an enclave process which also owns the enclave with the given ID.
get_sockets_dir_path
Get the path to the directory containing the Unix sockets owned by all enclave processes.
notify_error
Notify both the user and the logger of an error.
read_u64_le
Read a LE-encoded 64-bit unsigned value from a socket.
receive_from_stream
Receive an object of a specified type from an input stream.
write_u64_le
Write a LE-encoded 64-bit unsigned value to a socket.

Type Aliases§

NitroCliResult
The most common result type provided by Nitro CLI operations.