Documentation
¶
Index ¶
- Variables
- func ExpectedTagging(iface *net.Interface, counter string) tagger.Mode
- func IPv6PublicHost(host string) bool
- func UserspaceTagging() string
- func WorkerMain()
- type CompileError
- type Debuglet
- func (d *Debuglet) Close(ctx context.Context) error
- func (d *Debuglet) GetSCIONAddr() string
- func (d *Debuglet) ID() uuid.UUID
- func (d *Debuglet) InitRuntime(ctx context.Context, wasmBytes []byte) error
- func (d *Debuglet) Registry() *socket.SocketRegistry
- func (d *Debuglet) Run(ctx context.Context, outputCh chan<- []byte, args []string) error
- func (d *Debuglet) StartServers(ctx context.Context, req StartServersReq) error
- func (d *Debuglet) TCPListenerEndpoint() string
- func (d *Debuglet) Tagging() tagger.Mode
- type StartServersReq
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ErrOutputIncomplete = errors.New("guest output was not fully accepted")
ErrOutputIncomplete means a nonempty stdout/stderr suffix was refused.
Functions ¶
func ExpectedTagging ¶ added in v0.3.0
ExpectedTagging is the mode a run on this node is set up to get: the kernel tagger where the eBPF packet counter loaded on the interface, since the tagger attaches to the same interface the same way, otherwise the pure-Go tagger. A run whose kernel tagger then fails to load falls back to the pure-Go tagger; Tagging reports what it actually got.
func IPv6PublicHost ¶ added in v0.3.0
IPv6PublicHost reports whether host is an IPv6 literal (IPv4-mapped counts as IPv4), under which a run that refuses IPv6 cannot offer a listener.
func UserspaceTagging ¶ added in v0.3.0
func UserspaceTagging() string
UserspaceTagging is the IPv4 mode the pure-Go tagger gives a run on this host: userspace where it can send tagged datagrams through raw sockets (Linux with CAP_NET_RAW), none elsewhere.
func WorkerMain ¶ added in v0.3.0
func WorkerMain()
WorkerMain dispatches the executor's private inherited-descriptor mode before normal configuration or credentials are loaded. It opens no network listener. Tests use the identical entry point in their test executable.
Types ¶
type CompileError ¶
type CompileError struct{ Err error }
CompileError is a module that wazero did not compile. Err is wazero's description of the failure, which can quote names from the module itself.
func (*CompileError) Error ¶
func (e *CompileError) Error() string
func (*CompileError) Unwrap ¶
func (e *CompileError) Unwrap() error
type Debuglet ¶
type Debuglet struct {
// contains filtered or unexported fields
}
Debuglet is the engine that loads, initialises, and runs a single WASM debuglet module. One Debuglet instance corresponds to one session.
func New ¶
func New(logger *zap.Logger, debugletID uuid.UUID, transactionID string, policy scheduler.Policy, operator netpolicy.Operator, schedule *tesla.KeySchedule, limiter *app.Limiter, pc ratelimit.PacketCount, iface *net.Interface, portManager *socket.PortManager, budget *socket.Budget) *Debuglet
New creates a ready-to-initialise Debuglet backed by a wazero Runtime. operator is the executor's network policy; together with the run's declared destinations it decides every transport the guest can use.
func (*Debuglet) Close ¶
Close terminates owned I/O and runtime resources exactly once. While InitRuntime is still running, Close leaves the runtime and any compiled module it published to InitRuntime, which releases them once on return. It does not wait for Run or its caller's watcher: the executor joins those separately. The context reaches wazero; it cannot force an arbitrary socket Close to end.
func (*Debuglet) GetSCIONAddr ¶
GetSCIONAddr returns the local SCION address of the server listener started during Init.
func (*Debuglet) InitRuntime ¶
InitRuntime starts the network servers and compiles and instantiates the WASM module. It must be called exactly once before Run.
func (*Debuglet) Registry ¶
func (d *Debuglet) Registry() *socket.SocketRegistry
func (*Debuglet) Run ¶
Run executes the debuglet's "_start" WASM export, streams stdout/stderr back through outputCh, and returns any execution error. The outputCh channel is closed when the debuglet finishes execution.
func (*Debuglet) StartServers ¶
func (d *Debuglet) StartServers(ctx context.Context, req StartServersReq) error
StartServers starts the network listeners required by this run after reserving each listener against its run and node budgets.
func (*Debuglet) TCPListenerEndpoint ¶ added in v0.3.0
type StartServersReq ¶
type Worker ¶ added in v0.3.0
type Worker struct {
*Debuglet
// contains filtered or unexported fields
}
Worker preserves the parent's networking environment. Only WASM compilation, WASI and linear memory live in the supervised process.
func NewWorker ¶ added in v0.3.0
func NewWorker(parent *Debuglet, supervisor *isolation.Supervisor) *Worker
func (*Worker) InitRuntime ¶ added in v0.3.0
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package netpolicy holds the one network policy the executor applies to guest traffic: which transports a guest may use, which destinations it may reach, and on which ports.
|
Package netpolicy holds the one network policy the executor applies to guest traffic: which transports a guest may use, which destinations it may reach, and on which ports. |
|
Package wasm contains the WASM host function implementations that are imported by WASM modules at runtime.
|
Package wasm contains the WASM host function implementations that are imported by WASM modules at runtime. |