Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Per-connection request context and async frame loop.

IoContext bundles the refcounted server metadata a handler needs — server config plus connection bookkeeping — together with the SMB command currently being served. Command routing lives in crate::cmds.

Structs§

IoContext
Bundled per-request context handed to every command handler.
ReqView
A parsed view over one request body inside the received frame.

Constants§

OUTBOUND_QUEUE_DEPTH 🔒
Depth of the per-connection outbound frame queue.

Functions§

process_frame 🔒
Execute one frame and build its response (None to stay silent).
rand_bytes
Cryptographically random bytes (urandom with time fallback).
rand_challenge 🔒
Cryptographically random per-connection NTLM challenge.
rand_challenge_pub
Cryptographically random per-connection NTLM challenge.
serve_client
Serve one client connection until EOF or transport error: read NBSS frames, route SMB1 and SMB2/3 (including encrypted/compressed transforms) to their processors, and release the session’s locks and durable handles on close.
writer_loop 🔒
Drain the outbound frame queue into the connection’s write half. Runs as a dedicated task so background work can emit unsolicited frames (async STATUS_PENDING completions, oplock/lease breaks, CHANGE_NOTIFY) while the reader blocks on recv. Ends when every [mpsc::Sender] clone is dropped.

Type Aliases§

IoCtx
Short alias used by command handlers.