Crate smb_msg

Crate smb_msg 

Source
Expand description

§SMB Messages

This crate contains SMB-specific messages and structures, that are used by the SMB protocol.

Mostly, it contains SMB messages (like SMB2 Headers, SMB2 Requests & Responses, etc.). It also contains additional structures that are used by SMB specifically (for example, DFS referrals), but common structures (such as GUID) are found in the smb-types crate.

This crate is a part of the smb-rs project

§Usage

This crate is meant to be used with anyone who wants to implement SMB-related functionality in Rust. See the documentation of the crate for more information.

Configure the features to your use case: use server, client, or both.

§Documentation Note

Documentation for most of the structures in this crate is based on the official Microsoft documentation, and is vibe-documented accordingly (you can see the instructions in .github/copilot-instructions.md :)).

My tip for those who want an advanced, in-depth understanding of the SMB2 protocol - open up the official MS-SMB2 documentation from Microsoft, and read it alongside the code and documentation here. Most structs are named properly and are easily mappable to the official documentation, so you can get a deep understanding of the protocol that way.

§Code Generation

See the smb-dtyp-derive crate for more information about the code generation proc-macros used in this crate.

Re-exports§

pub use cancel::*;
pub use compressed::*;
pub use create::*;
pub use dfsc::*;
pub use echo::*;
pub use encrypted::*;
pub use error::*;
pub use file::*;
pub use header::*;
pub use info::*;
pub use ioctl::*;
pub use lock::*;
pub use message::*;
pub use negotiate::*;
pub use notify::*;
pub use oplock::*;
pub use plain::*;
pub use query_dir::*;
pub use session_setup::*;
pub use tree_connect::*;

Modules§

cancel
Cancel Request
compressed
Compressed messages
create
Create & Close (files) requests and responses.
dfsc
Distributed File System Referral Protocol (MS-DFSC) messages.
echo
Echo request and response messages
encrypted
Encrypted message and header implementation.
error
Error response message
file
File-related messages: Flush, Read, Write.
header
Plain Message Header and related types.
info
Query and Set Info messages.
ioctl
IOCTL requessts and responses implementation, and FSCTLs.
lock
Classic Lock request & response.
message
Full Request & Response enums, including plain or transformed (encrypted/compressed).
negotiate
notify
Change Notify Request and Response, and Server to Client Notification messages and related types.
oplock
OpLock messages (requests, responses, notifications)
plain
Full plain message implementation.
query_dir
Directory-related messages.
session_setup
Session setup messages
smb1
SMBv1 negotiation packet support.
tree_connect
Tree (share) connect & disconnect messages

Enums§

SmbMsgError
SMB Message related errors