Expand description
rustsmb binary entry point: CLI parsing, async accept loop, observability.
Modulesยง
- auth ๐
- Credential verification against the configured user database using the NTLM family of schemes ([MS-NLMP] ยง3.3).
- cmds
- SMB1 command routing and handlers.
- dispatch
- Per-connection request context and async frame loop.
- io
- Typestate request/response pipeline (see
docs/typestate_plan.md). - security
- NT security-descriptor helpers built on the
win-sdcrate ([MS-DTYP] ยง2.4.6). Marshalling of the self-relativeSECURITY_DESCRIPTOR/ACL/SIDblobs is delegated towin-sdrather than hand-rolled here. - session_
scope - Per-session state shared across the channels bound to one session ([MS-SMB2] ยง3.3.5.5.3 multichannel): the Session.TreeConnectTable and Session.OpenTable ([MS-SMB2] ยง3.3.1.8).
- smb2
- SMB2 protocol loop ([MS-SMB2]).
- srvsvc
- srvsvc DCERPC endpoint over named pipes ([MS-RPCE] + [MS-SRVS]).
- state
- Server-side state: configuration, sessions, tree connects, open handles and directory-search contexts.
Structsยง
- Args ๐
- Command-line interface.
Constantsยง
- DEFAULT_
PORT ๐ - Default TCP listen port when
--portis not supplied. - DURABLE_
SWEEP_ ๐INTERVAL_ SECS - Interval between durable-handle expiry sweeps.
- HTTP_
PROBE_ ๐READ_ LEN - Bytes drained from a stray HTTP probe before replying.
Functionsยง
- build_
handle_ ๐store - Build the durable-handle store from
--handle-store.redbpersists across a restart (persistent-handle reclaim); anything else is the in-memory store. - build_
shares ๐ - Build the published share table plus the virtual IPC$ share.
- build_
users ๐ - Parse USER:PASSWORD account specs into the user database.
- main ๐
- Entry point.
- random_
guid ๐ - spawn_
metrics_ ๐endpoint - Serve /metrics over a minimal HTTP/1.0 responder โ no framework needed for a single static endpoint, and scrape latency stays negligible.