Implement SMB 3.x Lease support Phase 1-2

Phase 1: Open struct lease fields
- lease_key: Option<[u8; 16]> - LeaseKey GUID
- lease_state: Option<u32> - READ/HANDLE/WRITE flags
- lease_flags: Option<u32> - BREAKING etc.

Phase 2: LeaseManager
- LeaseEntry with lease_key/state/flags
- register/unregister/can_grant methods
- break_lease returns LeaseBreakNotification
- LeaseBreakNotification struct (MS-SMB2 §2.2.26)

ServerState: lease_manager field added

All 229 tests pass.
This commit is contained in:
Warren
2026-06-21 01:20:18 +08:00
parent 3cf503d05f
commit 21a9c3c6c4
3 changed files with 127 additions and 0 deletions
+3
View File
@@ -198,6 +198,8 @@ pub struct ServerState {
pub shutting_down: Arc<AtomicBool>,
/// Global oplock state manager (Phase 2).
pub oplock_manager: Arc<crate::oplock::OplockManager>,
/// Global lease manager for SMB 3.x.
pub lease_manager: Arc<crate::oplock::LeaseManager>,
/// Global byte-range lock manager (Phase 7).
pub lock_manager: Arc<crate::oplock::LockManager>,
}
@@ -213,6 +215,7 @@ impl ServerState {
shutdown: Arc::new(Notify::new()),
shutting_down: Arc::new(AtomicBool::new(false)),
oplock_manager: Arc::new(crate::oplock::OplockManager::new()),
lease_manager: Arc::new(crate::oplock::LeaseManager::new()),
lock_manager: Arc::new(crate::oplock::LockManager::new()),
}
}