Skip to main content

Crate rustsmb

Crate rustsmb 

Source
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-sd crate ([MS-DTYP] ยง2.4.6). Marshalling of the self-relative SECURITY_DESCRIPTOR / ACL / SID blobs is delegated to win-sd rather 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 --port is 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. redb persists 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.