# novotnyllc/cifs architecture

> Architecture diagram of the GitHub repository novotnyllc/cifs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/novotnyllc/cifs
- Repository: https://github.com/novotnyllc/cifs

## Overview

Cifs is a .NET CIFS/SMB client library. Its principal workflow is to configure credentials, create and manage a named server session, establish NetBIOS-over-TCP transport, negotiate/authenticate through SMB, and use the session for share access or remote administration. The tree also exposes name resolution and remote server, workstation, share, and user information. The README only identifies CIFS; the workflow and capabilities are derived from class names and sampled source, so uncertain internal links are omitted.

Main entry points: [`Cifs/SessionImpl.cs`](https://github.com/novotnyllc/cifs/blob/master/Cifs/SessionImpl.cs) (Session Runtime), [`Cifs/CifsSessionManager.cs`](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsSessionManager.cs) (Session Manager), [`Cifs/RemoteAdminImpl.cs`](https://github.com/novotnyllc/cifs/blob/master/Cifs/RemoteAdminImpl.cs) (Admin Operations), [`Cifs/NBTSession.cs`](https://github.com/novotnyllc/cifs/blob/master/Cifs/NBTSession.cs) (NetBIOS Session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Client API"]
  node_manager["Session Manager"]
  node_login["Credentials<br/>[CifsLogin.cs]"]
  node_session_api["Session API<br/>[CifsSession.cs]"]
end

subgraph group_sessions["Session and Shares"]
  node_session["Session Runtime<br/>[SessionImpl.cs]"]
  node_share["Share Access<br/>[Share.cs]"]
  node_share_info["Share Metadata<br/>[CifsShareInfo.cs]"]
end

subgraph group_protocol["CIFS Protocol"]
  node_nbt_session["NetBIOS Session<br/>[NBTSession.cs]"]
  node_name_resolver["Name Resolver<br/>[NBTNameResolver.cs]"]
  node_name_service["Name Service<br/>[NBTNameService.cs]"]
  node_udp["UDP Client<br/>[UDPCli.cs]"]
  node_smb["SMB Messages<br/>[SMBMessage.cs]"]
  node_marshal["Wire Buffer<br/>[MarshalBuffer.cs]"]
end

subgraph group_admin["Remote Administration"]
  node_remote_admin["Remote Admin API<br/>[CifsRemoteAdmin.cs]"]
  node_admin_impl["Admin Operations<br/>[RemoteAdminImpl.cs]"]
  node_server_info["Server Info<br/>[CifsServerInfo.cs]"]
  node_workstation_info["Workstation Info"]
  node_user_info["User Info<br/>[CifsUserInfo.cs]"]
end

node_user(("Application"))
node_server(("CIFS Server"))
node_wins(("WINS Server"))

node_user -->|"requests sessions"| node_manager
node_manager -->|"uses credentials"| node_login
node_manager -->|"manages sessions"| node_session
node_manager -->|"creates IPC share"| node_share
node_manager -->|"creates transport"| node_nbt_session
node_session_api -->|"implemented by"| node_session
node_session -->|"sends SMB over"| node_nbt_session
node_session -->|"builds and parses"| node_smb
node_session -->|"encodes data"| node_marshal
node_nbt_session -->|"queries status"| node_name_service
node_name_service -->|"sends queries"| node_udp
node_udp -.->|"queries names"| node_wins
node_name_resolver -->|"resolves names"| node_name_service
node_nbt_session -->|"opens TCP session"| node_server
node_session -->|"exchanges SMB"| node_server
node_share -->|"uses session"| node_session
node_share -->|"returns metadata"| node_share_info
node_manager -->|"creates admin session"| node_admin_impl
node_admin_impl -->|"implements"| node_remote_admin
node_admin_impl -->|"sends transactions"| node_session
node_admin_impl -->|"returns server data"| node_server_info
node_admin_impl -->|"returns workstation data"| node_workstation_info
node_admin_impl -->|"returns user data"| node_user_info
node_user -->|"requests administration"| node_remote_admin

click node_manager "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsSessionManager.cs"
click node_login "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsLogin.cs"
click node_session_api "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsSession.cs"
click node_session "https://github.com/novotnyllc/cifs/blob/master/Cifs/SessionImpl.cs"
click node_share "https://github.com/novotnyllc/cifs/blob/master/Cifs/Share.cs"
click node_share_info "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsShareInfo.cs"
click node_nbt_session "https://github.com/novotnyllc/cifs/blob/master/Cifs/NBTSession.cs"
click node_name_resolver "https://github.com/novotnyllc/cifs/blob/master/Cifs/NBTNameResolver.cs"
click node_name_service "https://github.com/novotnyllc/cifs/blob/master/Cifs/NBTNameService.cs"
click node_udp "https://github.com/novotnyllc/cifs/blob/master/Cifs/UDPCli.cs"
click node_smb "https://github.com/novotnyllc/cifs/blob/master/Cifs/SMBMessage.cs"
click node_marshal "https://github.com/novotnyllc/cifs/blob/master/Cifs/MarshalBuffer.cs"
click node_remote_admin "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsRemoteAdmin.cs"
click node_admin_impl "https://github.com/novotnyllc/cifs/blob/master/Cifs/RemoteAdminImpl.cs"
click node_server_info "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsServerInfo.cs"
click node_workstation_info "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsWorkstationInfo.cs"
click node_user_info "https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsUserInfo.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manager,node_login,node_session_api toneBlue
class node_session,node_share,node_share_info toneAmber
class node_nbt_session,node_name_resolver,node_name_service,node_udp,node_smb,node_marshal,node_server,node_wins toneMint
class node_remote_admin,node_admin_impl,node_server_info,node_workstation_info,node_user_info toneRose
class node_user toneIndigo
```

## Components

### Client API

- [Session Manager](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsSessionManager.cs): `Cifs/CifsSessionManager.cs`
- [Credentials](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsLogin.cs): `Cifs/CifsLogin.cs`
- [Session API](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsSession.cs): `Cifs/CifsSession.cs`

### Session and Shares

- [Session Runtime](https://github.com/novotnyllc/cifs/blob/master/Cifs/SessionImpl.cs): `Cifs/SessionImpl.cs`
- [Share Access](https://github.com/novotnyllc/cifs/blob/master/Cifs/Share.cs): `Cifs/Share.cs`
- [Share Metadata](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsShareInfo.cs): `Cifs/CifsShareInfo.cs`

### CIFS Protocol

- [NetBIOS Session](https://github.com/novotnyllc/cifs/blob/master/Cifs/NBTSession.cs): `Cifs/NBTSession.cs`
- [Name Resolver](https://github.com/novotnyllc/cifs/blob/master/Cifs/NBTNameResolver.cs): `Cifs/NBTNameResolver.cs`
- [Name Service](https://github.com/novotnyllc/cifs/blob/master/Cifs/NBTNameService.cs): `Cifs/NBTNameService.cs`
- [UDP Client](https://github.com/novotnyllc/cifs/blob/master/Cifs/UDPCli.cs): `Cifs/UDPCli.cs`
- [SMB Messages](https://github.com/novotnyllc/cifs/blob/master/Cifs/SMBMessage.cs): `Cifs/SMBMessage.cs`
- [Wire Buffer](https://github.com/novotnyllc/cifs/blob/master/Cifs/MarshalBuffer.cs): `Cifs/MarshalBuffer.cs`

### Remote Administration

- [Remote Admin API](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsRemoteAdmin.cs): `Cifs/CifsRemoteAdmin.cs`
- [Admin Operations](https://github.com/novotnyllc/cifs/blob/master/Cifs/RemoteAdminImpl.cs): `Cifs/RemoteAdminImpl.cs`
- [Server Info](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsServerInfo.cs): `Cifs/CifsServerInfo.cs`
- [Workstation Info](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsWorkstationInfo.cs): `Cifs/CifsWorkstationInfo.cs`
- [User Info](https://github.com/novotnyllc/cifs/blob/master/Cifs/CifsUserInfo.cs): `Cifs/CifsUserInfo.cs`

### Other components

- **Application**
- **CIFS Server**
- **WINS Server**

## Connections

- Application → Session Manager: requests sessions
- Session Manager → Credentials: uses credentials
- Session Manager → Session Runtime: manages sessions
- Session Manager → Share Access: creates IPC share
- Session Manager → NetBIOS Session: creates transport
- Session API → Session Runtime: implemented by
- Session Runtime → NetBIOS Session: sends SMB over
- Session Runtime → SMB Messages: builds and parses
- Session Runtime → Wire Buffer: encodes data
- NetBIOS Session → Name Service: queries status
- Name Service → UDP Client: sends queries
- UDP Client → WINS Server: queries names
- Name Resolver → Name Service: resolves names
- NetBIOS Session → CIFS Server: opens TCP session
- Session Runtime → CIFS Server: exchanges SMB
- Share Access → Session Runtime: uses session
- Share Access → Share Metadata: returns metadata
- Session Manager → Admin Operations: creates admin session
- Admin Operations → Remote Admin API: implements
- Admin Operations → Session Runtime: sends transactions
- Admin Operations → Server Info: returns server data
- Admin Operations → Workstation Info: returns workstation data
- Admin Operations → User Info: returns user data
- Application → Remote Admin API: requests administration
